2 # Copyright (C) 2021 Pantheon.tech, Orange
3 # Modifications Copyright (C) 2021 Bell Canada.
4 # Modifications Copyright (C) 2021-2022 Nordix Foundation.
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
10 # http://www.apache.org/licenses/LICENSE-2.0
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.
21 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
23 replicas: {{ .Values.replicaCount }}
24 minReadySeconds: {{ index .Values.minReadySeconds }}
26 type: {{ index .Values.updateStrategy.type }}
28 maxUnavailable: {{ index .Values.updateStrategy.maxUnavailable }}
29 maxSurge: {{ index .Values.updateStrategy.maxSurge }}
30 selector: {{- include "common.selectors" . | nindent 4 }}
32 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
34 {{ include "common.podSecurityContext" . | indent 6 | trim}}
35 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . ) }}
36 initContainers: {{ include "common.readinessCheck.waitFor" . | nindent 6 }}
37 - name: {{ include "common.name" . }}-update-config
38 image: {{ include "repositoryGenerator.image.envsubst" . }}
39 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
44 - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config/${PFILE}; done"
47 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 12 }}
49 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 12 }}
50 - name: LIQUIBASE_LABELS
51 value: {{ .Values.config.liquibaseLabels }}
53 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "app-user-creds" "key" "login") | indent 12 }}
55 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "app-user-creds" "key" "password") | indent 12 }}
57 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmi-plugin-user-creds" "key" "login") | indent 12 }}
59 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmi-plugin-user-creds" "key" "password") | indent 12 }}
60 {{- if .Values.config.useStrimziKafka }}
62 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cps-kafka-user" "key" "sasl.jaas.config") | indent 12 }}
65 - mountPath: /config-input
70 - name: {{ include "common.name" . }}
71 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
72 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
73 ports: {{ include "common.containerPorts" . | nindent 10 }}
74 {{ include "common.containerSecurityContext" . | indent 8 | trim }}
75 # disable liveness probe when breakpoints set in debugger
76 # so K8s doesn't restart unresponsive container
77 {{- if eq .Values.liveness.enabled true }}
80 port: {{ .Values.liveness.port }}
81 path: {{ .Values.liveness.path }}
82 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
83 periodSeconds: {{ .Values.liveness.periodSeconds }}
87 port: {{ .Values.readiness.port }}
88 path: {{ .Values.readiness.path }}
89 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
90 periodSeconds: {{ .Values.readiness.periodSeconds }}
93 path: {{ .Values.startup.path }}
94 port: {{ .Values.startup.port }}
95 failureThreshold: {{ .Values.startup.failureThreshold }}
96 periodSeconds: {{ .Values.startup.periodSeconds }}
98 - name: SPRING_PROFILES_ACTIVE
99 value: {{ .Values.config.spring.profile }}
101 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 12 }}
103 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 12 }}
104 - name: LIQUIBASE_LABELS
105 value: {{ .Values.config.liquibaseLabels }}
107 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "app-user-creds" "key" "login") | indent 12 }}
109 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "app-user-creds" "key" "password") | indent 12 }}
111 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmi-plugin-user-creds" "key" "login") | indent 12 }}
113 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmi-plugin-user-creds" "key" "password") | indent 12 }}
114 {{- if .Values.config.useStrimziKafka }}
116 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cps-kafka-user" "key" "sasl.jaas.config") | indent 12 }}
118 resources: {{ include "common.resources" . | nindent 10 }}
119 {{- if .Values.nodeSelector }}
120 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 12 }}
122 {{- if .Values.affinity }}
123 affinity: {{ toYaml .Values.affinity | nindent 12 }}
126 - mountPath: /app/resources/application-helm.yml
127 subPath: application-helm.yml
129 - mountPath: /app/resources/logback.xml
135 - name: init-data-input
137 name: {{ include "common.fullname" . }}
144 - name: "{{ include "common.namespace" . }}-docker-registry-key"