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 - mountPath: /opt/app/aaf_config/cert/truststoreONAPall.jks.b64
72 subPath: truststoreONAPall.jks.b64
73 - mountPath: /opt/app/aaf_config/cert/truststoreONAP.p12.b64
75 subPath: truststoreONAP.p12.b64
76 {{- if $initRoot.aaf_add_config }}
77 - name: {{ include "common.certInitializer._aafAddConfigVolumeName" $dot }}
78 mountPath: /opt/app/aaf_config/bin/aaf-add-config.sh
79 subPath: aaf-add-config.sh
86 /opt/app/aaf_config/bin/agent.sh
87 {{- if $initRoot.aaf_add_config }}
88 /opt/app/aaf_config/bin/aaf-add-config.sh
92 value: "{{ $initRoot.fqi }}"
93 - name: aaf_locate_url
94 value: "https://aaf-locate.{{ $dot.Release.Namespace}}:8095"
95 - name: aaf_locator_container
97 - name: aaf_locator_container_ns
98 value: "{{ $dot.Release.Namespace }}"
99 - name: aaf_locator_fqdn
100 value: "{{ $initRoot.fqdn }}"
101 - name: aaf_locator_app_ns
102 value: "{{ $initRoot.app_ns }}"
104 {{- include "common.secret.envFromSecretFast" (dict "global" $subchartDot "uid" "deployer-creds" "key" "login") | indent 6 }}
105 - name: DEPLOY_PASSWORD
106 {{- include "common.secret.envFromSecretFast" (dict "global" $subchartDot "uid" "deployer-creds" "key" "password") | indent 6 }}
107 #Note: want to put this on Nodes, eventually
108 - name: cadi_longitude
109 value: "{{ default "52.3" $initRoot.cadi_longitude }}"
110 - name: cadi_latitude
111 value: "{{ default "13.2" $initRoot.cadi_latitude }}"
112 #Hello specific. Clients don't don't need this, unless Registering with AAF Locator
113 - name: aaf_locator_public_fqdn
114 value: "{{ $initRoot.public_fqdn | default "" }}"
117 {{- define "common.certInitializer._volumeMount" -}}
118 {{- $dot := default . .dot -}}
119 {{- $initRoot := default $dot.Values.certInitializer .initRoot -}}
120 - mountPath: {{ $initRoot.mountPath }}
121 name: {{ include "common.certInitializer._aafConfigVolumeName" $dot }}
124 {{- define "common.certInitializer._volumes" -}}
125 {{- $dot := default . .dot -}}
126 {{- $initRoot := default $dot.Values.certInitializer .initRoot -}}
127 {{- $subchartDot := mergeOverwrite (fromJson (toJson $dot)) (dict "Chart" (set (fromJson (toJson .Chart)) "Name" $initRoot.nameOverride) "Values" $initRoot) }}
128 - name: {{ include "common.certInitializer._aafConfigVolumeName" $dot }}
131 - name: aaf-agent-certs
133 name: {{ include "common.fullname" $subchartDot }}-certs
136 {{- if $initRoot.aaf_add_config }}
137 - name: {{ include "common.certInitializer._aafAddConfigVolumeName" $dot }}
139 name: {{ include "common.fullname" $subchartDot }}-add-config
144 {{- define "common.certInitializer.initContainer" -}}
145 {{- $dot := default . .dot -}}
146 {{- if $dot.Values.global.aafEnabled }}
147 {{ include "common.certInitializer._initContainer" . }}
151 {{- define "common.certInitializer.volumeMount" -}}
152 {{- $dot := default . .dot -}}
153 {{- if $dot.Values.global.aafEnabled }}
154 {{- include "common.certInitializer._volumeMount" . }}
158 {{- define "common.certInitializer.volumes" -}}
159 {{- $dot := default . .dot -}}
160 {{- if $dot.Values.global.aafEnabled }}
161 {{- include "common.certInitializer._volumes" . }}