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