Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemente tolerations for deployment #119

Open
julianobarbosa opened this issue Aug 28, 2024 · 3 comments
Open

Implemente tolerations for deployment #119

julianobarbosa opened this issue Aug 28, 2024 · 3 comments

Comments

@julianobarbosa
Copy link

implement tolerations for deployment

@julianobarbosa
Copy link
Author

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
Copy link
Author

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
      ```

@arikalon1
Copy link
Contributor

@julianobarbosa this will be available on the next holmes release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants