apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "aws-node-termination-handler.fullname" . }} namespace: {{ .Release.Namespace }} labels: {{- include "aws-node-termination-handler.labels" . | nindent 8 }} {{- with .Values.annotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} spec: replicas: {{ .Values.pod.replicas }} {{- with .Values.pod.updateStrategy }} strategy: {{- toYaml . | nindent 8 }} {{- end }} selector: matchLabels: {{- include "aws-node-termination-handler.selectorLabels" . | nindent 12 }} template: metadata: labels: {{- include "aws-node-termination-handler.selectorLabels" . | nindent 16 }} {{- with .Values.pod.labels }} {{- toYaml . | nindent 16 }} {{- end }} {{- with .Values.pod.annotations }} annotations: {{- toYaml . | nindent 16 }} {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 16 }} {{- end }} serviceAccountName: {{ include "aws-node-termination-handler.serviceAccountName" . }} {{- with .Values.pod.securityContext }} securityContext: {{- toYaml . | nindent 16 }} {{- end }} {{- with .Values.pod.priorityClassName }} priorityClassName: {{ . | quote }} {{- end }} {{- with .Values.terminationGracePeriodSeconds }} terminationGracePeriodSeconds: {{ . }} {{- end }} {{- if .Values.pod.hostNetwork }} hostNetwork: true {{- end }} {{- with .Values.pod.nodeSelector }} nodeSelector: {{- toYaml . | nindent 16 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 16 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 16 }} {{- end }} containers: - name: controller image: {{ .Values.controller.image }} imagePullPolicy: {{ .Values.imagePullPolicy }} {{- with .Values.controller.securityContext }} securityContext: {{- toYaml . | nindent 22 }} {{- end }} env: - name: NODE_NAME valueFrom: fieldRef: fieldPath: spec.nodeName - name: POD_NAME valueFrom: fieldRef: fieldPath: metadata.name - name: NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace - name: SYSTEM_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace {{- with .Values.aws.region }} - name: AWS_REGION value: {{ . | quote}} {{- end }} {{- with .Values.controller.env }} {{- toYaml . | nindent 22 }} {{- end }} ports: - name: http-metrics containerPort: 8080 protocol: TCP - name: http-probes containerPort: 8081 protocol: TCP livenessProbe: httpGet: path: /healthz port: http-probes readinessProbe: httpGet: path: /readyz port: http-probes {{- with .Values.controller.resources }} resources: {{- toYaml . | nindent 22 }} {{- end }} - name: webhook image: {{ .Values.webhook.image }} imagePullPolicy: {{ .Values.imagePullPolicy }} {{- with .Values.webhook.securityContext }} securityContext: {{- toYaml . | nindent 22 }} {{- end }} env: - name: SERVICE_PORT value: {{ .Values.webhook.port | quote }} - name: SERVICE_NAME value: {{ include "aws-node-termination-handler.fullname" . }} - name: SYSTEM_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace {{- with .Values.aws.region }} - name: AWS_REGION value: {{ . | quote}} {{- end }} {{- with .Values.webhook.env }} {{- toYaml . | nindent 26 }} {{- end }} ports: - name: https-webhook containerPort: {{ .Values.webhook.port }} protocol: TCP livenessProbe: httpGet: port: https-webhook scheme: HTTPS path: /healthz readinessProbe: httpGet: port: https-webhook scheme: HTTPS path: /readyz {{- with .Values.webhook.resources }} resources: {{- toYaml . | nindent 22 }} {{- end }}