2 ################################################################################
3 # Copyright (c) 2020 Nordix Foundation. #
4 # Copyright © 2020 Samsung Electronics, Modifications #
6 # Licensed under the Apache License, Version 2.0 (the "License"); #
7 # you may not use this file except in compliance with the License. #
8 # You may obtain a copy of the License at #
10 # http://www.apache.org/licenses/LICENSE-2.0 #
12 # Unless required by applicable law or agreed to in writing, software #
13 # distributed under the License is distributed on an "AS IS" BASIS, #
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
15 # See the License for the specific language governing permissions and #
16 # limitations under the License. #
17 ################################################################################
22 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
24 serviceName: {{ include "common.servicename" . }}
25 replicas: {{ index .Values.replicaCount }}
26 selector: {{- include "common.selectors" . | nindent 4 }}
29 labels: {{- include "common.labels" . | nindent 8 }}
31 {{- include "common.imagePullSecrets" . | nindent 6 }}
33 - name: {{ include "common.name" . }}-bootstrap-config
34 image: {{ include "repositoryGenerator.image.envsubst" . }}
35 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
44 envsubst <${PFILE} >/config/${PFILE}
45 chmod o+w /config/${PFILE}
47 cat /config/application.yaml
49 - name: A1CONTROLLER_USER
50 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "controller-secret" "key" "login") | indent 10 }}
51 - name: A1CONTROLLER_PASSWORD
52 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "controller-secret" "key" "password") | indent 10 }}
54 - mountPath: /config-input
55 name: {{ include "common.fullname" . }}-policy-conf-input
59 - name: {{ include "common.name" . }}-update-config
60 image: {{ include "repositoryGenerator.image.envsubst" . }}
61 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
63 runAsGroup: {{ .Values.groupID }}
64 runAsUser: {{ .Values.userID }}
69 - /tmp/scripts/daemon.sh
71 - name: A1CONTROLLER_USER
72 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "controller-secret" "key" "login") | indent 10 }}
73 - name: A1CONTROLLER_PASSWORD
74 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "controller-secret" "key" "password") | indent 10 }}
76 - mountPath: /tmp/scripts
77 name: {{ include "common.fullname" . }}-envsubst-scripts
78 - mountPath: /config-input
79 name: {{ include "common.fullname" . }}-policy-conf-input
82 - name: {{ include "common.name" . }}
83 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
84 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
85 ports: {{ include "common.containerPorts" . | nindent 10 }}
88 port: {{ .Values.readiness.port }}
89 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
90 periodSeconds: {{ .Values.liveness.periodSeconds }}
94 port: {{ .Values.liveness.port }}
96 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
97 periodSeconds: {{ .Values.liveness.periodSeconds }}
100 mountPath: /opt/app/policy-agent/data/application_configuration.json
101 subPath: application_configuration.json
103 mountPath: /opt/app/policy-agent/config/application.yaml
104 subPath: application.yaml
105 - name: {{ include "common.fullname" . }}
106 mountPath: "/var/policy-management-service/database"
107 resources: {{ include "common.resources" . | nindent 10 }}
108 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
110 - name: {{ include "common.fullname" . }}-policy-conf-input
112 name: {{ include "common.fullname" . }}-policy-conf
113 - name: {{ include "common.fullname" . }}-envsubst-scripts
115 name: {{ include "common.fullname" . }}-envsubst-scripts
120 {{- if not .Values.persistence.enabled }}
121 - name: {{ include "common.fullname" . }}
124 volumeClaimTemplates:
125 - {{include "common.PVCTemplate" . | indent 6 | trim }}