blob: c5fcf68a581efc93b665c248c7a6471734238c2f [file] [log] [blame]
kj52dfb132018-03-27 15:50:39 +03001# 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.
kj52dfb132018-03-27 15:50:39 +030014apiVersion: extensions/v1beta1
15kind: Deployment
16metadata:
17 labels:
18 app: {{ include "common.name" . }}
19 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
20 release: {{ .Release.Name }}
21 heritage: {{ .Release.Service }}
22 name: {{ include "common.fullname" . }}
23 namespace: {{ include "common.namespace" . }}
24spec:
Instrumentalcc3a0bd2019-05-01 14:18:49 -050025 replicas: {{ .Values.global.aaf.hello.replicas }}
kj52dfb132018-03-27 15:50:39 +030026 template:
27 metadata:
28 labels:
29 app: {{ include "common.name" . }}
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000030 release: {{ .Release.Name }}
kj52dfb132018-03-27 15:50:39 +030031 spec:
Instrumental0c7bc942019-08-06 16:36:13 -050032 volumes:
33 - name: localtime
34 hostPath:
35 path: /etc/localtime
36 - name: aaf-hello-vol
37 persistentVolumeClaim:
38 claimName: {{ .Release.Name }}-aaf-hello-pvc
39 imagePullSecrets:
40 - name: "{{ include "common.namespace" . }}-docker-registry-key"
kj52dfb132018-03-27 15:50:39 +030041 initContainers:
Instrumental0c7bc942019-08-06 16:36:13 -050042 - name: {{ include "common.name" . }}-config
43 image: {{ .Values.global.repository }}/{{.Values.aaf_init.image}}
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000044 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Instrumental378109d2018-10-16 20:40:41 -050045 volumeMounts:
Instrumental0c7bc942019-08-06 16:36:13 -050046 - mountPath: "/opt/app/osaaf"
Instrumentalcc3a0bd2019-05-01 14:18:49 -050047 name: aaf-hello-vol
Instrumental0c7bc942019-08-06 16:36:13 -050048# NOTE: Before this, need Liveness Attached to aaf-certman
49 command: ["bash","-c","exec /opt/app/aaf_config/bin/agent.sh"]
Instrumental378109d2018-10-16 20:40:41 -050050 env:
Instrumental0c7bc942019-08-06 16:36:13 -050051 - name: APP_FQI
52 value: "{{ .Values.aaf_init.fqi }}"
Instrumentalcc3a0bd2019-05-01 14:18:49 -050053 - name: aaf_locate_url
Instrumental0c7bc942019-08-06 16:36:13 -050054 value: "https://aaf-locate.{{ .Release.Namespace}}:8095"
Instrumentalcc3a0bd2019-05-01 14:18:49 -050055 - name: aaf_locator_container
56 value: "oom"
57 - name: aaf_locator_container_ns
58 value: "{{ .Release.Namespace }}"
Instrumental0c7bc942019-08-06 16:36:13 -050059 - name: aaf_locator_fqdn
60 value: "{{ .Values.aaf_init.fqdn }}"
Instrumentalcc3a0bd2019-05-01 14:18:49 -050061 - name: aaf_locator_app_ns
Instrumental0c7bc942019-08-06 16:36:13 -050062 value: "{{ .Values.aaf_init.app_ns }}"
63 - name: DEPLOY_FQI
Instrumentalcc3a0bd2019-05-01 14:18:49 -050064 value: "deployer@people.osaaf.org"
Instrumental0c7bc942019-08-06 16:36:13 -050065# Note: We want to put this in Secrets or at LEAST ConfigMaps
66 - name: DEPLOY_PASSWORD
Instrumentalcc3a0bd2019-05-01 14:18:49 -050067 value: "demo123456!"
Instrumental0c7bc942019-08-06 16:36:13 -050068# Note: want to put this on Nodes, evenutally
69 - name: cadi_longitude
70 value: "{{ .Values.aaf_init.cadi_longitude }}"
71 - name: cadi_latitude
72 value: "{{ .Values.aaf_init.cadi_latitude }}"
73# Hello specific. Clients don't don't need this, unless Registering with AAF Locator
Instrumentalcc3a0bd2019-05-01 14:18:49 -050074 - name: aaf_locator_public_fqdn
75 value: "{{.Values.global.aaf.public_fqdn}}"
kj52dfb132018-03-27 15:50:39 +030076 containers:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000077 - name: {{ include "common.name" . }}
Instrumental0c7bc942019-08-06 16:36:13 -050078 command: ["bash","-c","cd /opt/app/aaf && if [ ! -d /opt/app/osaaf/etc ]; then cp -Rf etc logs /opt/app/osaaf; fi && exec bin/hello"]
79 image: {{ .Values.global.repository }}/{{.Values.service.image }}
kj52dfb132018-03-27 15:50:39 +030080 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
81 volumeMounts:
Instrumental0c7bc942019-08-06 16:36:13 -050082 - mountPath: "/opt/app/osaaf"
Instrumentalcc3a0bd2019-05-01 14:18:49 -050083 name: aaf-hello-vol
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000084 - mountPath: /etc/localtime
85 name: localtime
86 readOnly: true
kj52dfb132018-03-27 15:50:39 +030087 {{- if eq .Values.liveness.enabled true }}
88 livenessProbe:
89 tcpSocket:
Instrumental0c7bc942019-08-06 16:36:13 -050090 port: {{ .Values.service.port }}
kj52dfb132018-03-27 15:50:39 +030091 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
92 periodSeconds: {{ .Values.liveness.periodSeconds }}
93 {{ end -}}
94 readinessProbe:
95 tcpSocket:
Instrumental0c7bc942019-08-06 16:36:13 -050096 port: {{ .Values.service.port }}
kj52dfb132018-03-27 15:50:39 +030097 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
98 periodSeconds: {{ .Values.readiness.periodSeconds }}
99 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000100{{ include "common.resources" . | indent 12 }}
kj52dfb132018-03-27 15:50:39 +0300101 {{- if .Values.nodeSelector }}
102 nodeSelector:
103{{ toYaml .Values.nodeSelector | indent 10 }}
104 {{- end -}}
105 {{- if .Values.affinity }}
106 affinity:
107{{ toYaml .Values.affinity | indent 10 }}
108 {{- end }}