|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: {{ include "yet-another-cloudwatch-exporter.fullname" . }} |
| 5 | + labels: |
| 6 | + {{- include "yet-another-cloudwatch-exporter.labels" . | nindent 4 }} |
| 7 | +spec: |
| 8 | + replicas: {{ .Values.replicaCount }} |
| 9 | + selector: |
| 10 | + matchLabels: |
| 11 | + {{- include "yet-another-cloudwatch-exporter.selectorLabels" . | nindent 6 }} |
| 12 | + template: |
| 13 | + metadata: |
| 14 | + annotations: |
| 15 | + {{ if .Values.aws.role}}iam.amazonaws.com/role: {{ .Values.aws.role }}{{ end }} |
| 16 | + checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} |
| 17 | + {{- with .Values.podAnnotations }} |
| 18 | + {{- toYaml . | nindent 8 }} |
| 19 | + {{- end }} |
| 20 | + labels: |
| 21 | + {{- include "yet-another-cloudwatch-exporter.selectorLabels" . | nindent 8 }} |
| 22 | + {{- with .Values.podLabels }} |
| 23 | + {{- toYaml . | nindent 8 }} |
| 24 | + {{- end }} |
| 25 | + spec: |
| 26 | + {{- with .Values.imagePullSecrets }} |
| 27 | + imagePullSecrets: |
| 28 | + {{- toYaml . | nindent 8 }} |
| 29 | + {{- end }} |
| 30 | + serviceAccountName: {{ include "yet-another-cloudwatch-exporter.serviceAccountName" . }} |
| 31 | + securityContext: |
| 32 | + {{- toYaml .Values.podSecurityContext | nindent 8 }} |
| 33 | + containers: |
| 34 | + - name: {{ .Chart.Name }} |
| 35 | + securityContext: |
| 36 | + {{- toYaml .Values.securityContext | nindent 12 }} |
| 37 | + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" |
| 38 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 39 | + command: |
| 40 | + - "yace" |
| 41 | + - "--config.file=/config/config.yml" |
| 42 | + {{- range $key, $value := .Values.extraArgs }} |
| 43 | + - --{{ $key }}={{ $value }} |
| 44 | + {{- end }} |
| 45 | + volumeMounts: |
| 46 | + - name: vol-yet-another-cloudwatch-exporter |
| 47 | + mountPath: /config |
| 48 | + {{- if not .Values.aws.role }} |
| 49 | + {{- if .Values.aws.secret.name }} |
| 50 | + env: |
| 51 | + - name: AWS_ACCESS_KEY_ID |
| 52 | + valueFrom: |
| 53 | + secretKeyRef: |
| 54 | + key: access_key |
| 55 | + name: {{ .Values.aws.secret.name }} |
| 56 | + - name: AWS_SECRET_ACCESS_KEY |
| 57 | + valueFrom: |
| 58 | + secretKeyRef: |
| 59 | + key: secret_key |
| 60 | + name: {{ .Values.aws.secret.name }} |
| 61 | + {{- if .Values.aws.secret.includesSessionToken }} |
| 62 | + - name: AWS_SESSION_TOKEN |
| 63 | + valueFrom: |
| 64 | + secretKeyRef: |
| 65 | + key: security_token |
| 66 | + name: {{ .Values.aws.secret.name }} |
| 67 | + {{- end }} |
| 68 | + {{- else if and .Values.aws.aws_secret_access_key .Values.aws.aws_access_key_id }} |
| 69 | + env: |
| 70 | + - name: AWS_ACCESS_KEY_ID |
| 71 | + valueFrom: |
| 72 | + secretKeyRef: |
| 73 | + key: aws_access_key_id |
| 74 | + name: {{ include "yet-another-cloudwatch-exporter.fullname" . }} |
| 75 | + - name: AWS_SECRET_ACCESS_KEY |
| 76 | + valueFrom: |
| 77 | + secretKeyRef: |
| 78 | + key: aws_secret_access_key |
| 79 | + name: {{ include "yet-another-cloudwatch-exporter.fullname" . }} |
| 80 | + {{- end }} |
| 81 | + {{- end }} |
| 82 | + ports: |
| 83 | + - name: {{ .Values.portName }} |
| 84 | + containerPort: 5000 |
| 85 | + protocol: TCP |
| 86 | + livenessProbe: |
| 87 | + httpGet: |
| 88 | + path: /healthz |
| 89 | + port: {{ .Values.portName }} |
| 90 | + readinessProbe: |
| 91 | + httpGet: |
| 92 | + path: /healthz |
| 93 | + port: {{ .Values.portName }} |
| 94 | + resources: |
| 95 | + {{- toYaml .Values.resources | nindent 12 }} |
| 96 | + {{- with .Values.nodeSelector }} |
| 97 | + nodeSelector: |
| 98 | + {{- toYaml . | nindent 8 }} |
| 99 | + {{- end }} |
| 100 | + {{- with .Values.affinity }} |
| 101 | + affinity: |
| 102 | + {{- toYaml . | nindent 8 }} |
| 103 | + {{- end }} |
| 104 | + {{- if .Values.priorityClassName }} |
| 105 | + priorityClassName: {{ .Values.priorityClassName }} |
| 106 | + {{- end }} |
| 107 | + {{- with .Values.tolerations }} |
| 108 | + tolerations: |
| 109 | + {{- toYaml . | nindent 8 }} |
| 110 | + {{- end }} |
| 111 | + volumes: |
| 112 | + - configMap: |
| 113 | + defaultMode: 420 |
| 114 | + name: {{ include "yet-another-cloudwatch-exporter.fullname" . }} |
| 115 | + name: vol-yet-another-cloudwatch-exporter |
0 commit comments