Add OOM update so-bpmn-infra's Override.yaml file
[oom.git] / kubernetes / aaf / charts / aaf-service / 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.service.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_config:{{.Values.global.aaf.imageVersion}}
36         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
37         command: ["bash","-c","cd /opt/app/aaf_config && bin/pod_wait.sh config nc aaf-cass.{{ .Release.Namespace }} 9042 sleep 15 remove && bin/agent.sh"]
38         volumeMounts:
39           - mountPath: "/opt/app/osaaf"
40             name: aaf-config-vol
41           - mountPath: "/opt/app/aaf/status"
42             name: aaf-status-vol
43         env:
44           - name: aaf_env
45             value: "{{ .Values.global.aaf.aaf_env }}"
46           - name: cadi_latitude
47             value: "{{ .Values.global.aaf.cadi_latitude }}"
48           - name: cadi_longitude
49             value: "{{ .Values.global.aaf.cadi_longitude }}"
50           - name: cadi_x509_issuers
51             value: "{{ .Values.global.aaf.cadi_x509_issuers }}"
52           - name: aaf_locate_url
53             value: "https://aaf-locate.{{ .Release.Namespace}}:{{.Values.global.aaf.locate.internal_port}}"
54           - name: aaf_locator_container
55             value: "oom"
56           - name: aaf_release
57             value: "{{ .Values.global.aaf.aaf_release }}"
58           - name: aaf_locator_container_ns
59             value: "{{ .Release.Namespace }}"
60           - name: aaf_locator_public_fqdn
61             value: "{{.Values.global.aaf.public_fqdn}}"
62           - name: aaf_locator_name
63             value: "{{.Values.global.aaf.aaf_locator_name}}"
64           - name: aaf_locator_name_oom
65             value: "{{.Values.global.aaf.aaf_locator_name_oom}}"
66           - name: CASSANDRA_CLUSTER
67             value: "{{.Values.global.aaf.cass.fqdn}}.{{ .Release.Namespace }}"
68 #          - name: CASSANDRA_USER
69 #            value: ""
70 #          - name: CASSANDRA_PASSWORD
71 #            value: ""
72 #         - name: CASSANDRA_PORT
73 #            value: ""
74       containers:
75       - name: {{ include "common.name" . }}
76         command: ["/bin/bash","-c","cd /opt/app/aaf && bin/pod_wait.sh aaf-service aaf-cass  && exec bin/service"]
77         image: {{ .Values.global.repository }}/onap/aaf/aaf_service:{{.Values.global.aaf.imageVersion}}
78         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
79         lifecycle:
80           preStop:
81             exec:
82               command: ["/bin/sh","-c","rm /opt/app/aaf/status/aaf-service* && echo $HOSTNAME >> aaf-service.hosts"]
83         volumeMounts:
84         - mountPath: "/opt/app/osaaf"
85           name: aaf-config-vol
86         - mountPath: "/opt/app/aaf/status"
87           name: aaf-status-vol
88         - mountPath: /etc/localtime
89           name: localtime
90           readOnly: true
91         {{- if eq .Values.liveness.enabled true }}
92         livenessProbe:
93           tcpSocket:
94             port: {{ .Values.global.aaf.service.internal_port }}
95           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
96           periodSeconds: {{ .Values.liveness.periodSeconds }}
97         {{ end -}}
98         readinessProbe:
99           tcpSocket:
100             port: {{ .Values.global.aaf.service.internal_port }}
101           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
102           periodSeconds: {{ .Values.readiness.periodSeconds }}
103         resources:
104 {{ include "common.resources" . | indent 12 }}
105       {{- if .Values.nodeSelector }}
106       nodeSelector:
107 {{ toYaml .Values.nodeSelector | indent 10 }}
108       {{- end -}}
109       {{- if .Values.affinity }}
110       affinity:
111 {{ toYaml .Values.affinity | indent 10 }}
112       {{- end }}
113       volumes:
114       - name: localtime
115         hostPath:
116           path: /etc/localtime
117       - name: aaf-status-vol
118         persistentVolumeClaim:
119           claimName: {{ .Release.Name }}-aaf-status-pvc
120       - name: aaf-config-vol
121         persistentVolumeClaim:
122           claimName: {{ .Release.Name }}-aaf-config-pvc
123       imagePullSecrets:
124       - name: "{{ include "common.namespace" . }}-docker-registry-key"