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 "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 20 | release: {{ include "common.release" . }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 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" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 30 | release: {{ include "common.release" . }} |
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: |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 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 }} |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 38 | persistentVolumeClaim: |
| 39 | claimName: {{ include "common.release" . }}-aaf-hello-pvc |
Sylvain Desbureaux | 7a23575 | 2019-11-28 15:01:45 +0100 | [diff] [blame] | 40 | {{- else }} |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 41 | emptyDir: {} |
Sylvain Desbureaux | 7a23575 | 2019-11-28 15:01:45 +0100 | [diff] [blame] | 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: |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 46 | - name: fix-permission |
| 47 | command: ["/bin/sh","-c","chmod -R 775 /opt/app/osaaf/local && chown -R 1000:1000 /opt/app/osaaf"] |
| 48 | image: "{{ .Values.global.busyboxRepository }}/{{ .Values.global.busyboxImage }}" |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 49 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Instrumental | 378109d | 2018-10-16 20:40:41 -0500 | [diff] [blame] | 50 | volumeMounts: |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 51 | - mountPath: "/opt/app/osaaf/local" |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 52 | name: aaf-hello-vol |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 53 | - name: {{ include "common.name" . }}-config-container |
| 54 | image: {{ .Values.global.repository }}/{{.Values.aaf_init.image}} |
| 55 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 56 | command: ["bash","-c","cd /opt/app/aaf_config && bin/agent.sh"] |
| 57 | # command: ["bash","-c","cd /opt/app/aaf_config && echo Sleeping && sleep 480"] |
| 58 | # command: ["bash","-c","chown 1000:1000 /opt/app/osaaf && cd /opt/app/aaf_config && sleep 480"] |
| 59 | volumeMounts: |
| 60 | - mountPath: "/opt/app/osaaf/local" |
| 61 | name: aaf-hello-vol |
Instrumental | 378109d | 2018-10-16 20:40:41 -0500 | [diff] [blame] | 62 | env: |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 63 | - name: APP_FQI |
| 64 | value: "{{ .Values.aaf_init.fqi }}" |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 65 | - name: aaf_locate_url |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 66 | value: "https://aaf-locate.{{ .Release.Namespace}}:{{.Values.global.aaf.locate.internal_port}}" |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 67 | - name: aaf_locator_container |
| 68 | value: "oom" |
| 69 | - name: aaf_locator_container_ns |
| 70 | value: "{{ .Release.Namespace }}" |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 71 | # This should the APP's FQDN to be put in Locator |
| 72 | # This MUST match what is entered for AAF Certificate Artifacts |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 73 | - name: aaf_locator_fqdn |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 74 | value: "{{.Values.aaf_init.fqdn}}" |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 75 | # Hello specific. Clients don't don't need this, unless Registering with AAF Locator |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 76 | # This should be the APP's PUBLIC FQDN, if applicable |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 77 | - name: aaf_locator_public_fqdn |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 78 | value: "{{.Values.aaf_init.locator_public_fqdn}}" |
| 79 | - name: LATITUDE |
| 80 | value: "{{ .Values.aaf_init.cadi_latitude }}" |
| 81 | - name: LONGITUDE |
| 82 | value: "{{ .Values.aaf_init.cadi_longitude }}" |
| 83 | # Note: We want to put this in Secrets or at LEAST ConfigMaps |
| 84 | - name: "DEPLOY_FQI" |
| 85 | value: "deployer@people.osaaf.org" |
| 86 | # Note: want to put this on Nodes, evenutally |
| 87 | - name: "DEPLOY_PASSWORD" |
| 88 | value: "demo123456!" |
| 89 | # CONTAINER Definition |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 90 | containers: |
Mandeep Khinda | 6dcc80d | 2018-10-09 14:47:35 +0000 | [diff] [blame] | 91 | - name: {{ include "common.name" . }} |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 92 | 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"] |
| 93 | image: {{ .Values.global.repository }}/{{.Values.service.image }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 94 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 95 | volumeMounts: |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 96 | - mountPath: "/opt/app/osaaf/local" |
Instrumental | cc3a0bd | 2019-05-01 14:18:49 -0500 | [diff] [blame] | 97 | name: aaf-hello-vol |
Mahendra Raghuwanshi | afb1e2a | 2018-05-03 12:15:03 +0000 | [diff] [blame] | 98 | - mountPath: /etc/localtime |
| 99 | name: localtime |
| 100 | readOnly: true |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 101 | {{- if eq .Values.liveness.enabled true }} |
| 102 | livenessProbe: |
| 103 | tcpSocket: |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 104 | port: {{ .Values.service.port }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 105 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 106 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 107 | {{ end -}} |
| 108 | readinessProbe: |
| 109 | tcpSocket: |
Instrumental | 0c7bc94 | 2019-08-06 16:36:13 -0500 | [diff] [blame] | 110 | port: {{ .Values.service.port }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 111 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 112 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 113 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 114 | {{ include "common.resources" . | indent 12 }} |
kj | 52dfb13 | 2018-03-27 15:50:39 +0300 | [diff] [blame] | 115 | {{- if .Values.nodeSelector }} |
| 116 | nodeSelector: |
| 117 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 118 | {{- end -}} |
| 119 | {{- if .Values.affinity }} |
| 120 | affinity: |
| 121 | {{ toYaml .Values.affinity | indent 10 }} |
| 122 | {{- end }} |