2 # Copyright © 2020 Amdocs, Bell Canada, highstreet technologies GmbH
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.
18 common templates to enable aaf configs for applictaions
20 Parameter for aafConfig to be defined in values.yaml
21 aafConfig: --> if a different key is used, call templates with argument (dict "aafRoot" "<yourkey>" "dot" .)
22 # additional scripts can be defined to handle certs
25 image: onap/aaf/aaf_agent:2.1.15
26 app_ns: "org.osaaf.aaf"
27 fqi: "sdnc@sdnc.onap.org"
28 fqi_namespace: org.onap.sdnc
29 public_fqdn: "aaf.osaaf.org"
30 aafDeployFqi: "deployer@people.osaaf.org"
31 aafDeployPass: demo123456!
33 cadi_longitude: "-72.0"
36 config.volumeReclaimPolicy: Delete
37 config.accessMode: ReadWriteMany
39 config.storageClass: "manual"
40 config.mountPath: "/dockerdata-nfs"
41 config.mountSubPath: "sdnc/aaf"
42 # secrets configuration, Note: create a secrets template
44 - uid: aaf-deploy-creds
46 externalSecret: '{{ ternary (tpl (default "" .Values.aafConfig.aafDeployCredsExternalSecret) .) "aafIsDiabled" .Values.global.aafEnabled }}'
47 login: '{{ .Values.aafConfig.aafDeployFqi }}'
48 password: '{{ .Values.aafConfig.aafDeployPass }}'
49 passwordPolicy: required
51 In deployments/jobs/stateful include:
53 {{ include "common.aaf-config" . | nindent XX}}
57 {{- if .Values.global.aafEnabled }}
58 - mountPath: "/opt/app/osaaf"
59 name: {{ include "common.fullname" . }}-aaf-config-vol
62 {{- include "common.aaf-config-volumes" . | nindent XX}}
64 If persistence.enabled = true
66 {{ include "common.aaf-config-pvc" . }}
68 {{ include "common.aaf-config-pv" . }}
71 {{- define "common.aaf-config" -}}
72 {{- $dot := default . .dot -}}
73 {{- $aafRoot := default "aafConfig" .aafRoot -}}
74 {{ if .Values.global.aafEnabled }}
75 - name: {{ include "common.name" . }}-aaf-readiness
76 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
77 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
93 fieldPath: metadata.namespace
94 - name: {{ include "common.name" . }}-aaf-config
95 image: {{ .Values.global.repository }}/{{index .Values $aafRoot "image" }}
96 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
98 - mountPath: "/opt/app/osaaf"
99 name: {{ include "common.fullname" . }}-aaf-config-vol
100 {{- if (index .Values $aafRoot "addconfig") }}
101 - name: aaf-add-config
102 mountPath: /opt/app/aaf_config/bin/aaf-add-config.sh
103 subPath: aaf-add-config.sh
110 /opt/app/aaf_config/bin/agent.sh
111 {{- if (index .Values $aafRoot "addconfig") }}
112 /opt/app/aaf_config/bin/aaf-add-config.sh
116 value: "{{ index .Values $aafRoot "fqi" }}"
117 - name: aaf_locate_url
118 value: "https://aaf-locate.{{ .Release.Namespace}}:8095"
119 - name: aaf_locator_container
121 - name: aaf_locator_container_ns
122 value: "{{ .Release.Namespace }}"
123 - name: aaf_locator_fqdn
124 value: "{{ index .Values $aafRoot "fqdn" }}"
125 - name: aaf_locator_app_ns
126 value: "{{ index .Values $aafRoot "app_ns" }}"
128 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "aaf-deploy-creds" "key" "login") | indent 6 }}
129 - name: DEPLOY_PASSWORD
130 {{- include "common.secret.envFromSecret" (dict "global" . "uid" "aaf-deploy-creds" "key" "password") | indent 6 }}
131 #Note: want to put this on Nodes, evenutally
132 - name: cadi_longitude
133 value: "{{ default "52.3" (index .Values $aafRoot "cadi_longitude") }}"
134 - name: cadi_latitude
135 value: "{{ default "13.2" (index .Values $aafRoot "cadi_latitude") }}"
136 #Hello specific. Clients don't don't need this, unless Registering with AAF Locator
137 - name: aaf_locator_public_fqdn
138 value: "{{ (index .Values $aafRoot "public_fqdn") | default "" }}"
143 {{- define "common.aaf-config-volume-mountpath" -}}
144 {{ if .Values.global.aafEnabled }}
145 - mountPath: "/opt/app/osaaf"
146 name: {{ include "common.fullname" . }}-aaf-config-vol
150 {{- define "common.aaf-config-volumes" -}}
151 {{ if .Values.global.aafEnabled }}
152 {{- $dot := default . .dot -}}
153 {{- $aafRoot := default "aafConfig" .aafRoot -}}
154 - name: {{ include "common.fullname" . }}-aaf-config-vol
155 persistentVolumeClaim:
156 claimName: {{ include "common.fullname" . }}-aaf-config-pvc
157 {{- if (index .Values $aafRoot "addconfig") }}
158 - name: aaf-add-config
160 name: {{ include "common.fullname" . }}-aaf-add-config
166 {{- define "common.aaf-config-pv" -}}
167 {{- $dot := default . .dot -}}
168 {{- $aafRoot := default "aafConfig" .aafRoot -}}
170 name: {{ include "common.fullname" . }}-aaf-config-pv
171 namespace: {{ include "common.namespace" . }}
173 app: {{ include "common.name" . }}-aaf-config-pv
174 chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
175 release: "{{ .Release.Name }}"
176 heritage: "{{ .Release.Service }}"
177 name: {{ include "common.fullname" . }}
180 storage: {{ index .Values $aafRoot "persistence" "config" "size"}}
182 - {{ index .Values $aafRoot "persistence" "config" "accessMode" }}
183 persistentVolumeReclaimPolicy: {{ index .Values $aafRoot "persistence" "config" "volumeReclaimPolicy" }}
185 path: {{ index .Values $aafRoot "persistence" "config" "mountPath" }}/{{ .Release.Name }}/{{ index .Values $aafRoot "persistence" "config" "mountSubPath" }}
186 {{- if (index .Values $aafRoot "persistence" "config" "storageClass") }}
187 {{- if (eq "-" (index .Values $aafRoot "persistence" "config" "storageClass")) }}
190 storageClassName: "{{ index .Values $aafRoot "persistence" "config" "storageClass" }}"
195 {{- define "common.aaf-config-pvc" -}}
196 {{- $dot := default . .dot -}}
197 {{- $aafRoot := default "aafConfig" .aafRoot -}}
199 name: {{ include "common.fullname" . }}-aaf-config-pvc
200 namespace: {{ include "common.namespace" . }}
202 app: {{ include "common.name" . }}
203 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
204 release: "{{ .Release.Name }}"
205 heritage: "{{ .Release.Service }}"
206 {{- if (index .Values $aafRoot "persistence" "annotations") }}
208 {{ toYaml (index .Values $aafRoot "persistence" "annotations" ) | indent 4 }}
213 app: {{ include "common.name" . }}-aaf-config-pv
215 - {{ index .Values $aafRoot "persistence" "config" "accessMode" }}
218 storage: {{ index .Values $aafRoot "persistence" "config" "size" }}
219 {{- if (index .Values $aafRoot "persistence" "config" "storageClass") }}
220 {{- if (eq "-" (index .Values $aafRoot "persistence" "config" "storageClass")) }}
223 storageClassName: "{{ index .Values $aafRoot "persistence" "config" "storageClass" }}"