|
| 1 | +{{ if eq .Values.DeploymentMode "DaemonSet" }} |
| 2 | +apiVersion: apps/v1 |
| 3 | +kind: DaemonSet |
| 4 | +metadata: |
| 5 | + name: {{ include "s3proxy.fullname" . }} |
| 6 | + labels: |
| 7 | + {{- include "s3proxy.labels" . | nindent 4 }} |
| 8 | + annotations: |
| 9 | + checkov.io/skip1: CKV_K8S_35=Inorder to use a generated secret in two ways we can't do this |
| 10 | +spec: |
| 11 | + selector: |
| 12 | + matchLabels: |
| 13 | + {{- include "s3proxy.selectorLabels" . | nindent 6 }} |
| 14 | + template: |
| 15 | + metadata: |
| 16 | + {{- with .Values.podAnnotations }} |
| 17 | + annotations: |
| 18 | + {{- toYaml . | nindent 8 }} |
| 19 | + {{- end }} |
| 20 | + labels: |
| 21 | + {{- include "s3proxy.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 "s3proxy.serviceAccountName" . }} |
| 31 | + automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken | default false }} |
| 32 | + |
| 33 | + securityContext: |
| 34 | + {{- toYaml .Values.podSecurityContext | nindent 8 }} |
| 35 | + containers: |
| 36 | + - name: {{ .Chart.Name }} |
| 37 | + securityContext: |
| 38 | + {{- toYaml .Values.securityContext | nindent 12 }} |
| 39 | + #checkov:skip=CKV_K8S_43: Not for Public Charts |
| 40 | + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" |
| 41 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 42 | + command: |
| 43 | + {{- .Values.command | toYaml | nindent 12 }} |
| 44 | + args: |
| 45 | + {{- .Values.args | toYaml | nindent 12 }} |
| 46 | + env: |
| 47 | + - name: S3PROXY_IDENTITY |
| 48 | + valueFrom: |
| 49 | + secretKeyRef: |
| 50 | + {{- if empty .Values.existingSecretName }} |
| 51 | + name: "{{ include "s3proxy.fullname" . }}-awsclient" |
| 52 | + {{- else }} |
| 53 | + name: {{ .Values.existingSecretName }} |
| 54 | + {{- end }} |
| 55 | + key: AWS_ACCESS_KEY_ID |
| 56 | + optional: false |
| 57 | + - name: S3PROXY_CREDENTIAL |
| 58 | + valueFrom: |
| 59 | + secretKeyRef: |
| 60 | + {{- if empty .Values.existingSecretName }} |
| 61 | + name: "{{ include "s3proxy.fullname" . }}-awsclient" |
| 62 | + {{- else }} |
| 63 | + name: {{ .Values.existingSecretName }} |
| 64 | + {{- end }} |
| 65 | + key: AWS_SECRET_ACCESS_KEY |
| 66 | + optional: false |
| 67 | + {{- with .Values.config.env }} |
| 68 | + {{- toYaml . | nindent 10 }} |
| 69 | + {{- end }} |
| 70 | + ports: |
| 71 | + - name: http |
| 72 | + containerPort: {{ .Values.service.port }} |
| 73 | + protocol: TCP |
| 74 | + # livenessProbe: |
| 75 | + # httpGet: |
| 76 | + # path: / |
| 77 | + # port: http |
| 78 | + # readinessProbe: |
| 79 | + # httpGet: |
| 80 | + # path: / |
| 81 | + # port: http |
| 82 | + resources: |
| 83 | + {{- toYaml .Values.resources | nindent 12 }} |
| 84 | + volumeMounts: |
| 85 | + {{- if eq .Values.config.jclouds.provider "filesystem" }} |
| 86 | + - mountPath: {{ .Values.config.jclouds.filesystem.baseDir }} |
| 87 | + name: tmp-volume |
| 88 | + {{- end }} |
| 89 | + - name: secret-volume |
| 90 | + readOnly: true |
| 91 | + mountPath: "/etc/s3proxy" |
| 92 | + volumes: |
| 93 | + {{- if eq .Values.config.jclouds.provider "filesystem" }} |
| 94 | + - name: tmp-volume |
| 95 | + emptyDir: |
| 96 | + sizeLimit: {{ .Values.config.jclouds.filesystem.tmpSize }} |
| 97 | + {{- end }} |
| 98 | + - name: secret-volume |
| 99 | + {{- if .Values.csiSecret.enabled }} |
| 100 | + csi: |
| 101 | + driver: {{ .Values.csiSecret.driver | default "secrets-store.csi.k8s.io" }} |
| 102 | + readOnly: {{ .Values.csiSecret.readOnly | default true }} |
| 103 | + volumeAttributes: |
| 104 | + secretProviderClass: {{ .Values.csiSecret.class }} |
| 105 | + {{ else }} |
| 106 | + secret: |
| 107 | + {{- if .Values.existingPropertiesSecret }} |
| 108 | + secretName: {{ .Values.existingPropertiesSecret }} |
| 109 | + {{ else }} |
| 110 | + secretName: {{ include "s3proxy.fullname" . }} |
| 111 | + {{- end }} |
| 112 | + {{- end }} |
| 113 | + {{- with .Values.nodeSelector }} |
| 114 | + nodeSelector: |
| 115 | + {{- toYaml . | nindent 8 }} |
| 116 | + {{- end }} |
| 117 | + {{- with .Values.affinity }} |
| 118 | + affinity: |
| 119 | + {{- toYaml . | nindent 8 }} |
| 120 | + {{- end }} |
| 121 | + {{- with .Values.tolerations }} |
| 122 | + tolerations: |
| 123 | + {{- toYaml . | nindent 8 }} |
| 124 | + {{- end }} |
| 125 | + {{- with .Values.topologySpreadConstraints }} |
| 126 | + topologySpreadConstraints: |
| 127 | + {{- toYaml . | nindent 8 }} |
| 128 | + {{- end }} |
| 129 | +{{- end }} |
0 commit comments