blob: 76a7348f5f3fc4aed29d052ffbbc101b1e832341 [file] [log] [blame]
Fiachra Corcoranbe966552018-08-07 16:58:45 +01001# Copyright © 2017 Amdocs, Bell Canada
2#
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.
Grzegorz-Lisb1da7722020-07-23 09:32:48 +020014apiVersion: apps/v1
Fiachra Corcoranbe966552018-08-07 16:58:45 +010015kind: Deployment
16metadata:
17 name: {{ include "common.fullname" . }}
18 namespace: {{ include "common.namespace" . }}
19 labels:
20 app: {{ include "common.name" . }}
21 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010022 release: {{ include "common.release" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010023 heritage: {{ .Release.Service }}
24spec:
Grzegorz-Lisb1da7722020-07-23 09:32:48 +020025 selector:
26 matchLabels:
27 app: {{ include "common.name" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010028 replicas: {{ .Values.replicaCount }}
29 template:
30 metadata:
31 labels:
32 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010033 release: {{ include "common.release" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010034 spec:
efiacor7b9a0872019-08-28 21:20:22 +000035 hostname: {{ .Values.global.dmaapDrProvName }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010036 initContainers:
efiacore62958b2019-09-27 16:54:36 +010037 - name: {{ include "common.name" . }}-readiness
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020038 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
efiacore62958b2019-09-27 16:54:36 +010039 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
40 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020041 - /app/ready.py
efiacore62958b2019-09-27 16:54:36 +010042 args:
43 - --container-name
44 - {{ .Values.config.dmaapDrDb.mariadbContName }}
45 env:
46 - name: NAMESPACE
47 valueFrom:
48 fieldRef:
49 apiVersion: v1
50 fieldPath: metadata.namespace
51 {{- if .Values.global.aafEnabled }}
Krzysztof Opasiak2df4a782020-05-08 22:50:24 +020052
53 {{ include "common.certInitializer.initContainer" . | nindent 8 }}
54
efiacore62958b2019-09-27 16:54:36 +010055 - name: {{ include "common.name" . }}-permission-fixer
56 image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}"
57 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Krzysztof Opasiak2df4a782020-05-08 22:50:24 +020058 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
efiacore62958b2019-09-27 16:54:36 +010059 command: ["chown","-Rf","1000:1001", "/opt/app/"]
Krzysztof Opasiak2df4a782020-05-08 22:50:24 +020060
efiacore62958b2019-09-27 16:54:36 +010061 {{ end }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010062 containers:
63 - name: {{ include "common.name" . }}
64 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
65 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
66 ports:
efiacor18e43fd2019-10-03 19:57:52 +010067 - containerPort: {{ .Values.config.dmaapDrProv.internalPort }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010068 {{- if eq .Values.liveness.enabled true }}
69 livenessProbe:
70 tcpSocket:
efiacor18e43fd2019-10-03 19:57:52 +010071 port: {{ .Values.config.dmaapDrProv.internalPort }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010072 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
73 periodSeconds: {{ .Values.liveness.periodSeconds }}
74 {{ end -}}
75 readinessProbe:
76 tcpSocket:
efiacor18e43fd2019-10-03 19:57:52 +010077 port: {{ .Values.config.dmaapDrProv.internalPort }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010078 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
79 periodSeconds: {{ .Values.readiness.periodSeconds }}
Krzysztof Opasiake55b4d52020-02-07 22:54:20 +010080 env:
81 - name: DB_USERNAME
Krzysztof Opasiakb2c23832020-03-24 03:27:03 +010082 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-dr-db-user-secret" "key" "login") | indent 12 }}
Krzysztof Opasiake55b4d52020-02-07 22:54:20 +010083 - name: DB_PASSWORD
Krzysztof Opasiakb2c23832020-03-24 03:27:03 +010084 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "dmaap-dr-db-user-secret" "key" "password") | indent 12 }}
Krzysztof Opasiak2df4a782020-05-08 22:50:24 +020085 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010086 - mountPath: /etc/localtime
87 name: localtime
88 readOnly: false
89 - mountPath: /opt/app/datartr/etc/provserver.properties
efiacoreabb6522019-04-08 09:46:09 +000090 name: {{ include "common.fullname" . }}-config
Fiachra Corcoranbe966552018-08-07 16:58:45 +010091 subPath: provserver.properties
efiacor7b9a0872019-08-28 21:20:22 +000092 - mountPath: /opt/app/datartr/etc/logback.xml
93 name: {{ include "common.fullname" . }}-log-conf
94 subPath: logback.xml
efiacoreabb6522019-04-08 09:46:09 +000095 - mountPath: {{ .Values.global.loggingDirectory }}
96 name: {{ include "common.fullname" . }}-logs
Fiachra Corcoranbe966552018-08-07 16:58:45 +010097 resources:
efiacore62958b2019-09-27 16:54:36 +010098{{ include "common.resources" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010099 {{- if .Values.nodeSelector }}
100 nodeSelector:
101{{ toYaml .Values.nodeSelector | indent 10 }}
102 {{- end -}}
103 {{- if .Values.affinity }}
104 affinity:
105{{ toYaml .Values.affinity | indent 10 }}
efiacore62958b2019-09-27 16:54:36 +0100106 {{- end -}}
107 # Filebeat sidecar container
EmmettCox6065d3e2019-04-12 09:45:30 +0000108 - name: {{ include "common.name" . }}-filebeat-onap
econwar378cf192019-01-08 16:19:59 +0000109 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
110 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
111 volumeMounts:
112 - name: {{ include "common.fullname" . }}-filebeat-conf
113 mountPath: /usr/share/filebeat/filebeat.yml
114 subPath: filebeat.yml
115 - name: {{ include "common.fullname" . }}-data-filebeat
116 mountPath: /usr/share/filebeat/data
117 - name: {{ include "common.fullname" . }}-logs
118 mountPath: /var/log/onap/datarouter-prov
Krzysztof Opasiak2df4a782020-05-08 22:50:24 +0200119 volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100120 - name: localtime
121 hostPath:
122 path: /etc/localtime
efiacoreabb6522019-04-08 09:46:09 +0000123 - name: {{ include "common.fullname" . }}-config
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100124 configMap:
efiacoreabb6522019-04-08 09:46:09 +0000125 name: {{ include "common.fullname" . }}-configmap
126 items:
127 - key: provserver.properties
128 path: provserver.properties
econwar378cf192019-01-08 16:19:59 +0000129 - name: {{ include "common.fullname" . }}-log-conf
130 configMap:
131 name: {{ include "common.fullname" . }}-log
132 - name: {{ include "common.fullname" . }}-filebeat-conf
133 configMap:
efiacor7b9a0872019-08-28 21:20:22 +0000134 name: {{ include "common.fullname" . }}-dmaap-dr-prov-filebeat-configmap
econwar378cf192019-01-08 16:19:59 +0000135 - name: {{ include "common.fullname" . }}-data-filebeat
136 emptyDir: {}
137 - name: {{ include "common.fullname" . }}-logs
138 emptyDir: {}
Sylvain Desbureaux435ef532018-12-20 10:58:09 +0100139 imagePullSecrets:
140 - name: "{{ include "common.namespace" . }}-docker-registry-key"