|
| 1 | +{{- if .Values.handler.enabled }} |
| 2 | +apiVersion: apps/v1 |
| 3 | +kind: Deployment |
| 4 | +metadata: |
| 5 | + name: {{ include "lightspeed-agent.handlerServiceName" . }} |
| 6 | + labels: |
| 7 | + {{- include "lightspeed-agent.labels" . | nindent 4 }} |
| 8 | + app.kubernetes.io/component: handler |
| 9 | +spec: |
| 10 | + replicas: {{ .Values.handler.replicas }} |
| 11 | + selector: |
| 12 | + matchLabels: |
| 13 | + {{- include "lightspeed-agent.handlerSelectorLabels" . | nindent 6 }} |
| 14 | + template: |
| 15 | + metadata: |
| 16 | + labels: |
| 17 | + {{- include "lightspeed-agent.handlerSelectorLabels" . | nindent 8 }} |
| 18 | + spec: |
| 19 | + containers: |
| 20 | + - name: marketplace-handler |
| 21 | + image: {{ printf "%s:%s" .Values.handler.image.repository .Values.handler.image.tag }} |
| 22 | + imagePullPolicy: {{ .Values.handler.image.pullPolicy }} |
| 23 | + ports: |
| 24 | + - containerPort: {{ .Values.handler.port }} |
| 25 | + protocol: TCP |
| 26 | + name: http |
| 27 | + envFrom: |
| 28 | + - configMapRef: |
| 29 | + name: {{ include "lightspeed-agent.fullname" . }}-config |
| 30 | + env: |
| 31 | + - name: GOOGLE_APPLICATION_CREDENTIALS |
| 32 | + value: /var/run/secrets/gcp/sa-key.json |
| 33 | + - name: GOOGLE_API_KEY |
| 34 | + valueFrom: |
| 35 | + secretKeyRef: |
| 36 | + name: {{ include "lightspeed-agent.fullname" . }}-secrets |
| 37 | + key: GOOGLE_API_KEY |
| 38 | + - name: GOOGLE_CLOUD_PROJECT |
| 39 | + valueFrom: |
| 40 | + secretKeyRef: |
| 41 | + name: {{ include "lightspeed-agent.fullname" . }}-secrets |
| 42 | + key: GOOGLE_CLOUD_PROJECT |
| 43 | + optional: true |
| 44 | + - name: RED_HAT_SSO_CLIENT_ID |
| 45 | + valueFrom: |
| 46 | + secretKeyRef: |
| 47 | + name: {{ include "lightspeed-agent.fullname" . }}-secrets |
| 48 | + key: RED_HAT_SSO_CLIENT_ID |
| 49 | + - name: RED_HAT_SSO_CLIENT_SECRET |
| 50 | + valueFrom: |
| 51 | + secretKeyRef: |
| 52 | + name: {{ include "lightspeed-agent.fullname" . }}-secrets |
| 53 | + key: RED_HAT_SSO_CLIENT_SECRET |
| 54 | + - name: DATABASE_URL |
| 55 | + valueFrom: |
| 56 | + secretKeyRef: |
| 57 | + name: {{ include "lightspeed-agent.fullname" . }}-secrets |
| 58 | + key: DATABASE_URL |
| 59 | + - name: DCR_INITIAL_ACCESS_TOKEN |
| 60 | + valueFrom: |
| 61 | + secretKeyRef: |
| 62 | + name: {{ include "lightspeed-agent.fullname" . }}-secrets |
| 63 | + key: DCR_INITIAL_ACCESS_TOKEN |
| 64 | + - name: DCR_ENCRYPTION_KEY |
| 65 | + valueFrom: |
| 66 | + secretKeyRef: |
| 67 | + name: {{ include "lightspeed-agent.fullname" . }}-secrets |
| 68 | + key: DCR_ENCRYPTION_KEY |
| 69 | + volumeMounts: |
| 70 | + - name: gcp-sa-key |
| 71 | + mountPath: /var/run/secrets/gcp |
| 72 | + readOnly: true |
| 73 | + resources: |
| 74 | + {{- toYaml .Values.handler.resources | nindent 12 }} |
| 75 | + startupProbe: |
| 76 | + httpGet: |
| 77 | + path: /health |
| 78 | + port: {{ .Values.handler.port }} |
| 79 | + initialDelaySeconds: 5 |
| 80 | + periodSeconds: 10 |
| 81 | + failureThreshold: 6 |
| 82 | + readinessProbe: |
| 83 | + httpGet: |
| 84 | + path: /ready |
| 85 | + port: {{ .Values.handler.port }} |
| 86 | + periodSeconds: 10 |
| 87 | + failureThreshold: 3 |
| 88 | + livenessProbe: |
| 89 | + httpGet: |
| 90 | + path: /health |
| 91 | + port: {{ .Values.handler.port }} |
| 92 | + periodSeconds: 30 |
| 93 | + failureThreshold: 3 |
| 94 | + volumes: |
| 95 | + - name: gcp-sa-key |
| 96 | + secret: |
| 97 | + secretName: {{ include "lightspeed-agent.fullname" . }}-gcp-sa-key |
| 98 | +{{- end }} |
0 commit comments