blob: 755315296d63e64e48fb55a9534e4a1b7d58231b [file] [log] [blame]
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +02001{*/
2# Copyright © 2020 AT&T, Orange
3#
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
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
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.
15*/}
16
17{{- define "aaf.permissionFixer" -}}
Sylvain Desbureauxef766402021-02-11 18:12:46 +010018- name: onboard-identity-and-fix-permission
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020019 command:
20 - /bin/sh
21 args:
22 - -c
23 - |
Sylvain Desbureauxef766402021-02-11 18:12:46 +010024 echo "*** Move files from configmap to emptyDir"
25 cp -L /config-input-identity/* /config-identity/
26 echo "*** set righ user to the different folders"
27 chown -R 1000:1000 /config-identity
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020028 chown -R 1000:1000 /opt/app/aaf
29 chown -R 1000:1000 /opt/app/osaaf
Sylvain Desbureaux0dfa3872020-11-21 21:29:17 +010030 image: {{ include "repositoryGenerator.image.busybox" . }}
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020031 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
32 volumeMounts:
33 - mountPath: /opt/app/osaaf
34 name: aaf-config-vol
Sylvain Desbureauxef766402021-02-11 18:12:46 +010035 - mountPath: /config-input-identity
36 name: config-init-identity
37 - mountPath: /config-identity
38 name: config-identity
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020039 resources:
40 limits:
41 cpu: 100m
42 memory: 100Mi
43 requests:
44 cpu: 3m
45 memory: 20Mi
46{{- end -}}
47
48{{- define "aaf.podConfiguration" }}
49- name: {{ include "common.name" . }}-config-container
Sylvain Desbureaux0dfa3872020-11-21 21:29:17 +010050 image: {{ include "repositoryGenerator.repository" . }}/{{.Values.global.aaf.config.image}}
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +020051 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52 command:
53 - /bin/bash
54 args:
55 - -c
56 - |
57 cd /opt/app/aaf_config
58 bin/agent.sh
59 volumeMounts:
60 - mountPath: "/opt/app/osaaf"
61 name: aaf-config-vol
62 env:
63 - name: aaf_env
64 value: "{{ .Values.global.aaf.aaf_env }}"
65 - name: cadi_latitude
66 value: "{{ .Values.global.aaf.cadi_latitude }}"
67 - name: cadi_longitude
68 value: "{{ .Values.global.aaf.cadi_longitude }}"
69 - name: cadi_x509_issuers
70 value: "{{ .Values.global.aaf.cadi_x509_issuers }}"
71 - name: aaf_locate_url
72 value: "https://aaf-locate.{{ .Release.Namespace}}:8095"
73 - name: aaf_locator_container
74 value: "oom"
75 - name: aaf_release
76 value: "{{ .Values.global.aaf.aaf_release }}"
77 - name: aaf_locator_container_ns
78 valueFrom:
79 fieldRef:
80 apiVersion: v1
81 fieldPath: metadata.namespace
82 - name: aaf_locator_public_fqdn
83 value: "{{.Values.global.aaf.public_fqdn}}"
84 - name: aaf_locator_name
85 value: "{{.Values.global.aaf.aaf_locator_name}}"
86 - name: aaf_locator_name_oom
87 value: "{{.Values.global.aaf.aaf_locator_name_oom}}"
88 - name: cm_always_ignore_ips
89 value: "true"
90 - name: CASSANDRA_CLUSTER
91 value: "aaf-cass.{{ .Release.Namespace }}"
92 resources:
93 limits:
94 cpu: 100m
95 memory: 100Mi
96 requests:
97 cpu: 3m
98 memory: 20Mi
99{{- end -}}
100
101{{- define "aaf.initContainers" -}}
102initContainers:
103{{ include "aaf.permissionFixer" . }}
104{{- if .Values.sequence_order }}
105- name: {{ include "common.name" . }}-aaf-readiness
106 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +0200107 - /app/ready.py
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +0200108 args:
109 {{- range $container := .Values.sequence_order }}
110 - --container-name
111 - aaf-{{ $container}}
112 {{- end }}
113 env:
114 - name: NAMESPACE
115 valueFrom:
116 fieldRef:
117 apiVersion: v1
118 fieldPath: metadata.namespace
Sylvain Desbureaux0dfa3872020-11-21 21:29:17 +0100119 image: {{ include "repositoryGenerator.image.readiness" . }}
Sylvain Desbureaux8f9ef352020-04-14 15:02:57 +0200120 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
121 resources:
122 limits:
123 cpu: 100m
124 memory: 100Mi
125 requests:
126 cpu: 3m
127 memory: 20Mi
128{{- end }}
129{{ include "aaf.podConfiguration" . }}
130{{- end }}