Michael Mokry | afae997 | 2019-03-11 14:46:34 -0500 | [diff] [blame] | 1 | apiVersion: extensions/v1beta1 |
| 2 | kind: Deployment |
| 3 | metadata: |
| 4 | name: {{ include "common.fullname" . }} |
| 5 | namespace: {{ include "common.namespace" . }} |
| 6 | labels: |
| 7 | app: {{ include "common.name" . }} |
| 8 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 9 | release: {{ include "common.release" . }} |
Michael Mokry | afae997 | 2019-03-11 14:46:34 -0500 | [diff] [blame] | 10 | heritage: {{ .Release.Service }} |
| 11 | spec: |
| 12 | replicas: {{ .Values.replicaCount }} |
| 13 | template: |
| 14 | metadata: |
| 15 | labels: |
| 16 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 17 | release: {{ include "common.release" . }} |
Michael Mokry | afae997 | 2019-03-11 14:46:34 -0500 | [diff] [blame] | 18 | spec: |
Michael Mokry | 3b2647a | 2019-04-14 20:24:43 -0500 | [diff] [blame] | 19 | initContainers: |
| 20 | - command: |
| 21 | - /root/ready.py |
| 22 | args: |
| 23 | - --container-name |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 24 | - {{ include "common.release" . }}-galera-config |
Michael Mokry | 3b2647a | 2019-04-14 20:24:43 -0500 | [diff] [blame] | 25 | env: |
| 26 | - name: NAMESPACE |
| 27 | valueFrom: |
| 28 | fieldRef: |
| 29 | apiVersion: v1 |
| 30 | fieldPath: metadata.namespace |
| 31 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 32 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 33 | name: {{ include "common.name" . }}-readiness |
Michael Mokry | afae997 | 2019-03-11 14:46:34 -0500 | [diff] [blame] | 34 | containers: |
| 35 | - name: {{ include "common.name" . }} |
| 36 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 37 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 38 | command: ["/opt/app/policy/pdpx/bin/policy-pdpx.sh"] |
jhh | bf7fb4d | 2019-08-07 16:54:41 -0500 | [diff] [blame] | 39 | args: ["/opt/app/policy/pdpx/etc/mounted/config.json"] |
Krzysztof Opasiak | 7e31efc | 2020-04-01 00:21:45 +0200 | [diff] [blame^] | 40 | env: |
| 41 | - name: SQL_USER |
| 42 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }} |
| 43 | - name: SQL_PASSWORD |
| 44 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }} |
Michael Mokry | afae997 | 2019-03-11 14:46:34 -0500 | [diff] [blame] | 45 | ports: |
| 46 | - containerPort: {{ .Values.service.internalPort }} |
| 47 | # disable liveness probe when breakpoints set in debugger |
| 48 | # so K8s doesn't restart unresponsive container |
| 49 | {{- if eq .Values.liveness.enabled true }} |
| 50 | livenessProbe: |
| 51 | tcpSocket: |
| 52 | port: {{ .Values.service.internalPort }} |
| 53 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 54 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 55 | {{ end -}} |
| 56 | readinessProbe: |
| 57 | tcpSocket: |
| 58 | port: {{ .Values.service.internalPort }} |
| 59 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 60 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 61 | volumeMounts: |
| 62 | - mountPath: /etc/localtime |
| 63 | name: localtime |
| 64 | readOnly: true |
| 65 | - mountPath: /opt/app/policy/pdpx/etc/mounted |
| 66 | name: pdpxconfig |
| 67 | resources: |
| 68 | {{ include "common.resources" . | indent 12 }} |
| 69 | {{- if .Values.nodeSelector }} |
| 70 | nodeSelector: |
| 71 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 72 | {{- end -}} |
| 73 | {{- if .Values.affinity }} |
| 74 | affinity: |
| 75 | {{ toYaml .Values.affinity | indent 10 }} |
| 76 | {{- end }} |
| 77 | volumes: |
| 78 | - name: localtime |
| 79 | hostPath: |
| 80 | path: /etc/localtime |
| 81 | - name: pdpxconfig |
| 82 | configMap: |
| 83 | name: {{ include "common.fullname" . }}-configmap |
| 84 | defaultMode: 0755 |
| 85 | imagePullSecrets: |
| 86 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |