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