blob: 5c94116bacdca2df6114830155652bd4ed25552d [file] [log] [blame]
Jakub Latusek67f4e8d2020-10-21 13:36:29 +02001{{/*
Fiachra Corcoranbe966552018-08-07 16:58:45 +01002# 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.
Jakub Latusek67f4e8d2020-10-21 13:36:29 +020015*/}}
Grzegorz-Lisb1da7722020-07-23 09:32:48 +020016apiVersion: apps/v1
Fiachra Corcoranbe966552018-08-07 16:58:45 +010017kind: Deployment
18metadata:
19 name: {{ include "common.fullname" . }}
20 namespace: {{ include "common.namespace" . }}
21 labels:
22 app: {{ include "common.name" . }}
23 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010024 release: {{ include "common.release" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010025 heritage: {{ .Release.Service }}
26spec:
Grzegorz-Lisb1da7722020-07-23 09:32:48 +020027 selector:
28 matchLabels:
29 app: {{ include "common.name" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010030 replicas: {{ .Values.replicaCount }}
31 template:
32 metadata:
33 labels:
34 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010035 release: {{ include "common.release" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010036 spec:
efiacor7b9a0872019-08-28 21:20:22 +000037 hostname: {{ .Values.global.dmaapDrProvName }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010038 initContainers:
efiacore62958b2019-09-27 16:54:36 +010039 - name: {{ include "common.name" . }}-readiness
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010040 image: {{ include "repositoryGenerator.image.readiness" . }}
efiacore62958b2019-09-27 16:54:36 +010041 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
42 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020043 - /app/ready.py
efiacore62958b2019-09-27 16:54:36 +010044 args:
45 - --container-name
46 - {{ .Values.config.dmaapDrDb.mariadbContName }}
47 env:
48 - name: NAMESPACE
49 valueFrom:
50 fieldRef:
51 apiVersion: v1
52 fieldPath: metadata.namespace
53 {{- if .Values.global.aafEnabled }}
Krzysztof Opasiak2df4a782020-05-08 22:50:24 +020054
55 {{ include "common.certInitializer.initContainer" . | nindent 8 }}
56
efiacore62958b2019-09-27 16:54:36 +010057 - name: {{ include "common.name" . }}-permission-fixer
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010058 image: {{ include "repositoryGenerator.image.busybox" . }}
efiacore62958b2019-09-27 16:54:36 +010059 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Krzysztof Opasiak2df4a782020-05-08 22:50:24 +020060 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
efiacore62958b2019-09-27 16:54:36 +010061 command: ["chown","-Rf","1000:1001", "/opt/app/"]
Krzysztof Opasiak2df4a782020-05-08 22:50:24 +020062
efiacore62958b2019-09-27 16:54:36 +010063 {{ end }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010064 containers:
65 - name: {{ include "common.name" . }}
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010066 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010067 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
68 ports:
efiacor18e43fd2019-10-03 19:57:52 +010069 - containerPort: {{ .Values.config.dmaapDrProv.internalPort }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010070 {{- if eq .Values.liveness.enabled true }}
71 livenessProbe:
72 tcpSocket:
efiacor18e43fd2019-10-03 19:57:52 +010073 port: {{ .Values.config.dmaapDrProv.internalPort }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010074 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
75 periodSeconds: {{ .Values.liveness.periodSeconds }}
76 {{ end -}}
77 readinessProbe:
78 tcpSocket:
efiacor18e43fd2019-10-03 19:57:52 +010079 port: {{ .Values.config.dmaapDrProv.internalPort }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010080 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
81 periodSeconds: {{ .Values.readiness.periodSeconds }}
Krzysztof Opasiake55b4d52020-02-07 22:54:20 +010082 env:
83 - name: DB_USERNAME
Krzysztof Opasiakb2c23832020-03-24 03:27:03 +010084 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-dr-db-user-secret" "key" "login") | indent 12 }}
Krzysztof Opasiake55b4d52020-02-07 22:54:20 +010085 - name: DB_PASSWORD
Krzysztof Opasiakb2c23832020-03-24 03:27:03 +010086 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-dr-db-user-secret" "key" "password") | indent 12 }}
Krzysztof Opasiak2df4a782020-05-08 22:50:24 +020087 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010088 - mountPath: /etc/localtime
89 name: localtime
90 readOnly: false
91 - mountPath: /opt/app/datartr/etc/provserver.properties
efiacoreabb6522019-04-08 09:46:09 +000092 name: {{ include "common.fullname" . }}-config
Fiachra Corcoranbe966552018-08-07 16:58:45 +010093 subPath: provserver.properties
efiacor7b9a0872019-08-28 21:20:22 +000094 - mountPath: /opt/app/datartr/etc/logback.xml
95 name: {{ include "common.fullname" . }}-log-conf
96 subPath: logback.xml
efiacoreabb6522019-04-08 09:46:09 +000097 - mountPath: {{ .Values.global.loggingDirectory }}
98 name: {{ include "common.fullname" . }}-logs
Fiachra Corcoranbe966552018-08-07 16:58:45 +010099 resources:
efiacore62958b2019-09-27 16:54:36 +0100100{{ include "common.resources" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100101 {{- if .Values.nodeSelector }}
102 nodeSelector:
103{{ toYaml .Values.nodeSelector | indent 10 }}
104 {{- end -}}
105 {{- if .Values.affinity }}
106 affinity:
107{{ toYaml .Values.affinity | indent 10 }}
Sylvain Desbureauxe6153432021-02-04 18:26:23 +0100108 {{- end }}
efiacore62958b2019-09-27 16:54:36 +0100109 # Filebeat sidecar container
EmmettCox6065d3e2019-04-12 09:45:30 +0000110 - name: {{ include "common.name" . }}-filebeat-onap
Sylvain Desbureaux6b096542020-11-21 22:51:24 +0100111 image: {{ include "repositoryGenerator.image.logging" . }}
econwar378cf192019-01-08 16:19:59 +0000112 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
113 volumeMounts:
114 - name: {{ include "common.fullname" . }}-filebeat-conf
115 mountPath: /usr/share/filebeat/filebeat.yml
116 subPath: filebeat.yml
117 - name: {{ include "common.fullname" . }}-data-filebeat
118 mountPath: /usr/share/filebeat/data
119 - name: {{ include "common.fullname" . }}-logs
120 mountPath: /var/log/onap/datarouter-prov
Krzysztof Opasiak2df4a782020-05-08 22:50:24 +0200121 volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100122 - name: localtime
123 hostPath:
124 path: /etc/localtime
efiacoreabb6522019-04-08 09:46:09 +0000125 - name: {{ include "common.fullname" . }}-config
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100126 configMap:
efiacoreabb6522019-04-08 09:46:09 +0000127 name: {{ include "common.fullname" . }}-configmap
128 items:
129 - key: provserver.properties
130 path: provserver.properties
econwar378cf192019-01-08 16:19:59 +0000131 - name: {{ include "common.fullname" . }}-log-conf
132 configMap:
133 name: {{ include "common.fullname" . }}-log
134 - name: {{ include "common.fullname" . }}-filebeat-conf
135 configMap:
efiacor7b9a0872019-08-28 21:20:22 +0000136 name: {{ include "common.fullname" . }}-dmaap-dr-prov-filebeat-configmap
econwar378cf192019-01-08 16:19:59 +0000137 - name: {{ include "common.fullname" . }}-data-filebeat
138 emptyDir: {}
139 - name: {{ include "common.fullname" . }}-logs
140 emptyDir: {}
Sylvain Desbureaux435ef532018-12-20 10:58:09 +0100141 imagePullSecrets:
142 - name: "{{ include "common.namespace" . }}-docker-registry-key"