blob: 52ac9eb6f33269073b6d90149770fb9c7c3398e4 [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.
14apiVersion: extensions/v1beta1
15kind: 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 "+" "_" }}
22 release: {{ .Release.Name }}
23 heritage: {{ .Release.Service }}
24spec:
25 replicas: {{ .Values.replicaCount }}
26 template:
27 metadata:
28 labels:
29 app: {{ include "common.name" . }}
30 release: {{ .Release.Name }}
31 spec:
efiacor7b9a0872019-08-28 21:20:22 +000032 hostname: {{ .Values.global.dmaapDrProvName }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010033 initContainers:
efiacore62958b2019-09-27 16:54:36 +010034 - name: {{ include "common.name" . }}-readiness
35 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
36 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
37 command:
38 - /root/ready.py
39 args:
40 - --container-name
41 - {{ .Values.config.dmaapDrDb.mariadbContName }}
42 env:
43 - name: NAMESPACE
44 valueFrom:
45 fieldRef:
46 apiVersion: v1
47 fieldPath: metadata.namespace
48 {{- if .Values.global.aafEnabled }}
49 - name: {{ include "common.name" . }}-dr-prov-aaf-config
50 image: "{{ include "common.repository" . }}/{{ .Values.global.aafAgentImage }}"
51 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52 command: ["bash","-c","exec /opt/app/aaf_config/bin/agent.sh"]
53 volumeMounts:
54 - mountPath: {{ .Values.persistence.aafCredsPath }}
55 name: {{ include "common.fullname" . }}-aaf-config-vol
56 env:
57 - name: APP_FQI
58 value: "{{ .Values.aafConfig.fqi }}"
59 - name: aaf_locate_url
60 value: "https://aaf-locate.{{ .Release.Namespace }}:8095"
61 - name: aaf_locator_container
62 value: "{{ .Values.global.aafLocatorContainer }}"
63 - name: aaf_locator_container_ns
64 value: "{{ .Release.Namespace }}"
65 - name: aaf_locator_fqdn
66 value: "{{ .Values.aafConfig.fqdn }}"
67 - name: aaf_locator_public_fqdn
68 value: "{{.Values.aafConfig.publicFqdn}}"
69 - name: aaf_locator_app_ns
70 value: "{{ .Values.global.aafAppNs }}"
71 - name: DEPLOY_FQI
72 value: "{{ .Values.aafConfig.aafDeployFqi }}"
73 - name: DEPLOY_PASSWORD
74 value: "{{ .Values.aafConfig.aafDeployPass }}"
75 - name: cadi_longitude
76 value: "{{ .Values.aafConfig.cadiLongitude }}"
77 - name: cadi_latitude
78 value: "{{ .Values.aafConfig.cadiLatitude }}"
79 - name: {{ include "common.name" . }}-permission-fixer
80 image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}"
81 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
82 volumeMounts:
83 - mountPath: {{ .Values.persistence.aafCredsPath }}
84 name: {{ include "common.fullname" . }}-aaf-config-vol
85 command: ["chown","-Rf","1000:1001", "/opt/app/"]
86 {{ end }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010087 containers:
88 - name: {{ include "common.name" . }}
89 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
90 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
91 ports:
efiacor18e43fd2019-10-03 19:57:52 +010092 - containerPort: {{ .Values.config.dmaapDrProv.internalPort }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010093 {{- if eq .Values.liveness.enabled true }}
94 livenessProbe:
95 tcpSocket:
efiacor18e43fd2019-10-03 19:57:52 +010096 port: {{ .Values.config.dmaapDrProv.internalPort }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010097 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
98 periodSeconds: {{ .Values.liveness.periodSeconds }}
99 {{ end -}}
100 readinessProbe:
101 tcpSocket:
efiacor18e43fd2019-10-03 19:57:52 +0100102 port: {{ .Values.config.dmaapDrProv.internalPort }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100103 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
104 periodSeconds: {{ .Values.readiness.periodSeconds }}
105 volumeMounts:
efiacore62958b2019-09-27 16:54:36 +0100106 {{- if .Values.global.aafEnabled }}
107 - mountPath: {{ .Values.persistence.aafCredsPath }}
108 name: {{ include "common.fullname" . }}-aaf-config-vol
109 {{- end }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100110 - mountPath: /etc/localtime
111 name: localtime
112 readOnly: false
113 - mountPath: /opt/app/datartr/etc/provserver.properties
efiacoreabb6522019-04-08 09:46:09 +0000114 name: {{ include "common.fullname" . }}-config
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100115 subPath: provserver.properties
efiacor7b9a0872019-08-28 21:20:22 +0000116 - mountPath: /opt/app/datartr/etc/logback.xml
117 name: {{ include "common.fullname" . }}-log-conf
118 subPath: logback.xml
efiacoreabb6522019-04-08 09:46:09 +0000119 - mountPath: {{ .Values.global.loggingDirectory }}
120 name: {{ include "common.fullname" . }}-logs
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100121 resources:
efiacore62958b2019-09-27 16:54:36 +0100122{{ include "common.resources" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100123 {{- if .Values.nodeSelector }}
124 nodeSelector:
125{{ toYaml .Values.nodeSelector | indent 10 }}
126 {{- end -}}
127 {{- if .Values.affinity }}
128 affinity:
129{{ toYaml .Values.affinity | indent 10 }}
efiacore62958b2019-09-27 16:54:36 +0100130 {{- end -}}
131 # Filebeat sidecar container
EmmettCox6065d3e2019-04-12 09:45:30 +0000132 - name: {{ include "common.name" . }}-filebeat-onap
econwar378cf192019-01-08 16:19:59 +0000133 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
134 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
135 volumeMounts:
136 - name: {{ include "common.fullname" . }}-filebeat-conf
137 mountPath: /usr/share/filebeat/filebeat.yml
138 subPath: filebeat.yml
139 - name: {{ include "common.fullname" . }}-data-filebeat
140 mountPath: /usr/share/filebeat/data
141 - name: {{ include "common.fullname" . }}-logs
142 mountPath: /var/log/onap/datarouter-prov
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100143 volumes:
144 - name: localtime
145 hostPath:
146 path: /etc/localtime
efiacoreabb6522019-04-08 09:46:09 +0000147 - name: {{ include "common.fullname" . }}-config
Fiachra Corcoranbe966552018-08-07 16:58:45 +0100148 configMap:
efiacoreabb6522019-04-08 09:46:09 +0000149 name: {{ include "common.fullname" . }}-configmap
150 items:
151 - key: provserver.properties
152 path: provserver.properties
econwar378cf192019-01-08 16:19:59 +0000153 - name: {{ include "common.fullname" . }}-log-conf
154 configMap:
155 name: {{ include "common.fullname" . }}-log
156 - name: {{ include "common.fullname" . }}-filebeat-conf
157 configMap:
efiacor7b9a0872019-08-28 21:20:22 +0000158 name: {{ include "common.fullname" . }}-dmaap-dr-prov-filebeat-configmap
econwar378cf192019-01-08 16:19:59 +0000159 - name: {{ include "common.fullname" . }}-data-filebeat
160 emptyDir: {}
161 - name: {{ include "common.fullname" . }}-logs
162 emptyDir: {}
efiacore62958b2019-09-27 16:54:36 +0100163 {{- if .Values.global.aafEnabled }}
164 - name: {{ include "common.fullname" . }}-aaf-config-vol
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100165 {{- if .Values.persistence.enabled }}
efiacore62958b2019-09-27 16:54:36 +0100166 persistentVolumeClaim:
167 claimName: {{ include "common.fullname" . }}-aaf-props
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100168 {{- else }}
169 emptyDir: {}
170 {{- end }}
171 {{- end }}
Sylvain Desbureaux435ef532018-12-20 10:58:09 +0100172 imagePullSecrets:
173 - name: "{{ include "common.namespace" . }}-docker-registry-key"