|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: Deployment |
| 3 | +metadata: |
| 4 | + name: {{ include "cpnConsole.fullname" . }}-strangler |
| 5 | + labels: |
| 6 | + {{- include "cpnConsole.strangler.labels" . | nindent 4 }} |
| 7 | +spec: |
| 8 | + {{- if not .Values.strangler.autoscaling.enabled }} |
| 9 | + replicas: {{ .Values.strangler.replicaCount }} |
| 10 | + {{- end }} |
| 11 | + selector: |
| 12 | + matchLabels: |
| 13 | + {{- include "cpnConsole.strangler.selectorLabels" . | nindent 6 }} |
| 14 | + strategy: |
| 15 | + type: {{ .Values.strangler.strategy.type }} |
| 16 | + template: |
| 17 | + metadata: |
| 18 | + annotations: |
| 19 | + {{- include "checksum" (list $ "/strangler/configmap.yaml") | nindent 8 }} |
| 20 | + {{- include "checksum" (list $ "/strangler/secret.yaml") | nindent 8 }} |
| 21 | + {{- with .Values.strangler.podAnnotations }} |
| 22 | + {{- toYaml . | nindent 8 }} |
| 23 | + {{- end }} |
| 24 | + labels: |
| 25 | + {{- include "cpnConsole.strangler.selectorLabels" . | nindent 8 }} |
| 26 | + {{- with .Values.strangler.podLabels }} |
| 27 | + {{- toYaml . | nindent 8 }} |
| 28 | + {{- end }} |
| 29 | + spec: |
| 30 | + {{- if and .Values.imageCredentials.username .Values.imageCredentials.password }} |
| 31 | + imagePullSecrets: |
| 32 | + - name: {{ include "cpnConsole.name" . }}-pullsecret |
| 33 | + {{- end }} |
| 34 | + securityContext: |
| 35 | + {{- toYaml .Values.strangler.podSecurityContext | nindent 8 }} |
| 36 | + {{- if .Values.strangler.initContainers }} |
| 37 | + initContainers: |
| 38 | + {{- tpl (toYaml .Values.strangler.initContainers) . | nindent 8 }} |
| 39 | + {{- end }} |
| 40 | + containers: |
| 41 | + - name: strangler |
| 42 | + securityContext: |
| 43 | + {{- toYaml .Values.strangler.container.securityContext | nindent 12 }} |
| 44 | + image: "{{ .Values.strangler.image.repository }}:{{ .Values.strangler.image.tag | default .Chart.AppVersion }}" |
| 45 | + imagePullPolicy: {{ .Values.strangler.image.pullPolicy }} |
| 46 | + {{- if .Values.strangler.container.command }} |
| 47 | + command: |
| 48 | + {{- range .Values.strangler.container.command }} |
| 49 | + - {{ . | quote }} |
| 50 | + {{- end }} |
| 51 | + {{- end }} |
| 52 | + {{- if .Values.strangler.container.args }} |
| 53 | + args: |
| 54 | + {{- range .Values.strangler.container.args }} |
| 55 | + - {{ . | quote }} |
| 56 | + {{- end }} |
| 57 | + {{- end }} |
| 58 | + ports: |
| 59 | + - containerPort: {{ .Values.strangler.container.port }} |
| 60 | + protocol: TCP |
| 61 | + envFrom: |
| 62 | + - configMapRef: |
| 63 | + name: {{ include "cpnConsole.fullname" . }}-strangler |
| 64 | + {{- if or .Values.global.secrets .Values.strangler.secrets }} |
| 65 | + - secretRef: |
| 66 | + name: {{ include "cpnConsole.fullname" . }}-strangler |
| 67 | + {{- end }} |
| 68 | + {{- if .Values.strangler.envFrom }} |
| 69 | + {{- toYaml .Values.strangler.envFrom | nindent 8 }} |
| 70 | + {{- end }} |
| 71 | + {{- if .Values.strangler.startupProbe.enabled }} |
| 72 | + startupProbe: |
| 73 | + httpGet: |
| 74 | + path: {{ .Values.strangler.healthcheckPath }} |
| 75 | + port: {{ .Values.strangler.container.port }} |
| 76 | + initialDelaySeconds: {{ .Values.strangler.startupProbe.initialDelaySeconds }} |
| 77 | + successThreshold: {{ .Values.strangler.startupProbe.successThreshold }} |
| 78 | + failureThreshold: {{ .Values.strangler.startupProbe.failureThreshold }} |
| 79 | + periodSeconds: {{ .Values.strangler.startupProbe.periodSeconds }} |
| 80 | + timeoutSeconds: {{ .Values.strangler.startupProbe.timeoutSeconds }} |
| 81 | + {{- end }} |
| 82 | + {{- if .Values.strangler.readinessProbe.enabled }} |
| 83 | + readinessProbe: |
| 84 | + httpGet: |
| 85 | + path: {{ .Values.strangler.healthcheckPath }} |
| 86 | + port: {{ .Values.strangler.container.port }} |
| 87 | + initialDelaySeconds: {{ .Values.strangler.readinessProbe.initialDelaySeconds }} |
| 88 | + successThreshold: {{ .Values.strangler.readinessProbe.successThreshold }} |
| 89 | + failureThreshold: {{ .Values.strangler.readinessProbe.failureThreshold }} |
| 90 | + periodSeconds: {{ .Values.strangler.readinessProbe.periodSeconds }} |
| 91 | + timeoutSeconds: {{ .Values.strangler.readinessProbe.timeoutSeconds }} |
| 92 | + {{- end }} |
| 93 | + {{- if .Values.strangler.livenessProbe.enabled }} |
| 94 | + livenessProbe: |
| 95 | + httpGet: |
| 96 | + path: {{ .Values.strangler.healthcheckPath }} |
| 97 | + port: {{ .Values.strangler.container.port }} |
| 98 | + initialDelaySeconds: {{ .Values.strangler.livenessProbe.initialDelaySeconds }} |
| 99 | + successThreshold: {{ .Values.strangler.livenessProbe.successThreshold }} |
| 100 | + failureThreshold: {{ .Values.strangler.livenessProbe.failureThreshold }} |
| 101 | + periodSeconds: {{ .Values.strangler.livenessProbe.periodSeconds }} |
| 102 | + timeoutSeconds: {{ .Values.strangler.livenessProbe.timeoutSeconds }} |
| 103 | + {{- end }} |
| 104 | + {{- if .Values.strangler.hostAliases }} |
| 105 | + hostAliases: |
| 106 | + {{- toYaml .Values.strangler.hostAliases | nindent 8 }} |
| 107 | + {{- end }} |
| 108 | + resources: |
| 109 | + {{- toYaml .Values.strangler.resources | nindent 10 }} |
| 110 | + volumeMounts: |
| 111 | + {{- range $volumeMount := .Values.strangler.extraVolumeMounts }} |
| 112 | + - name: {{ $volumeMount.name }} |
| 113 | + mountPath: {{ $volumeMount.mountPath }} |
| 114 | + {{- end }} |
| 115 | + {{- if .Values.strangler.extraContainers }} |
| 116 | + {{- tpl (toYaml .Values.strangler.extraContainers) . | nindent 8 }} |
| 117 | + {{- end }} |
| 118 | + {{- with .Values.strangler.nodeSelector }} |
| 119 | + nodeSelector: |
| 120 | + {{- toYaml . | nindent 8 }} |
| 121 | + {{- end }} |
| 122 | + {{- with .Values.strangler.affinity }} |
| 123 | + affinity: |
| 124 | + {{- toYaml . | nindent 8 }} |
| 125 | + {{- end }} |
| 126 | + {{- with .Values.strangler.tolerations }} |
| 127 | + tolerations: |
| 128 | + {{- toYaml . | nindent 8 }} |
| 129 | + {{- end }} |
| 130 | + volumes: |
| 131 | + {{- range $volume := .Values.strangler.extraVolumes }} |
| 132 | + - name: {{ $volume.name }} |
| 133 | + {{- if eq $volume.type "hostPath" }} |
| 134 | + hostPath: |
| 135 | + path: {{ $volume.path }} |
| 136 | + {{- end }} |
| 137 | + {{- if eq $volume.type "configMap" }} |
| 138 | + configMap: |
| 139 | + name: {{ $volume.name }} |
| 140 | + {{- end }} |
| 141 | + {{- end }} |
0 commit comments