Merge R3 into master
[it/dep.git] / ric-aux / helm / aaf / charts / aaf-fs / templates / deployment.yaml
1 # 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.
14
15 apiVersion: apps/v1
16 kind: Deployment
17 metadata:
18   labels:
19     app: {{ include "common.name" . }}
20     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
21     release: {{ .Release.Name }}
22     heritage: {{ .Release.Service }}
23   name: {{ include "common.fullname" . }}
24   namespace: {{ include "common.namespace" . }}
25 spec:
26   replicas: {{ .Values.global.aaf.fs.replicas }}
27   selector:
28     matchLabels:
29       app: {{ include "common.name" . }}
30       release: {{ .Release.Name }}
31   template:
32     metadata:
33       labels:
34         app: {{ include "common.name" . }}
35         release: {{ .Release.Name }}
36     spec:
37       initContainers:
38       - name: {{ include "common.name" . }}-config-container
39         image: {{ .Values.global.repository }}/{{.Values.global.aaf.config.image}}
40         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
41         command: ["bash","-c","cd /opt/app/aaf_config && bin/pod_wait.sh config aaf-service remove && bin/agent.sh"]
42         volumeMounts:
43           - mountPath: "/opt/app/osaaf"
44             name: aaf-config-vol
45           - mountPath: "/opt/app/aaf/status"
46             name: aaf-status-vol
47         env:
48           - name: aaf_env
49             value: "{{ .Values.global.aaf.aaf_env }}"
50           - name: cadi_latitude
51             value: "{{ .Values.global.aaf.cadi_latitude }}"
52           - name: cadi_longitude
53             value: "{{ .Values.global.aaf.cadi_longitude }}"
54           - name: cadi_x509_issuers
55             value: "{{ .Values.global.aaf.cadi_x509_issuers }}"
56           - name: aaf_locate_url
57             value: "https://aaf-locate.{{ .Release.Namespace}}:{{.Values.global.aaf.locate.internal_port}}"
58           - name: aaf_locator_container
59             value: "oom"
60           - name: aaf_release
61             value: "{{ .Values.global.aaf.aaf_release }}"
62           - name: aaf_locator_container_ns
63             value: "{{ .Release.Namespace }}"
64           - name: aaf_locator_public_fqdn
65             value: "{{.Values.global.aaf.public_fqdn}}"
66           - name: aaf_locator_name
67             value: "{{.Values.global.aaf.aaf_locator_name}}"
68           - name: aaf_locator_name_oom
69             value: "{{.Values.global.aaf.aaf_locator_name_oom}}"
70           - name: cm_always_ignore_ips
71             value: "true"
72           - name: CASSANDRA_CLUSTER
73             value: "{{.Values.global.aaf.cass.fqdn}}.{{ .Release.Namespace }}"
74 #          - name: CASSANDRA_USER
75 #            value: ""
76 #          - name: CASSANDRA_PASSWORD
77 #            value: ""
78 #         - name: CASSANDRA_PORT
79 #            value: ""
80       containers:
81       - name: {{ include "common.name" . }}
82         command: ["/bin/bash","-c","cd /opt/app/aaf && /bin/bash bin/pod_wait.sh aaf-fs aaf-locate && exec bin/fs"]
83         image: {{ .Values.global.repository }}/{{.Values.global.aaf.image}}
84         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
85         volumeMounts:
86         - mountPath: "/opt/app/osaaf"
87           name: aaf-config-vol
88         - mountPath: "/opt/app/aaf/status"
89           name: aaf-status-vol
90         - mountPath: /etc/localtime
91           name: localtime
92           readOnly: true
93         {{- if eq .Values.liveness.enabled true }}
94         livenessProbe:
95           tcpSocket:
96             port: {{ .Values.service.internalPort }}
97           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
98           periodSeconds: {{ .Values.liveness.periodSeconds }}
99         {{ end -}}
100         readinessProbe:
101           tcpSocket:
102             port: {{ .Values.service.internalPort }}
103           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
104           periodSeconds: {{ .Values.readiness.periodSeconds }}
105         resources:
106 {{ include "common.resources" . | indent 12 }}
107       {{- if .Values.nodeSelector }}
108       nodeSelector:
109 {{ toYaml .Values.nodeSelector | indent 10 }}
110       {{- end -}}
111       {{- if .Values.affinity }}
112       affinity:
113 {{ toYaml .Values.affinity | indent 10 }}
114       {{- end }}
115       volumes:
116       - name: localtime
117         hostPath:
118           path: /etc/localtime
119       - name: aaf-status-vol
120         persistentVolumeClaim:
121           claimName: {{ .Release.Name }}-aaf-status-pvc
122       - name: aaf-config-vol
123         persistentVolumeClaim:
124           claimName: {{ .Release.Name }}-aaf-config-pvc
125       imagePullSecrets:
126       - name: "{{ include "common.namespace" . }}-docker-registry-key"