Jakub Latusek | df233a8 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 2 | #============LICENSE_START======================================================== |
| 3 | # ================================================================================ |
| 4 | # Copyright (c) 2019 AT&T Intellectual Property. All rights reserved. |
| 5 | # ================================================================================ |
| 6 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | # you may not use this file except in compliance with the License. |
| 8 | # You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, software |
| 13 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | # See the License for the specific language governing permissions and |
| 16 | # limitations under the License. |
| 17 | # ============LICENSE_END========================================================= |
Jakub Latusek | df233a8 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 18 | */}} |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 19 | |
Krzysztof Kuzmicki | aef7007 | 2020-07-24 14:47:43 +0200 | [diff] [blame] | 20 | apiVersion: apps/v1 |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 21 | kind: Deployment |
| 22 | metadata: |
| 23 | name: {{ include "common.fullname" . }} |
| 24 | namespace: {{ include "common.namespace" . }} |
| 25 | labels: |
| 26 | app: {{ include "common.name" . }} |
| 27 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 28 | release: {{ include "common.release" . }} |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 29 | heritage: {{ .Release.Service }} |
| 30 | spec: |
| 31 | replicas: 1 |
Krzysztof Kuzmicki | aef7007 | 2020-07-24 14:47:43 +0200 | [diff] [blame] | 32 | selector: |
| 33 | matchLabels: |
| 34 | app: {{ include "common.name" . }} |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 35 | template: |
| 36 | metadata: |
| 37 | labels: |
| 38 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 39 | release: {{ include "common.release" . }} |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 40 | spec: |
| 41 | initContainers: |
| 42 | - name: {{ include "common.name" . }}-readiness |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 43 | image: {{ include "common.repository" . }}/{{ .Values.global.readinessImage }} |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 44 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 45 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 46 | - /app/ready.py |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 47 | args: |
| 48 | - --container-name |
| 49 | - "dcae-inventory-api" |
| 50 | - --container-name |
| 51 | - "message-router" |
| 52 | - --container-name |
ChrisC | 700491f | 2020-09-15 17:49:47 +0200 | [diff] [blame] | 53 | - "sdc-be" |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 54 | - "-t" |
| 55 | - "45" |
| 56 | env: |
| 57 | - name: NAMESPACE |
| 58 | valueFrom: |
| 59 | fieldRef: |
| 60 | apiVersion: v1 |
| 61 | fieldPath: metadata.namespace |
Vijay Venkatesh Kumar | a4535c9 | 2019-08-02 01:45:23 +0000 | [diff] [blame] | 62 | - name: init-tls |
| 63 | env: |
| 64 | - name: POD_IP |
| 65 | valueFrom: |
| 66 | fieldRef: |
| 67 | apiVersion: v1 |
| 68 | fieldPath: status.podIP |
| 69 | image: {{ .Values.global.tlsRepository }}/{{ .Values.global.tlsImage }} |
| 70 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 71 | resources: {} |
| 72 | volumeMounts: |
Jack Lucas | 5bf8808 | 2020-03-30 16:06:13 -0400 | [diff] [blame] | 73 | - mountPath: /opt/app/osaaf |
Vijay Venkatesh Kumar | a4535c9 | 2019-08-02 01:45:23 +0000 | [diff] [blame] | 74 | name: tls-info |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 75 | containers: |
| 76 | - name: {{ include "common.name" . }} |
Jack Lucas | 4c4ba44 | 2019-02-12 17:09:46 -0500 | [diff] [blame] | 77 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 78 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 79 | resources: |
| 80 | {{ include "common.resources" . | indent 12 }} |
| 81 | # disable liveness probe when breakpoints set in debugger |
| 82 | # so K8s doesn't restart unresponsive container |
| 83 | {{- if eq .Values.liveness.enabled true }} |
| 84 | livenessProbe: |
| 85 | exec: |
| 86 | command: [{{ .Values.liveness.script }}] |
| 87 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 88 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 89 | {{ end }} |
| 90 | readinessProbe: |
| 91 | exec: |
| 92 | command: [{{ .Values.readiness.script }}] |
| 93 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 94 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 95 | volumeMounts: |
| 96 | - name: {{ include "common.fullname" . }}-sch-config |
| 97 | mountPath: /opt/config.json |
| 98 | subPath: config.json |
Vijay Venkatesh Kumar | a4535c9 | 2019-08-02 01:45:23 +0000 | [diff] [blame] | 99 | # NOTE: This is tied to the PATH_TO_CACERT env variable |
| 100 | - mountPath: /opt/cert/ |
| 101 | name: tls-info |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 102 | env: |
| 103 | - name: CONSUL_HOST |
| 104 | value: consul.{{ include "common.namespace" . }} |
Vijay Venkatesh Kumar | a4535c9 | 2019-08-02 01:45:23 +0000 | [diff] [blame] | 105 | - name: PATH_TO_CACERT |
| 106 | value: "/opt/cert/cacert.pem" |
| 107 | - name: SCH_ARGS |
| 108 | value: "prod /opt/config.json" |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 109 | volumes: |
| 110 | - name: {{ include "common.fullname" . }}-sch-config |
| 111 | configMap: |
| 112 | name: {{ include "common.fullname" . }}-configmap |
Vijay Venkatesh Kumar | a4535c9 | 2019-08-02 01:45:23 +0000 | [diff] [blame] | 113 | - emptyDir: {} |
| 114 | name: tls-info |
Jack Lucas | 6fae763 | 2019-01-25 11:46:00 -0500 | [diff] [blame] | 115 | imagePullSecrets: |
| 116 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |