Jakub Latusek | d71d26c | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 2 | # ============LICENSE_START======================================================= |
| 3 | # Copyright (C) 2018 Ericsson. All rights reserved. |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 4 | # Modifications Copyright (C) 2020 AT&T Intellectual Property. |
Sirisha_Manchikanti | b402a59 | 2022-09-09 12:01:20 +0100 | [diff] [blame] | 5 | # Modifications Copyright © 2022 Nordix Foundation |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 6 | # ================================================================================ |
| 7 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | # you may not use this file except in compliance with the License. |
| 9 | # You may obtain a copy of the License at |
| 10 | # |
| 11 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | # |
| 13 | # Unless required by applicable law or agreed to in writing, software |
| 14 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | # See the License for the specific language governing permissions and |
| 17 | # limitations under the License. |
| 18 | # |
| 19 | # SPDX-License-Identifier: Apache-2.0 |
| 20 | # ============LICENSE_END========================================================= |
Jakub Latusek | d71d26c | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 21 | */}} |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 22 | |
Grzegorz-Lis | 4fad302 | 2020-07-31 10:18:21 +0200 | [diff] [blame] | 23 | apiVersion: apps/v1 |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 24 | kind: StatefulSet |
| 25 | metadata: |
| 26 | name: {{ include "common.fullname" . }} |
| 27 | namespace: {{ include "common.namespace" . }} |
| 28 | labels: |
| 29 | app: {{ include "common.name" . }} |
| 30 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 31 | release: {{ include "common.release" . }} |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 32 | heritage: {{ .Release.Service }} |
| 33 | spec: |
| 34 | serviceName: {{ include "common.servicename" . }} |
| 35 | replicas: {{ .Values.replicaCount }} |
| 36 | selector: |
| 37 | matchLabels: |
| 38 | app: {{ include "common.name" . }} |
| 39 | template: |
| 40 | metadata: |
| 41 | labels: |
| 42 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 43 | release: {{ include "common.release" . }} |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 44 | spec: |
Dominik Mizyn | b8c44b4 | 2020-04-21 10:48:27 +0200 | [diff] [blame] | 45 | initContainers: |
| 46 | - command: |
| 47 | - sh |
| 48 | args: |
| 49 | - -c |
Taka Cho | ebd6295 | 2020-10-08 13:50:09 -0400 | [diff] [blame] | 50 | - "cd /config-input && for PFILE in `ls -1`; do envsubst <${PFILE} >/config/${PFILE}; done" |
Dominik Mizyn | b8c44b4 | 2020-04-21 10:48:27 +0200 | [diff] [blame] | 51 | env: |
| 52 | - name: TRUSTSTORE_PASSWORD |
| 53 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "truststore-pass" "key" "password") | indent 10 }} |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 54 | - name: KEYSTORE_PASSWORD |
| 55 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "keystore-pass" "key" "password") | indent 10 }} |
Dominik Mizyn | b8c44b4 | 2020-04-21 10:48:27 +0200 | [diff] [blame] | 56 | - name: RESTSERVER_USER |
| 57 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "login") | indent 10 }} |
| 58 | - name: RESTSERVER_PASSWORD |
| 59 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "password") | indent 10 }} |
Sirisha_Manchikanti | b402a59 | 2022-09-09 12:01:20 +0100 | [diff] [blame] | 60 | {{- if .Values.config.useStrimziKafka }} |
| 61 | - name: JAASLOGIN |
| 62 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "policy-kafka-user" "key" "sasl.jaas.config") | indent 10 }} |
| 63 | {{- end }} |
Dominik Mizyn | b8c44b4 | 2020-04-21 10:48:27 +0200 | [diff] [blame] | 64 | volumeMounts: |
| 65 | - mountPath: /config-input |
| 66 | name: apexconfig-input |
| 67 | - mountPath: /config |
| 68 | name: apexconfig |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 69 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
Dominik Mizyn | b8c44b4 | 2020-04-21 10:48:27 +0200 | [diff] [blame] | 70 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 71 | name: {{ include "common.name" . }}-update-config |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 72 | {{ include "common.certInitializer.initContainer" . | indent 6 }} |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 73 | containers: |
| 74 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | 7c8c686 | 2020-11-19 18:02:37 +0100 | [diff] [blame] | 75 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 76 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Taka Cho | 9658ce8 | 2020-12-10 14:34:18 -0500 | [diff] [blame] | 77 | command: ["sh","-c"] |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 78 | args: ["if [ -f {{ .Values.certInitializer.credsPath }}/.ci ]; then \ |
Guillaume Lambert | 2b6f82c | 2021-03-02 21:45:00 +0100 | [diff] [blame] | 79 | . {{ .Values.certInitializer.credsPath }}/.ci; fi;\ |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 80 | /opt/app/policy/apex-pdp/bin/apexOnapPf.sh -c /home/apexuser/config/OnapPfConfig.json"] |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 81 | ports: |
| 82 | - containerPort: {{ .Values.service.externalPort }} |
| 83 | {{- if eq .Values.liveness.enabled true }} |
| 84 | livenessProbe: |
| 85 | tcpSocket: |
| 86 | port: {{ .Values.service.externalPort }} |
| 87 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 88 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 89 | {{- end }} |
| 90 | readinessProbe: |
| 91 | tcpSocket: |
| 92 | port: {{ .Values.service.externalPort }} |
| 93 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 94 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 95 | env: |
| 96 | - name: REPLICAS |
| 97 | value: "{{ .Values.replicaCount }}" |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 98 | {{- if not .Values.global.aafEnabled }} |
| 99 | - name: KEYSTORE_PASSWORD |
| 100 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "keystore-pass" "key" "password") | indent 12 }} |
| 101 | - name: TRUSTSTORE_PASSWORD |
| 102 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "truststore-pass" "key" "password") | indent 12 }} |
| 103 | {{- end }} |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 104 | volumeMounts: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 105 | {{ include "common.certInitializer.volumeMount" . | indent 10 }} |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 106 | - mountPath: /etc/localtime |
| 107 | name: localtime |
| 108 | readOnly: true |
| 109 | - mountPath: /var/log/onap |
| 110 | name: policy-logs |
mmis | 0d92fb7 | 2018-09-19 12:44:35 +0100 | [diff] [blame] | 111 | - mountPath: /home/apexuser/config |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 112 | name: apexconfig |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 113 | resources: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 114 | {{ include "common.resources" . }} |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 115 | {{- if .Values.nodeSelector }} |
| 116 | nodeSelector: |
| 117 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 118 | {{- end -}} |
| 119 | {{- if .Values.affinity }} |
| 120 | affinity: |
| 121 | {{ toYaml .Values.affinity | indent 10 }} |
| 122 | {{- end }} |
farida azmy | c117837 | 2021-04-11 12:55:33 +0200 | [diff] [blame] | 123 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 124 | volumes: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 125 | {{ include "common.certInitializer.volumes" . | indent 8 }} |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 126 | - name: localtime |
| 127 | hostPath: |
| 128 | path: /etc/localtime |
| 129 | - name: policy-logs |
| 130 | emptyDir: {} |
Dominik Mizyn | b8c44b4 | 2020-04-21 10:48:27 +0200 | [diff] [blame] | 131 | - name: apexconfig-input |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 132 | configMap: |
| 133 | name: {{ include "common.fullname" . }}-configmap |
mmis | 0d92fb7 | 2018-09-19 12:44:35 +0100 | [diff] [blame] | 134 | defaultMode: 0755 |
Dominik Mizyn | b8c44b4 | 2020-04-21 10:48:27 +0200 | [diff] [blame] | 135 | - name: apexconfig |
| 136 | emptyDir: |
| 137 | medium: Memory |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 138 | imagePullSecrets: |
| 139 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |