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: "{{ $dot.Values.global.readinessRepository }}/{{ $dot.Values.global.readinessImage }}"
63 imagePullPolicy: {{ $dot.Values.global.pullPolicy | default $dot.Values.pullPolicy }}
78 fieldPath: metadata.namespace
79 - name: {{ include "common.name" $dot }}-aaf-config
80 image: {{ (default $dot.Values.repository $dot.Values.global.repository) }}/{{ $dot.Values.global.aafAgentImage }}
81 imagePullPolicy: {{ $dot.Values.global.pullPolicy | default $dot.Values.pullPolicy }}
83 - mountPath: "/opt/app/osaaf"
84 name: {{ include "common.fullname" $dot }}-aaf-config
85 {{- if $aafRoot.addconfig }}
86 - name: aaf-add-config
87 mountPath: /opt/app/aaf_config/bin/aaf-add-config.sh
88 subPath: aaf-add-config.sh
95 /opt/app/aaf_config/bin/agent.sh
96 {{- if $aafRoot.addconfig }}
97 /opt/app/aaf_config/bin/aaf-add-config.sh
101 value: "{{ $aafRoot.fqi }}"
102 - name: aaf_locate_url
103 value: "https://aaf-locate.{{ $dot.Release.Namespace}}:8095"
104 - name: aaf_locator_container
106 - name: aaf_locator_container_ns
107 value: "{{ $dot.Release.Namespace }}"
108 - name: aaf_locator_fqdn
109 value: "{{ $aafRoot.fqdn }}"
110 - name: aaf_locator_app_ns
111 value: "{{ $aafRoot.app_ns }}"
113 {{- include "common.secret.envFromSecret" (dict "global" $dot "uid" $aafRoot.secret_uid "key" "login") | indent 6 }}
114 - name: DEPLOY_PASSWORD
115 {{- include "common.secret.envFromSecret" (dict "global" $dot "uid" $aafRoot.secret_uid "key" "password") | indent 6 }}
116 #Note: want to put this on Nodes, eventually
117 - name: cadi_longitude
118 value: "{{ default "52.3" $aafRoot.cadi_longitude }}"
119 - name: cadi_latitude
120 value: "{{ default "13.2" $aafRoot.cadi_latitude }}"
121 #Hello specific. Clients don't don't need this, unless Registering with AAF Locator
122 - name: aaf_locator_public_fqdn
123 value: "{{ $aafRoot.public_fqdn | default "" }}"
127 {{- define "common.aaf-config-volume-mountpath" -}}
128 {{- if .Values.global.aafEnabled -}}
129 - mountPath: "/opt/app/osaaf"
130 name: {{ include "common.fullname" . }}-aaf-config
134 {{- define "common.aaf-config-volumes" -}}
135 {{- $dot := default . .dot -}}
136 {{- $aafRoot := default $dot.Values.aafConfig .aafRoot -}}
137 {{- if $dot.Values.global.aafEnabled -}}
138 - name: {{ include "common.fullname" $dot }}-aaf-config
141 {{- if $aafRoot.addconfig }}
142 - name: aaf-add-config
144 name: {{ include "common.fullname" $dot }}-aaf-add-config