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. |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 5 | # ================================================================================ |
| 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 |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 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 | # |
| 18 | # SPDX-License-Identifier: Apache-2.0 |
| 19 | # ============LICENSE_END========================================================= |
Jakub Latusek | d71d26c | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 20 | */}} |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 21 | |
Grzegorz-Lis | 4fad302 | 2020-07-31 10:18:21 +0200 | [diff] [blame] | 22 | apiVersion: apps/v1 |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 23 | kind: StatefulSet |
| 24 | metadata: |
| 25 | name: {{ include "common.fullname" . }} |
| 26 | namespace: {{ include "common.namespace" . }} |
| 27 | labels: |
| 28 | app: {{ include "common.name" . }} |
| 29 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 30 | release: {{ include "common.release" . }} |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 31 | heritage: {{ .Release.Service }} |
| 32 | spec: |
| 33 | serviceName: {{ include "common.servicename" . }} |
| 34 | replicas: {{ .Values.replicaCount }} |
| 35 | selector: |
| 36 | matchLabels: |
| 37 | app: {{ include "common.name" . }} |
| 38 | template: |
| 39 | metadata: |
| 40 | labels: |
| 41 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 42 | release: {{ include "common.release" . }} |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 43 | spec: |
Dominik Mizyn | b8c44b4 | 2020-04-21 10:48:27 +0200 | [diff] [blame] | 44 | initContainers: |
| 45 | - command: |
| 46 | - sh |
| 47 | args: |
| 48 | - -c |
Taka Cho | ebd6295 | 2020-10-08 13:50:09 -0400 | [diff] [blame] | 49 | - "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] | 50 | env: |
| 51 | - name: TRUSTSTORE_PASSWORD |
| 52 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "truststore-pass" "key" "password") | indent 10 }} |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 53 | - name: KEYSTORE_PASSWORD |
| 54 | {{- 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] | 55 | - name: RESTSERVER_USER |
| 56 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "login") | indent 10 }} |
| 57 | - name: RESTSERVER_PASSWORD |
| 58 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "restserver-creds" "key" "password") | indent 10 }} |
| 59 | volumeMounts: |
| 60 | - mountPath: /config-input |
| 61 | name: apexconfig-input |
| 62 | - mountPath: /config |
| 63 | name: apexconfig |
| 64 | image: "{{ .Values.global.envsubstImage }}" |
| 65 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 66 | name: {{ include "common.name" . }}-update-config |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 67 | {{ include "common.certInitializer.initContainer" . | indent 6 }} |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 68 | containers: |
| 69 | - name: {{ include "common.name" . }} |
| 70 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 71 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 72 | command: ["bash","-c"] |
| 73 | args: ["if [ -f {{ .Values.certInitializer.credsPath }}/.ci ]; then \ |
| 74 | source {{ .Values.certInitializer.credsPath }}/.ci; fi;\ |
| 75 | /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] | 76 | ports: |
| 77 | - containerPort: {{ .Values.service.externalPort }} |
| 78 | {{- if eq .Values.liveness.enabled true }} |
| 79 | livenessProbe: |
| 80 | tcpSocket: |
| 81 | port: {{ .Values.service.externalPort }} |
| 82 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 83 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 84 | {{- end }} |
| 85 | readinessProbe: |
| 86 | tcpSocket: |
| 87 | port: {{ .Values.service.externalPort }} |
| 88 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 89 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 90 | env: |
| 91 | - name: REPLICAS |
| 92 | value: "{{ .Values.replicaCount }}" |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 93 | {{- if not .Values.global.aafEnabled }} |
| 94 | - name: KEYSTORE_PASSWORD |
| 95 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "keystore-pass" "key" "password") | indent 12 }} |
| 96 | - name: TRUSTSTORE_PASSWORD |
| 97 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "truststore-pass" "key" "password") | indent 12 }} |
| 98 | {{- end }} |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 99 | volumeMounts: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 100 | {{ include "common.certInitializer.volumeMount" . | indent 10 }} |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 101 | - mountPath: /etc/localtime |
| 102 | name: localtime |
| 103 | readOnly: true |
| 104 | - mountPath: /var/log/onap |
| 105 | name: policy-logs |
mmis | 0d92fb7 | 2018-09-19 12:44:35 +0100 | [diff] [blame] | 106 | - mountPath: /home/apexuser/config |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 107 | name: apexconfig |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 108 | resources: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 109 | {{ include "common.resources" . }} |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 110 | {{- if .Values.nodeSelector }} |
| 111 | nodeSelector: |
| 112 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 113 | {{- end -}} |
| 114 | {{- if .Values.affinity }} |
| 115 | affinity: |
| 116 | {{ toYaml .Values.affinity | indent 10 }} |
| 117 | {{- end }} |
| 118 | volumes: |
jhh | d425867 | 2020-08-09 12:08:08 -0500 | [diff] [blame] | 119 | {{ include "common.certInitializer.volumes" . | indent 8 }} |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 120 | - name: localtime |
| 121 | hostPath: |
| 122 | path: /etc/localtime |
| 123 | - name: policy-logs |
| 124 | emptyDir: {} |
Dominik Mizyn | b8c44b4 | 2020-04-21 10:48:27 +0200 | [diff] [blame] | 125 | - name: apexconfig-input |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 126 | configMap: |
| 127 | name: {{ include "common.fullname" . }}-configmap |
mmis | 0d92fb7 | 2018-09-19 12:44:35 +0100 | [diff] [blame] | 128 | defaultMode: 0755 |
Dominik Mizyn | b8c44b4 | 2020-04-21 10:48:27 +0200 | [diff] [blame] | 129 | - name: apexconfig |
| 130 | emptyDir: |
| 131 | medium: Memory |
mmis | 9597113 | 2018-07-17 00:13:13 +0100 | [diff] [blame] | 132 | imagePullSecrets: |
| 133 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |