blob: b5c2a8efe399af82150878038ee6196ec49f7a42 [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
Alexander Dehn9b797d62020-04-21 09:53:50 +000019metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
jmac7c434672018-05-11 20:14:17 +000020spec:
21 replicas: {{ .Values.replicaCount }}
Alexander Dehn9b797d62020-04-21 09:53:50 +000022 selector: {{- include "common.selectors" . | nindent 4 }}
jmac7c434672018-05-11 20:14:17 +000023 template:
Alexander Dehn9b797d62020-04-21 09:53:50 +000024 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
jmac7c434672018-05-11 20:14:17 +000025 spec:
26 initContainers:
27 - command:
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +010028 - sh
29 args:
30 - -c
31 - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
32 env:
33 - name: DB_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010034 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +010035 - name: DB_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010036 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +010037 - name: REST_USER
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010038 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "rest-creds" "key" "login") | indent 10 }}
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +010039 - name: REST_PASSWORD
Krzysztof Opasiakab7a6bb2020-03-24 03:30:51 +010040 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "rest-creds" "key" "password") | indent 10 }}
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +010041 volumeMounts:
42 - mountPath: /config-input
43 name: config-input
44 - mountPath: /config
45 name: config
Sylvain Desbureauxcbc703c2020-11-19 17:52:07 +010046 image: {{ include "repositoryGenerator.image.envsubst" . }}
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +010047 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
48 name: {{ include "common.name" . }}-update-config
49
50 - command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020051 - /app/ready.py
jmac7c434672018-05-11 20:14:17 +000052 args:
53 - --container-name
54 - {{ .Values.config.sdncChartName }}
55 env:
56 - name: NAMESPACE
57 valueFrom:
58 fieldRef:
59 apiVersion: v1
60 fieldPath: metadata.namespace
Sylvain Desbureauxcbc703c2020-11-19 17:52:07 +010061 image: {{ include "repositoryGenerator.image.readiness" . }}
jmac7c434672018-05-11 20:14:17 +000062 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
63 name: {{ include "common.name" . }}-readiness
Andreas Geissler47537432024-02-27 08:55:23 +010064 resources:
65 limits:
66 cpu: "100m"
67 memory: "0.5Gi"
68 requests:
69 cpu: "3m"
70 memory: "0.02Gi"
jmac7c434672018-05-11 20:14:17 +000071 containers:
72 - name: {{ include "common.name" . }}
Timoney, Dan (dt5972)3a2802f2019-02-20 13:58:24 -050073 command: ["/bin/bash"]
Dan Timoneyef2826f2021-09-20 11:37:06 -040074 args: ["-c", "cd /opt/ansible-server && ./startAnsibleServer.sh"]
Timoney, Dan (dt5972)3a2802f2019-02-20 13:58:24 -050075
Sylvain Desbureauxcbc703c2020-11-19 17:52:07 +010076 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
jmac7c434672018-05-11 20:14:17 +000077 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Andreas Geissler2af50792023-03-27 17:11:27 +020078 ports: {{ include "common.containerPorts" . | nindent 12 }}
jmac7c434672018-05-11 20:14:17 +000079 # disable liveness probe when breakpoints set in debugger
80 # so K8s doesn't restart unresponsive container
81 {{ if .Values.liveness.enabled }}
82 livenessProbe:
83 tcpSocket:
84 port: {{ .Values.service.internalPort }}
85 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
86 periodSeconds: {{ .Values.liveness.periodSeconds }}
87 {{ end }}
88 readinessProbe:
89 tcpSocket:
90 port: {{ .Values.service.internalPort }}
91 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
92 periodSeconds: {{ .Values.readiness.periodSeconds }}
93 volumeMounts:
94 - mountPath: /etc/localtime
95 name: localtime
96 readOnly: true
97 - mountPath: {{ .Values.config.configDir }}/RestServer_config
98 name: config
99 subPath: RestServer_config
Satoshi Fujii54bfd172021-07-04 16:39:41 +0000100 resources: {{ include "common.resources" . | nindent 12 }}
101 {{- if .Values.nodeSelector }}
102 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 8 }}
103 {{- end }}
104 {{- if .Values.affinity }}
105 affinity: {{ toYaml .Values.affinity | nindent 8 }}
106 {{- end }}
farida azmy32c5ed82021-08-04 14:46:09 +0200107 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
jmac7c434672018-05-11 20:14:17 +0000108 volumes:
109 - name: localtime
110 hostPath:
111 path: /etc/localtime
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +0100112 - name: config-input
jmac7c434672018-05-11 20:14:17 +0000113 configMap:
114 name: {{ include "common.fullname" . }}
115 defaultMode: 0644
Krzysztof Opasiakb9d50c92020-02-20 21:29:45 +0100116 - name: config
117 emptyDir:
118 medium: Memory
jmac7c434672018-05-11 20:14:17 +0000119 imagePullSecrets:
toshrajbhardwaj72b5f0f2018-09-13 02:45:22 +0000120 - name: "{{ include "common.namespace" . }}-docker-registry-key"