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" .Values.<yourkey> "dot" .)
22 # additional scripts can be defined to handle certs
25 app_ns: "org.osaaf.aaf"
26 fqi: "sdnc@sdnc.onap.org"
27 fqi_namespace: org.onap.sdnc
28 public_fqdn: "aaf.osaaf.org"
29 aafDeployFqi: "deployer@people.osaaf.org"
30 aafDeployPass: demo123456!
32 cadi_longitude: "-72.0"
33 secret_uid: &aaf_secret_uid my-component-aaf-deploy-creds
35 # secrets configuration, Note: create a secrets template
37 - uid: *aaf_secret_uid
39 externalSecret: '{{ ternary (tpl (default "" .Values.aafConfig.aafDeployCredsExternalSecret) .) "aafIsDisabled" .Values.global.aafEnabled }}'
40 login: '{{ .Values.aafConfig.aafDeployFqi }}'
41 password: '{{ .Values.aafConfig.aafDeployPass }}'
42 passwordPolicy: required
44 In deployments/jobs/stateful include:
46 {{ include "common.aaf-config" . | nindent XX}}
50 {{- if .Values.global.aafEnabled }}
51 - mountPath: "/opt/app/osaaf"
52 name: {{ include "common.fullname" . }}-aaf-config
55 {{- include "common.aaf-config-volumes" . | nindent XX}}
57 {{- define "common.aaf-config" -}}
58 {{- $dot := default . .dot -}}
59 {{- $aafRoot := default $dot.Values.aafConfig .aafRoot -}}
60 {{- if $dot.Values.global.aafEnabled -}}
61 - name: {{ include "common.name" $dot }}-aaf-readiness
62 image: {{ include "common.repository" $dot }}/{{ $dot.Values.global.readinessImage }}
63 imagePullPolicy: {{ $dot.Values.global.pullPolicy | default $dot.Values.pullPolicy }}
78 fieldPath: metadata.namespace
86 - name: {{ include "common.name" $dot }}-aaf-config
87 image: {{ (default $dot.Values.repository $dot.Values.global.repository) }}/{{ $dot.Values.global.aafAgentImage }}
88 imagePullPolicy: {{ $dot.Values.global.pullPolicy | default $dot.Values.pullPolicy }}
90 - mountPath: "/opt/app/osaaf"
91 name: {{ include "common.fullname" $dot }}-aaf-config
92 {{- if $aafRoot.addconfig }}
93 - name: aaf-add-config
94 mountPath: /opt/app/aaf_config/bin/aaf-add-config.sh
95 subPath: aaf-add-config.sh
102 /opt/app/aaf_config/bin/agent.sh
103 {{- if $aafRoot.addconfig }}
104 /opt/app/aaf_config/bin/aaf-add-config.sh
108 value: "{{ $aafRoot.fqi }}"
109 - name: aaf_locate_url
110 value: "https://aaf-locate.{{ $dot.Release.Namespace}}:8095"
111 - name: aaf_locator_container
113 - name: aaf_locator_container_ns
114 value: "{{ $dot.Release.Namespace }}"
115 - name: aaf_locator_fqdn
116 value: "{{ $aafRoot.fqdn }}"
117 - name: aaf_locator_app_ns
118 value: "{{ $aafRoot.app_ns }}"
120 {{- include "common.secret.envFromSecretFast" (dict "global" $dot "uid" $aafRoot.secret_uid "key" "login") | indent 6 }}
121 - name: DEPLOY_PASSWORD
122 {{- include "common.secret.envFromSecretFast" (dict "global" $dot "uid" $aafRoot.secret_uid "key" "password") | indent 6 }}
123 #Note: want to put this on Nodes, eventually
124 - name: cadi_longitude
125 value: "{{ default "52.3" $aafRoot.cadi_longitude }}"
126 - name: cadi_latitude
127 value: "{{ default "13.2" $aafRoot.cadi_latitude }}"
128 #Hello specific. Clients don't don't need this, unless Registering with AAF Locator
129 - name: aaf_locator_public_fqdn
130 value: "{{ $aafRoot.public_fqdn | default "" }}"
141 {{- define "common.aaf-config-volume-mountpath" -}}
142 {{- if .Values.global.aafEnabled -}}
143 - mountPath: "/opt/app/osaaf"
144 name: {{ include "common.fullname" . }}-aaf-config
148 {{- define "common.aaf-config-volumes" -}}
149 {{- $dot := default . .dot -}}
150 {{- $aafRoot := default $dot.Values.aafConfig .aafRoot -}}
151 {{- if $dot.Values.global.aafEnabled -}}
152 - name: {{ include "common.fullname" $dot }}-aaf-config
155 {{- if $aafRoot.addconfig }}
156 - name: aaf-add-config
158 name: {{ include "common.fullname" $dot }}-aaf-add-config