blob: 7c55628f25d3197a63960fb3b5b8eba6b86e0748 [file] [log] [blame]
Jakub Latusekdf233a82020-10-21 13:36:29 +02001{{/*
Jack Lucas6fae7632019-01-25 11:46:00 -05002#============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 Latusekdf233a82020-10-21 13:36:29 +020018*/}}
Jack Lucas6fae7632019-01-25 11:46:00 -050019
Krzysztof Kuzmickiaef70072020-07-24 14:47:43 +020020apiVersion: apps/v1
Jack Lucas6fae7632019-01-25 11:46:00 -050021kind: Deployment
22metadata:
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 Opasiak137d7cc2020-01-24 23:49:11 +010028 release: {{ include "common.release" . }}
Jack Lucas6fae7632019-01-25 11:46:00 -050029 heritage: {{ .Release.Service }}
30spec:
31 replicas: 1
Krzysztof Kuzmickiaef70072020-07-24 14:47:43 +020032 selector:
33 matchLabels:
34 app: {{ include "common.name" . }}
Jack Lucas6fae7632019-01-25 11:46:00 -050035 template:
36 metadata:
37 labels:
38 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010039 release: {{ include "common.release" . }}
Jack Lucas6fae7632019-01-25 11:46:00 -050040 spec:
41 initContainers:
42 - name: {{ include "common.name" . }}-readiness
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +010043 image: {{ include "repositoryGenerator.image.readiness" . }}
Jack Lucas6fae7632019-01-25 11:46:00 -050044 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
45 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020046 - /app/ready.py
Jack Lucas6fae7632019-01-25 11:46:00 -050047 args:
48 - --container-name
49 - "dcae-inventory-api"
50 - --container-name
51 - "message-router"
52 - --container-name
ChrisC700491f2020-09-15 17:49:47 +020053 - "sdc-be"
Jack Lucas6fae7632019-01-25 11:46:00 -050054 - "-t"
55 - "45"
56 env:
57 - name: NAMESPACE
58 valueFrom:
59 fieldRef:
60 apiVersion: v1
61 fieldPath: metadata.namespace
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000062 - name: init-tls
63 env:
64 - name: POD_IP
65 valueFrom:
66 fieldRef:
67 apiVersion: v1
68 fieldPath: status.podIP
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +010069 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.tlsImage }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000070 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
71 resources: {}
72 volumeMounts:
Jack Lucas5bf88082020-03-30 16:06:13 -040073 - mountPath: /opt/app/osaaf
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000074 name: tls-info
Jack Lucas6fae7632019-01-25 11:46:00 -050075 containers:
76 - name: {{ include "common.name" . }}
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +010077 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Jack Lucas6fae7632019-01-25 11:46:00 -050078 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Jack Lucas6fae7632019-01-25 11:46:00 -050079 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 Kumara4535c92019-08-02 01:45:23 +000099 # NOTE: This is tied to the PATH_TO_CACERT env variable
100 - mountPath: /opt/cert/
101 name: tls-info
Jack Lucas6fae7632019-01-25 11:46:00 -0500102 env:
103 - name: CONSUL_HOST
104 value: consul.{{ include "common.namespace" . }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000105 - name: PATH_TO_CACERT
106 value: "/opt/cert/cacert.pem"
107 - name: SCH_ARGS
108 value: "prod /opt/config.json"
Jack Lucas6fae7632019-01-25 11:46:00 -0500109 volumes:
110 - name: {{ include "common.fullname" . }}-sch-config
111 configMap:
112 name: {{ include "common.fullname" . }}-configmap
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000113 - emptyDir: {}
114 name: tls-info
Jack Lucas6fae7632019-01-25 11:46:00 -0500115 imagePullSecrets:
116 - name: "{{ include "common.namespace" . }}-docker-registry-key"