2 # Copyright © 2020 Samsung Electronics
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
19 {{- define "common.certInitializer._aafConfigVolumeName" -}}
20 {{ include "common.fullname" . }}-aaf-config
23 {{- define "common.certInitializer._aafAddConfigVolumeName" -}}
24 {{ print "aaf-add-config" }}
28 common templates to enable cert initialization for applictaions
30 In deployments/jobs/stateful include:
32 {{ include "common.certInitializer.initContainer" . | nindent XX }}
36 {{- include "common.certInitializer.volumeMount" . | nindent XX }}
38 {{- include "common.certInitializer.volume" . | nindent XX}}
40 {{- define "common.certInitializer._initContainer" -}}
41 {{- $dot := default . .dot -}}
42 {{- $initRoot := default $dot.Values.certInitializer .initRoot -}}
43 {{- $initName := default "certInitializer" -}}
44 {{/* Our version of helm doesn't support deepCopy so we need this nasty trick */}}
45 {{- $subchartDot := mergeOverwrite (fromJson (toJson $dot)) (dict "Chart" (set (fromJson (toJson .Chart)) "Name" $initRoot.nameOverride) "Values" $initRoot) }}
46 - name: {{ include "common.name" $dot }}-aaf-readiness
47 image: "{{ $dot.Values.global.readinessRepository }}/{{ $dot.Values.global.readinessImage }}"
48 imagePullPolicy: {{ $dot.Values.global.pullPolicy | default $dot.Values.pullPolicy }}
63 fieldPath: metadata.namespace
64 - name: {{ include "common.name" $dot }}-aaf-config
65 image: {{ (default $dot.Values.repository $dot.Values.global.repository) }}/{{ $dot.Values.global.aafAgentImage }}
66 imagePullPolicy: {{ $dot.Values.global.pullPolicy | default $dot.Values.pullPolicy }}
68 - mountPath: {{ $initRoot.mountPath }}
69 name: {{ include "common.certInitializer._aafConfigVolumeName" $dot }}
70 {{- if $initRoot.aaf_add_config }}
71 - name: {{ include "common.certInitializer._aafAddConfigVolumeName" $dot }}
72 mountPath: /opt/app/aaf_config/bin/aaf-add-config.sh
73 subPath: aaf-add-config.sh
80 /opt/app/aaf_config/bin/agent.sh
81 {{- if $initRoot.aaf_add_config }}
82 /opt/app/aaf_config/bin/aaf-add-config.sh
86 value: "{{ $initRoot.fqi }}"
87 - name: aaf_locate_url
88 value: "https://aaf-locate.{{ $dot.Release.Namespace}}:8095"
89 - name: aaf_locator_container
91 - name: aaf_locator_container_ns
92 value: "{{ $dot.Release.Namespace }}"
93 - name: aaf_locator_fqdn
94 value: "{{ $initRoot.fqdn }}"
95 - name: aaf_locator_app_ns
96 value: "{{ $initRoot.app_ns }}"
98 {{- include "common.secret.envFromSecretFast" (dict "global" $subchartDot "uid" "deployer-creds" "key" "login") | indent 6 }}
99 - name: DEPLOY_PASSWORD
100 {{- include "common.secret.envFromSecretFast" (dict "global" $subchartDot "uid" "deployer-creds" "key" "password") | indent 6 }}
101 #Note: want to put this on Nodes, eventually
102 - name: cadi_longitude
103 value: "{{ default "52.3" $initRoot.cadi_longitude }}"
104 - name: cadi_latitude
105 value: "{{ default "13.2" $initRoot.cadi_latitude }}"
106 #Hello specific. Clients don't don't need this, unless Registering with AAF Locator
107 - name: aaf_locator_public_fqdn
108 value: "{{ $initRoot.public_fqdn | default "" }}"
111 {{- define "common.certInitializer._volumeMount" -}}
112 {{- $dot := default . .dot -}}
113 {{- $initRoot := default $dot.Values.certInitializer .initRoot -}}
114 - mountPath: {{ $initRoot.mountPath }}
115 name: {{ include "common.certInitializer._aafConfigVolumeName" $dot }}
118 {{- define "common.certInitializer._volumes" -}}
119 {{- $dot := default . .dot -}}
120 {{- $initRoot := default $dot.Values.certInitializer .initRoot -}}
121 {{- $subchartDot := mergeOverwrite (fromJson (toJson $dot)) (dict "Chart" (set (fromJson (toJson .Chart)) "Name" $initRoot.nameOverride) "Values" $initRoot) }}
122 - name: {{ include "common.certInitializer._aafConfigVolumeName" $dot }}
125 {{- if $initRoot.aaf_add_config }}
126 - name: {{ include "common.certInitializer._aafAddConfigVolumeName" $dot }}
128 name: {{ include "common.fullname" $subchartDot }}-add-config
133 {{- define "common.certInitializer.initContainer" -}}
134 {{- $dot := default . .dot -}}
135 {{- if $dot.Values.global.aafEnabled }}
136 {{ include "common.certInitializer._initContainer" . }}
140 {{- define "common.certInitializer.volumeMount" -}}
141 {{- $dot := default . .dot -}}
142 {{- if $dot.Values.global.aafEnabled }}
143 {{- include "common.certInitializer._volumeMount" . }}
147 {{- define "common.certInitializer.volumes" -}}
148 {{- $dot := default . .dot -}}
149 {{- if $dot.Values.global.aafEnabled }}
150 {{- include "common.certInitializer._volumes" . }}