blob: ea2720f9ce0e54a39f3eecbe62d130b6206b8044 [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:
efiacore62958b2019-09-27 16:54:36 +010026{{- if .Values.global.aafEnabled }}
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010027 - name: {{ include "common.name" . }}-aaf-readiness
28 command:
Dominic Lunanuovae825fee2018-04-12 14:40:34 +000029 - /root/ready.py
30 args:
31 - --container-name
dglFromAttfb58a9d2019-04-12 20:12:26 +000032 - aaf-locate
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010033 - --container-name
34 - aaf-cm
35 - --container-name
36 - aaf-service
dglFromAttfb58a9d2019-04-12 20:12:26 +000037 env:
38 - name: NAMESPACE
39 valueFrom:
40 fieldRef:
41 apiVersion: v1
42 fieldPath: metadata.namespace
43 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
44 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +010045 - name: {{ include "common.name" . }}-aaf-config
Ubuntu3d5d1802019-11-14 23:16:17 +000046 image: "{{ include "common.repository" . }}/{{ .Values.global.aafAgentImage }}"
47 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
48 command: ["bash","-c","exec /opt/app/aaf_config/bin/agent.sh"]
49 volumeMounts:
50 - mountPath: {{ .Values.persistence.aafCredsPath }}
Dominic Lunanuovade7a02b2020-03-12 16:36:09 +000051 name: {{ include "common.name" . }}-aaf-config-vol
Ubuntu3d5d1802019-11-14 23:16:17 +000052 env:
53 - name: APP_FQI
54 value: "{{ .Values.aafConfig.fqi }}"
55 - name: aaf_locate_url
56 value: "https://aaf-locate.{{ .Release.Namespace }}:8095"
57 - name: aaf_locator_container
58 value: "{{ .Values.global.aafLocatorContainer }}"
59 - name: aaf_locator_container_ns
60 value: "{{ .Release.Namespace }}"
61 - name: aaf_locator_fqdn
62 value: "{{ .Values.aafConfig.fqdn }}"
63 - name: aaf_locator_public_fqdn
64 value: "{{.Values.aafConfig.publicFqdn}}"
65 - name: aaf_locator_app_ns
66 value: "{{ .Values.global.aafAppNs }}"
67 - name: DEPLOY_FQI
68 value: "{{ .Values.aafConfig.aafDeployFqi }}"
69 - name: DEPLOY_PASSWORD
70 valueFrom:
71 secretKeyRef:
72 name: {{ include "common.fullname" . }}-secret
73 key: aaf-deploy-password
74 - name: cadi_longitude
75 value: "{{ .Values.aafConfig.cadiLongitude }}"
76 - name: cadi_latitude
77 value: "{{ .Values.aafConfig.cadiLatitude }}"
Dominic Lunanuovade7a02b2020-03-12 16:36:09 +000078 - name: {{ include "common.name" . }}-permission-fixer
79 image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}"
80 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
81 volumeMounts:
82 - mountPath: {{ .Values.persistence.aafCredsPath }}
83 name: {{ include "common.name" . }}-aaf-config-vol
84 command: ["chown","-Rf","1000:1001", "/opt/app/"]
85# See AAF-425 for explanation of why this is needed.
86# This artifact is provisioned in AAF for both pks12 and jks format and apparently
87# the cadi library is not using the jks password on the jks keystore.
88# So, this attempts to "fix" the credential property file until this is fixed properly.
89 - name: {{ include "common.name" . }}-cred-fixer
90 image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}"
91 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
92 volumeMounts:
93 - mountPath: {{ .Values.persistence.aafCredsPath }}
94 name: {{ include "common.name" . }}-aaf-config-vol
95 command: ["/bin/sh"]
96 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" ]
97
efiacore62958b2019-09-27 16:54:36 +010098{{- end }}
99{{- if .Values.PG.enabled }}
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +0100100 - name: {{ include "common.name" . }}-postgres-readiness
101 command:
dglFromAttfb58a9d2019-04-12 20:12:26 +0000102 - /root/ready.py
103 args:
104 - --container-name
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000105 - {{ .Values.postgres.nameOverride }}
106 env:
107 - name: NAMESPACE
108 valueFrom:
109 fieldRef:
110 apiVersion: v1
111 fieldPath: metadata.namespace
112 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
113 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +0100114{{- end }}
115{{- end }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000116 containers:
117 - name: {{ include "common.name" . }}
Dominic Lunanuovade7a02b2020-03-12 16:36:09 +0000118 image: "{{ .Values.repository }}/{{ .Values.image }}"
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000119 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +0100120 ports: {{ include "common.containerPorts" . | nindent 10 }}
efiacore62958b2019-09-27 16:54:36 +0100121 {{ if eq .Values.liveness.enabled true -}}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000122 livenessProbe:
123 httpGet:
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +0100124 port: {{ .Values.liveness.port }}
125 path: /webapi/topics
126 scheme: {{ if (include "common.needTLS" .) }}HTTPS{{ else }}HTTP{{ end }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000127 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
dglFromAttec0918d2018-10-17 19:34:49 +0000128 periodSeconds: {{ .Values.liveness.periodSeconds }}
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +0100129 {{ end -}}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000130 readinessProbe:
131 httpGet:
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +0100132 port: {{ .Values.readiness.port }}
133 path: /webapi/topics
134 scheme: {{ if (include "common.needTLS" .) }}HTTPS{{ else }}HTTP{{ end }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000135 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
136 periodSeconds: {{ .Values.readiness.periodSeconds }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000137 volumeMounts:
138 - mountPath: /etc/localtime
139 name: localtime
140 readOnly: true
Dominic Lunanuovade7a02b2020-03-12 16:36:09 +0000141 - mountPath: {{ .Values.persistence.aafCredsPath }}
142 name: {{ include "common.name" . }}-aaf-config-vol
dglFromAttec0918d2018-10-17 19:34:49 +0000143# NOTE: on the following several configMaps, careful to include / at end
144# since there may be more than one file in each mountPath
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000145 - name: {{ include "common.name" . }}-config
dglFromAtt82340072018-10-16 21:53:34 +0000146 mountPath: /opt/app/config/conf/
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +0100147 resources: {{ include "common.resources" . | nindent 12 }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000148 {{- if .Values.nodeSelector }}
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +0100149 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000150 {{- end -}}
151 {{- if .Values.affinity }}
Sylvain Desbureaux0de113e2020-03-10 09:57:25 +0100152 affinity: {{ toYaml .Values.affinity | nindent 10 }}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000153 {{- end }}
154 volumes:
155 - name: localtime
156 hostPath:
157 path: /etc/localtime
158 - name: {{ include "common.name" . }}-config
159 configMap:
160 name: {{ include "common.fullname" . }}-config
Dominic Lunanuovade7a02b2020-03-12 16:36:09 +0000161 - name: {{ include "common.name" . }}-aaf-config-vol
162 emptyDir: {}
Dominic Lunanuovae825fee2018-04-12 14:40:34 +0000163 imagePullSecrets:
164 - name: "{{ include "common.namespace" . }}-docker-registry-key"