|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: {{ .Release.Name }} |
| 5 | + namespace: {{ .Release.Namespace }} |
| 6 | + labels: |
| 7 | + role: {{ .Values.proxy.role }} |
| 8 | +spec: |
| 9 | + replicas: {{ .Values.proxy.replicas }} |
| 10 | + selector: |
| 11 | + matchLabels: |
| 12 | + role: {{ .Values.proxy.role }} |
| 13 | + template: |
| 14 | + metadata: |
| 15 | + name: {{ .Release.Name }} |
| 16 | + labels: |
| 17 | + role: {{ .Values.proxy.role }} |
| 18 | + spec: |
| 19 | + serviceAccountName: {{ .Values.proxy.serviceAccountName }} |
| 20 | + initContainers: |
| 21 | + - name: wait-for-secret |
| 22 | + image: bitnami/kubectl:1.29 |
| 23 | + command: |
| 24 | + - /bin/sh |
| 25 | + - -c |
| 26 | + - | |
| 27 | + for i in $(seq 1 120); do |
| 28 | + kubectl get secret -n {{ .Release.Namespace }} {{ .Values.proxyCertificate.secretName }} && exit 0 |
| 29 | + echo "Waiting for secret {{ .Values.proxyCertificate.secretName }}..." |
| 30 | + sleep 5 |
| 31 | + done |
| 32 | + echo "Timed out waiting for secret" |
| 33 | + exit 1 |
| 34 | + containers: |
| 35 | + - name: main |
| 36 | + image: "{{ .Values.proxy.image.repository }}:{{ .Values.proxy.image.tag }}" |
| 37 | + imagePullPolicy: {{ .Values.proxy.image.pullPolicy }} |
| 38 | + env: {{ toYaml .Values.proxy.env | nindent 8 }} |
| 39 | + resources: {{ toYaml .Values.proxy.resources | nindent 10 }} |
| 40 | + ports: |
| 41 | + - name: metrics |
| 42 | + containerPort: {{ .Values.proxy.ports.metrics }} |
| 43 | + protocol: TCP |
| 44 | + - name: proxy |
| 45 | + containerPort: {{ .Values.proxy.ports.proxy }} |
| 46 | + protocol: TCP |
| 47 | + volumeMounts: |
| 48 | + - name: certs |
| 49 | + mountPath: /certs |
| 50 | + - name: configs |
| 51 | + mountPath: /configs |
| 52 | + volumes: |
| 53 | + - name: certs |
| 54 | + secret: |
| 55 | + secretName: {{ .Values.proxyCertificate.secretName }} |
| 56 | + - name: configs |
| 57 | + configMap: |
| 58 | + name: {{ .Release.Name }}-config |
| 59 | +{{- with .Values.proxy.tolerations }} |
| 60 | + tolerations: {{ toYaml . | nindent 6 }} |
| 61 | +{{- end }} |
| 62 | +{{- with .Values.proxy.affinity }} |
| 63 | + affinity: {{ toYaml . | nindent 8 }} |
| 64 | +{{- end }} |
0 commit comments