holmesgpt icon indicating copy to clipboard operation
holmesgpt copied to clipboard

Implemente tolerations for deployment

Open julianobarbosa opened this issue 1 year ago • 3 comments

implement tolerations for deployment

julianobarbosa avatar Aug 28 '24 17:08 julianobarbosa

values.yaml

certificate: "" # base64 encoded
logLevel: INFO
additionalEnvVars: []
imagePullSecrets: []
allowedToolsets: "kubernetes/core"
image: holmes:0.0.0
registry: us-central1-docker.pkg.dev/genuine-flight-317411/devel
enableAccountsCreate: true
createServiceAccount: true
customServiceAccountName: ""
customClusterRoleRules: []
enablePostProcessing: false
postProcessingPrompt: "builtin://generic_post_processing.jinja2"
tolerations: []
serviceAccount:
  imagePullSecrets: []
  annotations: {}

julianobarbosa avatar Aug 28 '24 17:08 julianobarbosa

holmes.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{ .Release.Name }}-holmes
  namespace: {{ .Release.Namespace }}
  labels:
    app: holmes
spec:
  replicas: 1
  selector:
    matchLabels:
      app: holmes
  template:
    metadata:
      labels:
        app: holmes
    spec:
      {{- if .Values.customServiceAccountName }}
      serviceAccountName: {{ .Values.customServiceAccountName }}
      {{ else }}
      serviceAccountName: {{ .Release.Name }}-holmes-service-account
      {{- end }}
      {{- if .Values.imagePullSecrets }}
      imagePullSecrets:
      {{- toYaml .Values.imagePullSecrets | nindent 6 }}
      {{- end }}
      containers:
      - name: holmes
        image: "{{ .Values.registry }}/{{ .Values.image }}"
        imagePullPolicy: Always
        command: ["python3", "-u", "server.py"]
        env:
          - name: LOG_LEVEL
            value: {{ .Values.logLevel }}
          - name: ALLOWED_TOOLSETS
            value: {{ .Values.allowedToolsets }}
          {{ if .Values.certificate -}}
          - name: CERTIFICATE
            value: {{ .Values.certificate }}
          {{- end }}
          {{ if .Values.enablePostProcessing -}}
          - name: HOLMES_POST_PROCESSING_PROMPT
            value: {{ .Values.postProcessingPrompt }}
          {{- end }}
          {{- if .Values.additionalEnvVars -}}
          {{ toYaml .Values.additionalEnvVars | nindent 10 }}
          {{- end }}
        lifecycle:
          preStop:
            exec:
              command: ["bash", "-c", "kill -SIGINT 1"]
      {{- if .Values.tolerations }}
      tolerations:
      {{- toYaml .Values.tolerations | nindent 8 }}
      {{- end }}
        volumeMounts:
          - name: playbooks-config-secret
            mountPath: /etc/robusta/config
      volumes:
        - name: playbooks-config-secret
          secret:
            secretName: robusta-playbooks-config-secret
            optional: true

---
apiVersion: v1
kind: Service
metadata:
  name: {{ .Release.Name }}-holmes
  namespace: {{ .Release.Namespace }}
  labels:
    app: holmes
spec:
  selector:
    app: holmes
  ports:
    - name: http
      protocol: TCP
      port: 80
      targetPort: 5050
      ```

julianobarbosa avatar Aug 28 '24 17:08 julianobarbosa

@julianobarbosa this will be available on the next holmes release

arikalon1 avatar Aug 30 '24 16:08 arikalon1