|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: {{ include "eks-pod-identity-webhook.fullname" . }}-deployment |
| 5 | + namespace: {{ .Release.Namespace }} |
| 6 | + labels: |
| 7 | + app.kubernetes.io/name: {{ include "eks-pod-identity-webhook.name" . }} |
| 8 | + app.kubernetes.io/instance: {{ include "eks-pod-identity-webhook.fullname" . }} |
| 9 | +spec: |
| 10 | + replicas: {{ .Values.replicaCount }} |
| 11 | + selector: |
| 12 | + matchLabels: |
| 13 | + app.kubernetes.io/name: {{ include "eks-pod-identity-webhook.name" . }} |
| 14 | + app.kubernetes.io/instance: {{ include "eks-pod-identity-webhook.fullname" . }} |
| 15 | + template: |
| 16 | + metadata: |
| 17 | + labels: |
| 18 | + app.kubernetes.io/name: {{ include "eks-pod-identity-webhook.name" . }} |
| 19 | + app.kubernetes.io/instance: {{ include "eks-pod-identity-webhook.fullname" . }} |
| 20 | + spec: |
| 21 | + serviceAccountName: {{ .Values.serviceAccount.name }} |
| 22 | + automountServiceAccountToken: true |
| 23 | + nodeSelector: |
| 24 | +{{ toYaml .Values.nodeSelector | indent 8 }} |
| 25 | + containers: |
| 26 | + - name: webhook |
| 27 | + image: {{ .Values.image.repository }}:{{ .Values.image.tag }} |
| 28 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 29 | + args: |
| 30 | + - "--tls-cert-path=/etc/webhook/certs/tls.crt" |
| 31 | + - "--tls-key-path=/etc/webhook/certs/tls.key" |
| 32 | + - "--listen-addr=:8443" |
| 33 | + - "--aws-region={{ .Values.env.AWS_REGION }}" |
| 34 | + ports: |
| 35 | + - name: webhook-https |
| 36 | + containerPort: 8443 |
| 37 | + protocol: TCP |
| 38 | + env: |
| 39 | + - name: GIN_MODE |
| 40 | + value: {{ .Values.env.GIN_MODE }} |
| 41 | + securityContext: |
| 42 | + allowPrivilegeEscalation: false |
| 43 | + capabilities: |
| 44 | + drop: |
| 45 | + - "ALL" |
| 46 | + readOnlyRootFilesystem: true |
| 47 | + volumeMounts: |
| 48 | + - name: webhook-tls-certs |
| 49 | + mountPath: /etc/webhook/certs |
| 50 | + readOnly: true |
| 51 | + livenessProbe: |
| 52 | + httpGet: |
| 53 | + path: /healthz |
| 54 | + port: webhook-https |
| 55 | + scheme: HTTPS |
| 56 | + initialDelaySeconds: 5 |
| 57 | + periodSeconds: 10 |
| 58 | + readinessProbe: |
| 59 | + httpGet: |
| 60 | + path: /healthz |
| 61 | + port: webhook-https |
| 62 | + scheme: HTTPS |
| 63 | + initialDelaySeconds: 5 |
| 64 | + periodSeconds: 10 |
| 65 | + resources: |
| 66 | +{{ toYaml .Values.resources | indent 12 }} |
| 67 | + volumes: |
| 68 | + - name: webhook-tls-certs |
| 69 | + secret: |
| 70 | + secretName: {{ default .Values.certManager.secretName .Values.existingTLSSecret }} |
| 71 | + securityContext: |
| 72 | + runAsNonRoot: true |
| 73 | + runAsUser: 1000 |
| 74 | + fsGroup: 1000 |
| 75 | + affinity: |
| 76 | +{{ toYaml .Values.affinity | indent 8 }} |
0 commit comments