Merge "Add FCAPS to oom"
[oom.git] / kubernetes / aaf / charts / aaf-hello / 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: extensions/v1beta1
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.hello.replicas }}
27   template:
28     metadata:
29       labels:
30         app: {{ include "common.name" . }}
31         release: {{ .Release.Name }}
32     spec:
33       initContainers:
34       - name: {{ include "common.name" . }}-config-container
35         image: {{ .Values.global.repository }}/onap/aaf/aaf_agent:{{.Values.global.aaf.imageVersion}}
36         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
37         volumeMounts:
38         - mountPath: "/opt/app/osaaf/local"
39           name: aaf-hello-vol
40         command: ["bash","-c","/opt/app/aaf_config/bin/pod_wait.sh config nc aaf-cm.{{.Release.Namespace}} 8150 remove && cd /opt/app/osaaf/local && /opt/app/aaf_config/bin/agent.sh"]
41         env:
42           - name: aaf_env
43             value: "{{ .Values.global.aaf.aaf_env }}"
44           - name: cadi_latitude
45             value: "{{ .Values.global.aaf.cadi_latitude }}"
46           - name: cadi_longitude
47             value: "{{ .Values.global.aaf.cadi_longitude }}"
48           - name: aaf_locate_url
49             value: "https://aaf-locate.{{ .Release.Namespace}}:{{.Values.global.aaf.locate.internal_port}}"
50           - name: aaf_locator_container
51             value: "oom"
52           - name: aaf_release
53             value: "{{ .Values.global.aaf.aaf_release }}"
54           - name: aaf_locator_container_ns
55             value: "{{ .Release.Namespace }}"
56           - name: aaf_locator_container
57             value: "oom"
58           - name: aaf_locator_container_ns
59             value: "{{ .Release.Namespace }}"
60           - name: aaf_locator_app_ns
61             value: "org.osaaf.aaf"
62           - name: "APP_FQDN"
63             value: "{{ .Values.global.aaf.hello.fqdn }}"
64           - name: "APP_FQI"
65             value: "aaf@aaf.osaaf.org"
66           - name: "DEPLOY_FQI"
67             value: "deployer@people.osaaf.org"
68           - name: "DEPLOY_PASSWORD"
69             value: "demo123456!"
70 # Hello specific.  Clients don't necessarily need this
71           - name: aaf_locator_public_fqdn
72             value: "{{.Values.global.aaf.public_fqdn}}"
73           - name: aaf_locator_name
74             value: "{{.Values.global.aaf.aaf_locator_name}}"
75           - name: aaf_locator_name_oom
76             value: "{{.Values.global.aaf.aaf_locator_name_oom}}"
77           - name: aaf_locator_fqdn_oom
78             value: "%N.%CNS"
79       containers:
80       - name: {{ include "common.name" . }}
81         command: ["/bin/bash","-c","cd /opt/app/aaf && exec bin/hello"]
82         image: {{ .Values.global.repository }}/onap/aaf/aaf_hello:{{.Values.global.aaf.imageVersion}}
83         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
84         volumeMounts:
85         - mountPath: "/opt/app/osaaf/local"
86           name: aaf-hello-vol
87         - mountPath: "/opt/app/aaf/status"
88           name: aaf-status-vol
89         - mountPath: /etc/localtime
90           name: localtime
91           readOnly: true
92         {{- if eq .Values.liveness.enabled true }}
93         livenessProbe:
94           tcpSocket:
95             port: {{ .Values.service.internalPort }}
96           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
97           periodSeconds: {{ .Values.liveness.periodSeconds }}
98         {{ end -}}
99         readinessProbe:
100           tcpSocket:
101             port: {{ .Values.service.internalPort }}
102           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
103           periodSeconds: {{ .Values.readiness.periodSeconds }}
104         resources:
105 {{ include "common.resources" . | indent 12 }}
106       {{- if .Values.nodeSelector }}
107       nodeSelector:
108 {{ toYaml .Values.nodeSelector | indent 10 }}
109       {{- end -}}
110       {{- if .Values.affinity }}
111       affinity:
112 {{ toYaml .Values.affinity | indent 10 }}
113       {{- end }}
114       volumes:
115       - name: localtime
116         hostPath:
117           path: /etc/localtime
118       - name: aaf-status-vol
119         persistentVolumeClaim:
120           claimName: {{ .Release.Name }}-aaf-status-pvc
121       - name: aaf-hello-vol
122         emptyDir: {}
123       imagePullSecrets:
124       - name: "{{ include "common.namespace" . }}-docker-registry-key"