kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 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. |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 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: |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 25 | replicas: {{ .Values.global.aaf.hello.replicas }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 26 | template: |
| 27 | metadata: |
| 28 | labels: |
| 29 | app: {{ include "common.name" . }} |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 30 | release: {{ .Release.Name }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 31 | spec: |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 32 | volumes: |
| 33 | - name: localtime |
| 34 | hostPath: |
| 35 | path: /etc/localtime |
| 36 | - name: aaf-hello-vol |
Sylvain Desbureaux | 7a23575 | 2019-11-28 15:01:45 +0100 | [diff] [blame^] | 37 | {{- if and .Values.persistence.enabled }} |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 38 | persistentVolumeClaim: |
| 39 | claimName: {{ .Release.Name }}-aaf-hello-pvc |
Sylvain Desbureaux | 7a23575 | 2019-11-28 15:01:45 +0100 | [diff] [blame^] | 40 | {{- else }} |
| 41 | emptyDir: {} |
| 42 | {{- end }} |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 43 | imagePullSecrets: |
| 44 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 45 | initContainers: |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 46 | - name: {{ include "common.name" . }}-config |
| 47 | image: {{ .Values.global.repository }}/{{.Values.aaf_init.image}} |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 48 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Instrumental | 378109d | 2018-10-16 20:40:41 -0500 | [diff] [blame] | 49 | volumeMounts: |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 50 | - mountPath: "/opt/app/osaaf" |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 51 | name: aaf-hello-vol |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 52 | # NOTE: Before this, need Liveness Attached to aaf-certman |
| 53 | command: ["bash","-c","exec /opt/app/aaf_config/bin/agent.sh"] |
Instrumental | 378109d | 2018-10-16 20:40:41 -0500 | [diff] [blame] | 54 | env: |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 55 | - name: APP_FQI |
| 56 | value: "{{ .Values.aaf_init.fqi }}" |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 57 | - name: aaf_locate_url |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 58 | value: "https://aaf-locate.{{ .Release.Namespace}}:8095" |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 59 | - name: aaf_locator_container |
| 60 | value: "oom" |
| 61 | - name: aaf_locator_container_ns |
| 62 | value: "{{ .Release.Namespace }}" |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 63 | - name: aaf_locator_fqdn |
| 64 | value: "{{ .Values.aaf_init.fqdn }}" |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 65 | - name: aaf_locator_app_ns |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 66 | value: "{{ .Values.aaf_init.app_ns }}" |
| 67 | - name: DEPLOY_FQI |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 68 | value: "deployer@people.osaaf.org" |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 69 | # Note: We want to put this in Secrets or at LEAST ConfigMaps |
| 70 | - name: DEPLOY_PASSWORD |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 71 | value: "demo123456!" |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 72 | # 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 |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 78 | - name: aaf_locator_public_fqdn |
| 79 | value: "{{.Values.global.aaf.public_fqdn}}" |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 80 | containers: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 81 | - name: {{ include "common.name" . }} |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 82 | 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 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 84 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 85 | volumeMounts: |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 86 | - mountPath: "/opt/app/osaaf" |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 87 | name: aaf-hello-vol |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 88 | - mountPath: /etc/localtime |
| 89 | name: localtime |
| 90 | readOnly: true |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 91 | {{- if eq .Values.liveness.enabled true }} |
| 92 | livenessProbe: |
| 93 | tcpSocket: |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 94 | port: {{ .Values.service.port }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 95 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 96 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 97 | {{ end -}} |
| 98 | readinessProbe: |
| 99 | tcpSocket: |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 100 | port: {{ .Values.service.port }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 101 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 102 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 103 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 104 | {{ include "common.resources" . | indent 12 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 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 }} |