blob: 74d152c7d48bdc376afead57b477cb3d36b0f11d [file] [log] [blame]
Durgpal7ad40692018-08-03 07:28:36 +00001# Modifications Copyright © 2018 Amdocs,Bell Canada
Dominic Lunanuovae825fee2018-04-12 14:40:34 +00002#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010015apiVersion: apps/v1
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000016kind: Deployment
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010017metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000018spec:
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010019 selector: {{- include "common.selectors" . | nindent 4 }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000020 replicas: {{ .Values.replicaCount }}
21 template:
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010022 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000023 spec:
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010024{{- if or .Values.global.aafEnabled .Values.PG.enabled }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000025 initContainers:
Krzysztof Opasiak03a125a2020-05-05 02:11:09 +020026 - command:
27 - sh
28 args:
29 - -c
30 - "cd /config-input && for PFILE in `find . -not -type d | grep -v -F ..`; do envsubst <${PFILE} >/config/${PFILE}; done"
31 env:
32 - name: PG_USER
33 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 10 }}
34 - name: PG_PASSWORD
35 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }}
36 volumeMounts:
37 - mountPath: /config-input
38 name: {{ include "common.name" . }}-config-input
39 - mountPath: /config
40 name: {{ include "common.name" . }}-config
41 image: "{{ .Values.global.envsubstImage }}"
42 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
43 name: {{ include "common.name" . }}-update-config
Krzysztof Opasiakc32ee222020-05-07 00:26:00 +020044{{ include "common.certInitializer.initContainer" . | nindent 6 }}
Dominic Lunanuovade7a02b2020-03-12 16:36:09 +000045 - name: {{ include "common.name" . }}-permission-fixer
46 image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}"
47 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Krzysztof Opasiakc32ee222020-05-07 00:26:00 +020048 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }}
Dominic Lunanuovade7a02b2020-03-12 16:36:09 +000049 command: ["chown","-Rf","1000:1001", "/opt/app/"]
50# See AAF-425 for explanation of why this is needed.
51# This artifact is provisioned in AAF for both pks12 and jks format and apparently
52# the cadi library is not using the jks password on the jks keystore.
53# So, this attempts to "fix" the credential property file until this is fixed properly.
54 - name: {{ include "common.name" . }}-cred-fixer
55 image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}"
56 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Krzysztof Opasiakc32ee222020-05-07 00:26:00 +020057 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 8 }}
Dominic Lunanuovade7a02b2020-03-12 16:36:09 +000058 command: ["/bin/sh"]
59 args: [ "-c", "sed -i -e '/cadi_keystore_password=/d' -e '/cadi_keystore_password_jks/p' -e 's/cadi_keystore_password_jks/cadi_keystore_password/' -e 's/dmaap-bc.p12/dmaap-bc.jks/' /opt/app/osaaf/local/org.onap.dmaap-bc.cred.props" ]
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010060 - name: {{ include "common.name" . }}-postgres-readiness
61 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020062 - /app/ready.py
dglFromAttfb58a9d2019-04-12 20:12:26 +000063 args:
64 - --container-name
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000065 - {{ .Values.postgres.nameOverride }}
efiacorc75eacb2020-04-24 14:29:17 +010066 - --container-name
67 - message-router
68 - --container-name
69 - dmaap-dr-node
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000070 env:
71 - name: NAMESPACE
72 valueFrom:
73 fieldRef:
74 apiVersion: v1
75 fieldPath: metadata.namespace
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020076 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000077 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010078{{- end }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000079 containers:
80 - name: {{ include "common.name" . }}
Dominic Lunanuovade7a02b2020-03-12 16:36:09 +000081 image: "{{ .Values.repository }}/{{ .Values.image }}"
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000082 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010083 ports: {{ include "common.containerPorts" . | nindent 10 }}
efiacore62958b2019-09-27 16:54:36 +010084 {{ if eq .Values.liveness.enabled true -}}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000085 livenessProbe:
86 httpGet:
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010087 port: {{ .Values.liveness.port }}
88 path: /webapi/topics
89 scheme: {{ if (include "common.needTLS" .) }}HTTPS{{ else }}HTTP{{ end }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000090 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
dglFromAttec0918d2018-10-17 19:34:49 +000091 periodSeconds: {{ .Values.liveness.periodSeconds }}
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010092 {{ end -}}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000093 readinessProbe:
94 httpGet:
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010095 port: {{ .Values.readiness.port }}
96 path: /webapi/topics
97 scheme: {{ if (include "common.needTLS" .) }}HTTPS{{ else }}HTTP{{ end }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000098 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
99 periodSeconds: {{ .Values.readiness.periodSeconds }}
Krzysztof Opasiakc32ee222020-05-07 00:26:00 +0200100 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000101 - mountPath: /etc/localtime
102 name: localtime
103 readOnly: true
dglFromAttec0918d2018-10-17 19:34:49 +0000104# NOTE: on the following several configMaps, careful to include / at end
105# since there may be more than one file in each mountPath
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000106 - name: {{ include "common.name" . }}-config
dglFromAtt82340072018-10-16 21:53:34 +0000107 mountPath: /opt/app/config/conf/
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +0100108 resources: {{ include "common.resources" . | nindent 12 }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000109 {{- if .Values.nodeSelector }}
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +0100110 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000111 {{- end -}}
112 {{- if .Values.affinity }}
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +0100113 affinity: {{ toYaml .Values.affinity | nindent 10 }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000114 {{- end }}
Krzysztof Opasiakc32ee222020-05-07 00:26:00 +0200115 volumes: {{ include "common.certInitializer.volumes" . | nindent 8 }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000116 - name: localtime
117 hostPath:
118 path: /etc/localtime
Krzysztof Opasiak03a125a2020-05-05 02:11:09 +0200119 - name: {{ include "common.name" . }}-config-input
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000120 configMap:
121 name: {{ include "common.fullname" . }}-config
Krzysztof Opasiak03a125a2020-05-05 02:11:09 +0200122 - name: {{ include "common.name" . }}-config
123 emptyDir:
124 medium: Memory
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000125 imagePullSecrets:
126 - name: "{{ include "common.namespace" . }}-docker-registry-key"