Revert "basic auth for so-monitoring"
[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 apiVersion: extensions/v1beta1
15 kind: Deployment
16 metadata:
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" . }}
24 spec:
25   replicas: {{ .Values.global.aaf.hello.replicas }}
26   template:
27     metadata:
28       labels:
29         app: {{ include "common.name" . }}
30         release: {{ .Release.Name }}
31     spec:
32       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"
41       initContainers:
42       - name: {{ include "common.name" . }}-config
43         image: {{ .Values.global.repository }}/{{.Values.aaf_init.image}}
44         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
45         volumeMounts:
46         - mountPath: "/opt/app/osaaf"
47           name: aaf-hello-vol
48 # NOTE: Before this, need Liveness Attached to aaf-certman
49         command: ["bash","-c","exec /opt/app/aaf_config/bin/agent.sh"]
50         env:
51           - name: APP_FQI
52             value: "{{ .Values.aaf_init.fqi }}"
53           - name: aaf_locate_url
54             value: "https://aaf-locate.{{ .Release.Namespace}}:8095"
55           - name: aaf_locator_container
56             value: "oom"
57           - name: aaf_locator_container_ns
58             value: "{{ .Release.Namespace }}"
59           - name: aaf_locator_fqdn
60             value: "{{ .Values.aaf_init.fqdn }}"
61           - name: aaf_locator_app_ns
62             value: "{{ .Values.aaf_init.app_ns }}"
63           - name: DEPLOY_FQI
64             value: "deployer@people.osaaf.org"
65 # Note: We want to put this in Secrets or at LEAST ConfigMaps
66           - name: DEPLOY_PASSWORD
67             value: "demo123456!"
68 # 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
74           - name: aaf_locator_public_fqdn
75             value: "{{.Values.global.aaf.public_fqdn}}"
76       containers:
77       - name: {{ include "common.name" . }}
78         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 }}
80         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
81         volumeMounts:
82         - mountPath: "/opt/app/osaaf"
83           name: aaf-hello-vol
84         - mountPath: /etc/localtime
85           name: localtime
86           readOnly: true
87         {{- if eq .Values.liveness.enabled true }}
88         livenessProbe:
89           tcpSocket:
90             port: {{ .Values.service.port }}
91           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
92           periodSeconds: {{ .Values.liveness.periodSeconds }}
93         {{ end -}}
94         readinessProbe:
95           tcpSocket:
96             port: {{ .Values.service.port }}
97           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
98           periodSeconds: {{ .Values.readiness.periodSeconds }}
99         resources:
100 {{ include "common.resources" . | indent 12 }}
101       {{- 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 }}