blob: 16a12b34db4c0a552e7b4d54f2f327307742a1a9 [file] [log] [blame]
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +01001{{/*
jmac7c434672018-05-11 20:14:17 +00002# Copyright © 2017 Amdocs, Bell Canada
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010015*/}}
jmac7c434672018-05-11 20:14:17 +000016
Grzegorz-Lis1318a772020-07-23 15:08:43 +020017apiVersion: apps/v1
jmac7c434672018-05-11 20:14:17 +000018kind: Deployment
19metadata:
20 name: {{ include "common.fullname" . }}
21 namespace: {{ include "common.namespace" . }}
22 labels:
23 app: {{ include "common.name" . }}
24 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010025 release: {{ include "common.release" . }}
jmac7c434672018-05-11 20:14:17 +000026 heritage: {{ .Release.Service }}
27spec:
Grzegorz-Lis1318a772020-07-23 15:08:43 +020028 selector:
29 matchLabels:
30 app: {{ include "common.name" . }}
jmac7c434672018-05-11 20:14:17 +000031 replicas: {{ .Values.replicaCount }}
32 template:
33 metadata:
34 labels:
35 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010036 release: {{ include "common.release" . }}
jmac7c434672018-05-11 20:14:17 +000037 spec:
38 initContainers:
39 - command:
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +010040 - sh
41 args:
42 - -c
43 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
44 env:
45 - name: DB_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010046 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +010047 - name: DB_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010048 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +010049 - name: REST_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010050 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "rest-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +010051 - name: REST_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010052 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "rest-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +010053 volumeMounts:
54 - mountPath: /config-input
55 name: config-input
56 - mountPath: /config
57 name: config
58 image: "{{ .Values.global.envsubstImage }}"
59 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
60 name: {{ include "common.name" . }}-update-config
61
62 - command:
jmac7c434672018-05-11 20:14:17 +000063 - /root/ready.py
64 args:
65 - --container-name
66 - {{ .Values.config.sdncChartName }}
67 env:
68 - name: NAMESPACE
69 valueFrom:
70 fieldRef:
71 apiVersion: v1
72 fieldPath: metadata.namespace
73 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
74 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
75 name: {{ include "common.name" . }}-readiness
76 containers:
77 - name: {{ include "common.name" . }}
Timoney, Dan (dt5972)3a2802f2019-02-20 13:58:24 -050078 command: ["/bin/bash"]
79 args: ["-c", "cd /opt/onap/ccsdk && ./startAnsibleServer.sh"]
80
jmac7c434672018-05-11 20:14:17 +000081 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
82 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
83 ports:
84 - containerPort: {{ .Values.service.internalPort }}
85 # disable liveness probe when breakpoints set in debugger
86 # so K8s doesn't restart unresponsive container
87 {{ if .Values.liveness.enabled }}
88 livenessProbe:
89 tcpSocket:
90 port: {{ .Values.service.internalPort }}
91 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
92 periodSeconds: {{ .Values.liveness.periodSeconds }}
93 {{ end }}
94 readinessProbe:
95 tcpSocket:
96 port: {{ .Values.service.internalPort }}
97 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
98 periodSeconds: {{ .Values.readiness.periodSeconds }}
99 volumeMounts:
100 - mountPath: /etc/localtime
101 name: localtime
102 readOnly: true
103 - mountPath: {{ .Values.config.configDir }}/RestServer_config
104 name: config
105 subPath: RestServer_config
106 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000107{{ include "common.resources" . | indent 12 }}
jmac7c434672018-05-11 20:14:17 +0000108 {{- if .Values.nodeSelector }}
109 nodeSelector:
110{{ toYaml .Values.nodeSelector | indent 10 }}
111 {{- end -}}
112 {{- if .Values.affinity }}
113 affinity:
114{{ toYaml .Values.affinity | indent 10 }}
115 {{- end }}
116 volumes:
117 - name: localtime
118 hostPath:
119 path: /etc/localtime
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +0100120 - name: config-input
jmac7c434672018-05-11 20:14:17 +0000121 configMap:
122 name: {{ include "common.fullname" . }}
123 defaultMode: 0644
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +0100124 - name: config
125 emptyDir:
126 medium: Memory
jmac7c434672018-05-11 20:14:17 +0000127 imagePullSecrets:
toshrajbhardwaj72b5f0f2018-09-13 02:45:22 +0000128 - name: "{{ include "common.namespace" . }}-docker-registry-key"