blob: 9a061876f83a772375acb0ccc5675fbd4c60a9e8 [file] [log] [blame]
Jack Lucas6fae7632019-01-25 11:46:00 -05001#============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 Kuzmickiaef70072020-07-24 14:47:43 +020018apiVersion: apps/v1
Jack Lucas6fae7632019-01-25 11:46:00 -050019kind: Deployment
20metadata:
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 Opasiak137d7cc2020-01-24 23:49:11 +010026 release: {{ include "common.release" . }}
Jack Lucas6fae7632019-01-25 11:46:00 -050027 heritage: {{ .Release.Service }}
28spec:
29 replicas: 1
Krzysztof Kuzmickiaef70072020-07-24 14:47:43 +020030 selector:
31 matchLabels:
32 app: {{ include "common.name" . }}
Jack Lucas6fae7632019-01-25 11:46:00 -050033 template:
34 metadata:
35 labels:
36 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010037 release: {{ include "common.release" . }}
Jack Lucas6fae7632019-01-25 11:46:00 -050038 spec:
39 initContainers:
40 - name: {{ include "common.name" . }}-readiness
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020041 image: {{ include "common.repository" . }}/{{ .Values.global.readinessImage }}
Jack Lucas6fae7632019-01-25 11:46:00 -050042 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
43 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020044 - /app/ready.py
Jack Lucas6fae7632019-01-25 11:46:00 -050045 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 Kumara4535c92019-08-02 01:45:23 +000060 - 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 Lucas5bf88082020-03-30 16:06:13 -040071 - mountPath: /opt/app/osaaf
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000072 name: tls-info
Jack Lucas6fae7632019-01-25 11:46:00 -050073 containers:
74 - name: {{ include "common.name" . }}
Jack Lucas4c4ba442019-02-12 17:09:46 -050075 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
Jack Lucas6fae7632019-01-25 11:46:00 -050076 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Jack Lucas6fae7632019-01-25 11:46:00 -050077 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 Kumara4535c92019-08-02 01:45:23 +000097 # NOTE: This is tied to the PATH_TO_CACERT env variable
98 - mountPath: /opt/cert/
99 name: tls-info
Jack Lucas6fae7632019-01-25 11:46:00 -0500100 env:
101 - name: CONSUL_HOST
102 value: consul.{{ include "common.namespace" . }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000103 - name: PATH_TO_CACERT
104 value: "/opt/cert/cacert.pem"
105 - name: SCH_ARGS
106 value: "prod /opt/config.json"
Jack Lucas6fae7632019-01-25 11:46:00 -0500107 volumes:
108 - name: {{ include "common.fullname" . }}-sch-config
109 configMap:
110 name: {{ include "common.fullname" . }}-configmap
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000111 - emptyDir: {}
112 name: tls-info
Jack Lucas6fae7632019-01-25 11:46:00 -0500113 imagePullSecrets:
114 - name: "{{ include "common.namespace" . }}-docker-registry-key"