ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [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" . }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [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" . }} |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 18 | spec: |
ramverma | 6acdabf | 2019-04-12 18:56:03 +0000 | [diff] [blame] | 19 | initContainers: |
| 20 | - command: |
| 21 | - /root/ready.py |
| 22 | args: |
| 23 | - --container-name |
Sylvain Desbureaux | 4898dc0 | 2019-11-14 13:35:13 +0100 | [diff] [blame] | 24 | - {{ .Values.global.mariadb.service.name }} |
ramverma | 6acdabf | 2019-04-12 18:56:03 +0000 | [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 |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [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/pap/bin/policy-pap.sh"] |
jhh | bf7fb4d | 2019-08-07 16:54:41 -0500 | [diff] [blame] | 39 | args: ["/opt/app/policy/pap/etc/mounted/config.json"] |
ramverma | 1a3b8ad | 2019-02-25 12:45:11 +0000 | [diff] [blame] | 40 | ports: |
| 41 | - containerPort: {{ .Values.service.internalPort }} |
| 42 | # disable liveness probe when breakpoints set in debugger |
| 43 | # so K8s doesn't restart unresponsive container |
| 44 | {{- if eq .Values.liveness.enabled true }} |
| 45 | livenessProbe: |
| 46 | tcpSocket: |
| 47 | port: {{ .Values.service.internalPort }} |
| 48 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 49 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 50 | {{ end -}} |
| 51 | readinessProbe: |
| 52 | tcpSocket: |
| 53 | port: {{ .Values.service.internalPort }} |
| 54 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 55 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 56 | volumeMounts: |
| 57 | - mountPath: /etc/localtime |
| 58 | name: localtime |
| 59 | readOnly: true |
| 60 | - mountPath: /opt/app/policy/pap/etc/mounted |
| 61 | name: papconfig |
| 62 | resources: |
| 63 | {{ include "common.resources" . | indent 12 }} |
| 64 | {{- if .Values.nodeSelector }} |
| 65 | nodeSelector: |
| 66 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 67 | {{- end -}} |
| 68 | {{- if .Values.affinity }} |
| 69 | affinity: |
| 70 | {{ toYaml .Values.affinity | indent 10 }} |
| 71 | {{- end }} |
| 72 | volumes: |
| 73 | - name: localtime |
| 74 | hostPath: |
| 75 | path: /etc/localtime |
| 76 | - name: papconfig |
| 77 | configMap: |
| 78 | name: {{ include "common.fullname" . }}-configmap |
| 79 | defaultMode: 0755 |
| 80 | imagePullSecrets: |
| 81 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |