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 {{- $subchartDot := fromJson (include "common.subChartDot" (dict "dot" $dot "initRoot" $initRoot)) }}
45 - name: {{ include "common.name" $dot }}-aaf-readiness
46 image: "{{ $subchartDot.Values.global.readinessRepository }}/{{ $subchartDot.Values.global.readinessImage }}"
47 imagePullPolicy: {{ $subchartDot.Values.global.pullPolicy | default $subchartDot.Values.pullPolicy }}
62 fieldPath: metadata.namespace
63 - name: {{ include "common.name" $dot }}-aaf-config
64 image: {{ (default $subchartDot.Values.repository $subchartDot.Values.global.repository) }}/{{ $subchartDot.Values.global.aafAgentImage }}
65 imagePullPolicy: {{ $subchartDot.Values.global.pullPolicy | default $subchartDot.Values.pullPolicy }}
67 - mountPath: {{ $initRoot.mountPath }}
68 name: {{ include "common.certInitializer._aafConfigVolumeName" $dot }}
69 - mountPath: /opt/app/aaf_config/cert/truststoreONAPall.jks.b64
71 subPath: truststoreONAPall.jks.b64
72 - mountPath: /opt/app/aaf_config/cert/truststoreONAP.p12.b64
74 subPath: truststoreONAP.p12.b64
75 {{- if $initRoot.aaf_add_config }}
76 - name: {{ include "common.certInitializer._aafAddConfigVolumeName" $dot }}
77 mountPath: /opt/app/aaf_config/bin/aaf-add-config.sh
78 subPath: aaf-add-config.sh
85 /opt/app/aaf_config/bin/agent.sh
86 {{- if $initRoot.aaf_add_config }}
87 /opt/app/aaf_config/bin/aaf-add-config.sh
91 value: "{{ $initRoot.fqi }}"
92 - name: aaf_locate_url
93 value: "https://aaf-locate.{{ $dot.Release.Namespace}}:8095"
94 - name: aaf_locator_container
96 - name: aaf_locator_container_ns
97 value: "{{ $dot.Release.Namespace }}"
98 - name: aaf_locator_fqdn
99 value: "{{ $initRoot.fqdn }}"
100 - name: aaf_locator_app_ns
101 value: "{{ $initRoot.app_ns }}"
103 {{- include "common.secret.envFromSecretFast" (dict "global" $subchartDot "uid" "deployer-creds" "key" "login") | indent 6 }}
104 - name: DEPLOY_PASSWORD
105 {{- include "common.secret.envFromSecretFast" (dict "global" $subchartDot "uid" "deployer-creds" "key" "password") | indent 6 }}
106 #Note: want to put this on Nodes, eventually
107 - name: cadi_longitude
108 value: "{{ default "52.3" $initRoot.cadi_longitude }}"
109 - name: cadi_latitude
110 value: "{{ default "13.2" $initRoot.cadi_latitude }}"
111 #Hello specific. Clients don't don't need this, unless Registering with AAF Locator
112 - name: aaf_locator_public_fqdn
113 value: "{{ $initRoot.public_fqdn | default "" }}"
116 {{- define "common.certInitializer._volumeMount" -}}
117 {{- $dot := default . .dot -}}
118 {{- $initRoot := default $dot.Values.certInitializer .initRoot -}}
119 - mountPath: {{ $initRoot.mountPath }}
120 name: {{ include "common.certInitializer._aafConfigVolumeName" $dot }}
123 {{- define "common.certInitializer._volumes" -}}
124 {{- $dot := default . .dot -}}
125 {{- $initRoot := default $dot.Values.certInitializer .initRoot -}}
126 {{- $subchartDot := mergeOverwrite (deepCopy (omit $dot "Values")) (dict "Chart" (set (fromJson (toJson $dot.Chart)) "Name" $initRoot.nameOverride) "Values" (mergeOverwrite (deepCopy $initRoot) (dict "global" $dot.Values.global))) }}
127 - name: {{ include "common.certInitializer._aafConfigVolumeName" $dot }}
130 - name: aaf-agent-certs
132 name: {{ include "common.fullname" $subchartDot }}-certs
135 {{- if $initRoot.aaf_add_config }}
136 - name: {{ include "common.certInitializer._aafAddConfigVolumeName" $dot }}
138 name: {{ include "common.fullname" $subchartDot }}-add-config
143 {{- define "common.certInitializer.initContainer" -}}
144 {{- $dot := default . .dot -}}
145 {{- if $dot.Values.global.aafEnabled }}
146 {{ include "common.certInitializer._initContainer" . }}
150 {{- define "common.certInitializer.volumeMount" -}}
151 {{- $dot := default . .dot -}}
152 {{- if $dot.Values.global.aafEnabled }}
153 {{- include "common.certInitializer._volumeMount" . }}
157 {{- define "common.certInitializer.volumes" -}}
158 {{- $dot := default . .dot -}}
159 {{- if $dot.Values.global.aafEnabled }}
160 {{- include "common.certInitializer._volumes" . }}