|
| 1 | +{{- if .Values.slackbot.enabled -}} |
| 2 | +apiVersion: apps/v1 |
| 3 | +kind: Deployment |
| 4 | +metadata: |
| 5 | + name: {{ include "kagent.fullname" . }}-slackbot |
| 6 | + namespace: {{ include "kagent.namespace" . }} |
| 7 | + labels: |
| 8 | + {{- include "kagent.slackbot.labels" . | nindent 4 }} |
| 9 | +spec: |
| 10 | + {{- if not .Values.slackbot.autoscaling.enabled }} |
| 11 | + replicas: {{ .Values.slackbot.replicas }} |
| 12 | + {{- end }} |
| 13 | + selector: |
| 14 | + matchLabels: |
| 15 | + {{- include "kagent.slackbot.selectorLabels" . | nindent 6 }} |
| 16 | + template: |
| 17 | + metadata: |
| 18 | + annotations: |
| 19 | + {{- with .Values.slackbot.podAnnotations | default .Values.podAnnotations }} |
| 20 | + {{- toYaml . | nindent 8 }} |
| 21 | + {{- end }} |
| 22 | + labels: |
| 23 | + {{- include "kagent.slackbot.selectorLabels" . | nindent 8 }} |
| 24 | + spec: |
| 25 | + {{- with .Values.imagePullSecrets }} |
| 26 | + imagePullSecrets: |
| 27 | + {{- toYaml . | nindent 8 }} |
| 28 | + {{- end }} |
| 29 | + securityContext: |
| 30 | + {{- toYaml .Values.podSecurityContext | nindent 8 }} |
| 31 | + serviceAccountName: {{ include "kagent.fullname" . }}-slackbot |
| 32 | + {{- with .Values.slackbot.nodeSelector }} |
| 33 | + nodeSelector: |
| 34 | + {{- toYaml . | nindent 8 }} |
| 35 | + {{- end }} |
| 36 | + {{- with .Values.slackbot.tolerations }} |
| 37 | + tolerations: |
| 38 | + {{- toYaml . | nindent 8 }} |
| 39 | + {{- end }} |
| 40 | + containers: |
| 41 | + - name: slackbot |
| 42 | + securityContext: |
| 43 | + {{- toYaml .Values.securityContext | nindent 12 }} |
| 44 | + image: "{{ .Values.slackbot.image.registry | default .Values.registry }}/{{ .Values.slackbot.image.repository }}:{{ coalesce .Values.tag .Values.slackbot.image.tag .Chart.Version }}" |
| 45 | + imagePullPolicy: {{ .Values.slackbot.image.pullPolicy | default .Values.imagePullPolicy }} |
| 46 | + env: |
| 47 | + # Slack credentials from secret |
| 48 | + - name: SLACK_BOT_TOKEN |
| 49 | + valueFrom: |
| 50 | + secretKeyRef: |
| 51 | + name: {{ include "kagent.fullname" . }}-slackbot-secrets |
| 52 | + key: slack-bot-token |
| 53 | + - name: SLACK_APP_TOKEN |
| 54 | + valueFrom: |
| 55 | + secretKeyRef: |
| 56 | + name: {{ include "kagent.fullname" . }}-slackbot-secrets |
| 57 | + key: slack-app-token |
| 58 | + - name: SLACK_SIGNING_SECRET |
| 59 | + valueFrom: |
| 60 | + secretKeyRef: |
| 61 | + name: {{ include "kagent.fullname" . }}-slackbot-secrets |
| 62 | + key: slack-signing-secret |
| 63 | + # Kagent configuration |
| 64 | + - name: KAGENT_BASE_URL |
| 65 | + value: "http://{{ include "kagent.fullname" . }}-controller.{{ include "kagent.namespace" . }}.svc.cluster.local:{{ .Values.controller.service.ports.port }}" |
| 66 | + - name: KAGENT_TIMEOUT |
| 67 | + value: {{ .Values.slackbot.config.kagentTimeout | quote }} |
| 68 | + # Server configuration |
| 69 | + - name: SERVER_HOST |
| 70 | + value: {{ .Values.slackbot.config.serverHost | quote }} |
| 71 | + - name: SERVER_PORT |
| 72 | + value: {{ .Values.slackbot.config.serverPort | quote }} |
| 73 | + # Logging |
| 74 | + - name: LOG_LEVEL |
| 75 | + value: {{ .Values.slackbot.config.logLevel | quote }} |
| 76 | + # Permissions file |
| 77 | + - name: PERMISSIONS_FILE |
| 78 | + value: "/app/config/permissions.yaml" |
| 79 | + {{- with .Values.slackbot.env }} |
| 80 | + {{- toYaml . | nindent 12 }} |
| 81 | + {{- end }} |
| 82 | + ports: |
| 83 | + - name: http |
| 84 | + containerPort: {{ .Values.slackbot.config.serverPort }} |
| 85 | + protocol: TCP |
| 86 | + resources: |
| 87 | + {{- toYaml .Values.slackbot.resources | nindent 12 }} |
| 88 | + livenessProbe: |
| 89 | + httpGet: |
| 90 | + path: /health |
| 91 | + port: http |
| 92 | + initialDelaySeconds: 30 |
| 93 | + periodSeconds: 10 |
| 94 | + timeoutSeconds: 5 |
| 95 | + failureThreshold: 3 |
| 96 | + readinessProbe: |
| 97 | + httpGet: |
| 98 | + path: /ready |
| 99 | + port: http |
| 100 | + initialDelaySeconds: 5 |
| 101 | + periodSeconds: 5 |
| 102 | + timeoutSeconds: 3 |
| 103 | + failureThreshold: 3 |
| 104 | + volumeMounts: |
| 105 | + - name: tmp |
| 106 | + mountPath: /tmp |
| 107 | + - name: permissions-config |
| 108 | + mountPath: /app/config |
| 109 | + readOnly: true |
| 110 | + volumes: |
| 111 | + - name: tmp |
| 112 | + emptyDir: {} |
| 113 | + - name: permissions-config |
| 114 | + configMap: |
| 115 | + name: {{ include "kagent.fullname" . }}-slackbot-config |
| 116 | + items: |
| 117 | + - key: permissions.yaml |
| 118 | + path: permissions.yaml |
| 119 | +{{- end }} |
0 commit comments