blob: 92afc5a369f399d47c4b09fbc48a94b979d09dd4 [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 "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010020 release: {{ include "common.release" . }}
kj52dfb132018-03-27 15:50:39 +030021 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" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010030 release: {{ include "common.release" . }}
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
Sylvain Desbureaux7a235752019-11-28 15:01:45 +010037 {{- if and .Values.persistence.enabled }}
Instrumental0c7bc942019-08-06 16:36:13 -050038 persistentVolumeClaim:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010039 claimName: {{ include "common.release" . }}-aaf-hello-pvc
Sylvain Desbureaux7a235752019-11-28 15:01:45 +010040 {{- else }}
41 emptyDir: {}
42 {{- end }}
Instrumental0c7bc942019-08-06 16:36:13 -050043 imagePullSecrets:
44 - name: "{{ include "common.namespace" . }}-docker-registry-key"
kj52dfb132018-03-27 15:50:39 +030045 initContainers:
Instrumental0c7bc942019-08-06 16:36:13 -050046 - name: {{ include "common.name" . }}-config
47 image: {{ .Values.global.repository }}/{{.Values.aaf_init.image}}
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000048 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Instrumental378109d2018-10-16 20:40:41 -050049 volumeMounts:
Instrumental0c7bc942019-08-06 16:36:13 -050050 - mountPath: "/opt/app/osaaf"
Instrumentalcc3a0bd2019-05-01 14:18:49 -050051 name: aaf-hello-vol
Instrumental0c7bc942019-08-06 16:36:13 -050052# NOTE: Before this, need Liveness Attached to aaf-certman
53 command: ["bash","-c","exec /opt/app/aaf_config/bin/agent.sh"]
Instrumental378109d2018-10-16 20:40:41 -050054 env:
Instrumental0c7bc942019-08-06 16:36:13 -050055 - name: APP_FQI
56 value: "{{ .Values.aaf_init.fqi }}"
Instrumentalcc3a0bd2019-05-01 14:18:49 -050057 - name: aaf_locate_url
Instrumental0c7bc942019-08-06 16:36:13 -050058 value: "https://aaf-locate.{{ .Release.Namespace}}:8095"
Instrumentalcc3a0bd2019-05-01 14:18:49 -050059 - name: aaf_locator_container
60 value: "oom"
61 - name: aaf_locator_container_ns
62 value: "{{ .Release.Namespace }}"
Instrumental0c7bc942019-08-06 16:36:13 -050063 - name: aaf_locator_fqdn
64 value: "{{ .Values.aaf_init.fqdn }}"
Instrumentalcc3a0bd2019-05-01 14:18:49 -050065 - name: aaf_locator_app_ns
Instrumental0c7bc942019-08-06 16:36:13 -050066 value: "{{ .Values.aaf_init.app_ns }}"
67 - name: DEPLOY_FQI
Instrumentalcc3a0bd2019-05-01 14:18:49 -050068 value: "deployer@people.osaaf.org"
Instrumental0c7bc942019-08-06 16:36:13 -050069# Note: We want to put this in Secrets or at LEAST ConfigMaps
70 - name: DEPLOY_PASSWORD
Instrumentalcc3a0bd2019-05-01 14:18:49 -050071 value: "demo123456!"
Instrumental0c7bc942019-08-06 16:36:13 -050072# Note: want to put this on Nodes, evenutally
73 - name: cadi_longitude
74 value: "{{ .Values.aaf_init.cadi_longitude }}"
75 - name: cadi_latitude
76 value: "{{ .Values.aaf_init.cadi_latitude }}"
77# Hello specific. Clients don't don't need this, unless Registering with AAF Locator
Instrumentalcc3a0bd2019-05-01 14:18:49 -050078 - name: aaf_locator_public_fqdn
79 value: "{{.Values.global.aaf.public_fqdn}}"
kj52dfb132018-03-27 15:50:39 +030080 containers:
Mandeep Khinda6dcc80d2018-10-09 14:47:35 +000081 - name: {{ include "common.name" . }}
Instrumental0c7bc942019-08-06 16:36:13 -050082 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"]
83 image: {{ .Values.global.repository }}/{{.Values.service.image }}
kj52dfb132018-03-27 15:50:39 +030084 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
85 volumeMounts:
Instrumental0c7bc942019-08-06 16:36:13 -050086 - mountPath: "/opt/app/osaaf"
Instrumentalcc3a0bd2019-05-01 14:18:49 -050087 name: aaf-hello-vol
Mahendra Raghuwanshiafb1e2a2018-05-03 12:15:03 +000088 - mountPath: /etc/localtime
89 name: localtime
90 readOnly: true
kj52dfb132018-03-27 15:50:39 +030091 {{- if eq .Values.liveness.enabled true }}
92 livenessProbe:
93 tcpSocket:
Instrumental0c7bc942019-08-06 16:36:13 -050094 port: {{ .Values.service.port }}
kj52dfb132018-03-27 15:50:39 +030095 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
96 periodSeconds: {{ .Values.liveness.periodSeconds }}
97 {{ end -}}
98 readinessProbe:
99 tcpSocket:
Instrumental0c7bc942019-08-06 16:36:13 -0500100 port: {{ .Values.service.port }}
kj52dfb132018-03-27 15:50:39 +0300101 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
102 periodSeconds: {{ .Values.readiness.periodSeconds }}
103 resources:
Mandeep Khinda5e3f36a2018-09-24 15:25:42 +0000104{{ include "common.resources" . | indent 12 }}
kj52dfb132018-03-27 15:50:39 +0300105 {{- 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 }}