Jakub Latusek | a6d04ad | 2020-10-21 13:26:45 +0200 | [diff] [blame] | 1 | {{/* |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 2 | # Copyright 2018 Intel Corporation, Inc |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 3 | # Modifications © 2020 AT&T |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [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. |
Jakub Latusek | a6d04ad | 2020-10-21 13:26:45 +0200 | [diff] [blame] | 16 | */}} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 17 | |
Grzegorz-Lis | de425ce | 2020-07-23 15:05:50 +0200 | [diff] [blame] | 18 | apiVersion: apps/v1 |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 19 | kind: Deployment |
| 20 | metadata: |
| 21 | name: {{ include "common.fullname" . }} |
| 22 | namespace: {{ include "common.namespace" . }} |
| 23 | labels: |
| 24 | app: {{ include "common.name" . }} |
| 25 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 26 | release: {{ include "common.release" . }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 27 | heritage: {{ .Release.Service }} |
| 28 | spec: |
| 29 | replicas: {{ .Values.replicaCount }} |
Grzegorz-Lis | de425ce | 2020-07-23 15:05:50 +0200 | [diff] [blame] | 30 | selector: |
| 31 | matchLabels: |
| 32 | app: {{ include "common.name" . }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 33 | template: |
| 34 | metadata: |
| 35 | labels: |
| 36 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 37 | release: {{ include "common.release" . }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 38 | spec: |
Sylvain Desbureaux | 0de302a | 2020-06-05 15:19:22 +0200 | [diff] [blame] | 39 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 8 }} |
| 40 | # Currently intermediate certificate is not given by AAF CM so we need |
| 41 | # to give it "by hand" |
| 42 | {{- if .Values.global.aafEnabled }} |
| 43 | - name: {{ include "common.fullname" . }}-add-intermediate-cert |
| 44 | command: |
| 45 | - /bin/sh |
| 46 | args: |
| 47 | - -c |
| 48 | - | |
| 49 | cat /int-certs/intermediate_root_ca.pem >> {{ .Values.certInitializer.mountPath }}/local/org.onap.aaf-sms.crt |
Sylvain Desbureaux | 0dfa387 | 2020-11-21 21:29:17 +0100 | [diff] [blame] | 50 | image: {{ include "repositoryGenerator.image.busybox" . }} |
Sylvain Desbureaux | 0de302a | 2020-06-05 15:19:22 +0200 | [diff] [blame] | 51 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 52 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 12 }} |
| 53 | - mountPath: /int-certs |
| 54 | name: {{ include "common.fullname" . }}-int-certs |
| 55 | readOnly: true |
| 56 | {{- end }} |
| 57 | - name: {{ include "common.fullname" . }}-fix-permission |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 58 | command: |
| 59 | - /bin/sh |
| 60 | args: |
| 61 | - -c |
| 62 | - | |
| 63 | chmod -R 775 /sms/auth |
| 64 | chown -R 1000:1000 /sms/auth |
Sylvain Desbureaux | 0dfa387 | 2020-11-21 21:29:17 +0100 | [diff] [blame] | 65 | image: {{ include "repositoryGenerator.image.busybox" . }} |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 66 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 67 | volumeMounts: |
| 68 | - mountPath: /sms/auth |
| 69 | name: {{ include "common.fullname" . }}-auth |
| 70 | - name: {{ include "common.name" . }}-readiness |
Sylvain Desbureaux | 0dfa387 | 2020-11-21 21:29:17 +0100 | [diff] [blame] | 71 | image: {{ include "repositoryGenerator.image.readiness" . }} |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 72 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 73 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 74 | - /app/ready.py |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 75 | args: |
| 76 | - --container-name |
| 77 | - "aaf-sms-vault" |
| 78 | - --container-name |
| 79 | - "aaf-sms-vault-backend" |
| 80 | env: |
| 81 | - name: NAMESPACE |
| 82 | valueFrom: |
| 83 | fieldRef: |
| 84 | apiVersion: v1 |
| 85 | fieldPath: metadata.namespace |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 86 | containers: |
Sylvain Desbureaux | 0dfa387 | 2020-11-21 21:29:17 +0100 | [diff] [blame] | 87 | - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
dkamdocs | 6ad3a1c | 2018-12-21 09:25:53 +0000 | [diff] [blame] | 88 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Kiran Kamineni | 5586906 | 2018-08-02 17:19:27 -0700 | [diff] [blame] | 89 | name: {{ include "common.name" . }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 90 | command: ["/sms/bin/sms"] |
| 91 | workingDir: /sms/ |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 92 | ports: |
| 93 | - containerPort: {{ .Values.service.internalPort }} |
| 94 | {{- if eq .Values.liveness.enabled true }} |
| 95 | livenessProbe: |
Kiran Kamineni | c808c9a | 2018-05-14 16:59:55 -0700 | [diff] [blame] | 96 | httpGet: |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 97 | port: {{ .Values.service.internalPort }} |
Kiran Kamineni | c808c9a | 2018-05-14 16:59:55 -0700 | [diff] [blame] | 98 | scheme: HTTPS |
| 99 | path: /v1/sms/quorum/status |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 100 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 101 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 102 | {{ end -}} |
| 103 | readinessProbe: |
Kiran Kamineni | c808c9a | 2018-05-14 16:59:55 -0700 | [diff] [blame] | 104 | httpGet: |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 105 | port: {{ .Values.service.internalPort }} |
Kiran Kamineni | c808c9a | 2018-05-14 16:59:55 -0700 | [diff] [blame] | 106 | scheme: HTTPS |
| 107 | path: /v1/sms/quorum/status |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 108 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 109 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Sylvain Desbureaux | 0de302a | 2020-06-05 15:19:22 +0200 | [diff] [blame] | 110 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 111 | - mountPath: /etc/localtime |
| 112 | name: localtime |
| 113 | readOnly: true |
| 114 | - mountPath: /sms/smsconfig.json |
| 115 | name: {{ include "common.name" .}} |
| 116 | subPath: smsconfig.json |
Kiran Kamineni | e4e81e7 | 2018-04-09 10:14:32 -0700 | [diff] [blame] | 117 | - mountPath: /sms/auth |
| 118 | name: {{ include "common.fullname" . }}-auth |
miroslavmasaryk | a7ac7f0 | 2023-03-01 14:12:26 +0100 | [diff] [blame] | 119 | resources: {{ include "common.resources" . | nindent 10 }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 120 | {{- if .Values.nodeSelector }} |
| 121 | nodeSelector: |
| 122 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 123 | {{- end -}} |
| 124 | {{- if .Values.affinity }} |
| 125 | affinity: |
| 126 | {{ toYaml .Values.affinity | indent 10 }} |
| 127 | {{- end }} |
Sylvain Desbureaux | 0de302a | 2020-06-05 15:19:22 +0200 | [diff] [blame] | 128 | volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 129 | - name: localtime |
| 130 | hostPath: |
| 131 | path: /etc/localtime |
| 132 | - name : {{ include "common.name" . }} |
| 133 | configMap: |
| 134 | name: {{ include "common.fullname" . }} |
Sylvain Desbureaux | 0de302a | 2020-06-05 15:19:22 +0200 | [diff] [blame] | 135 | {{- if .Values.global.aafEnabled }} |
| 136 | - name: {{ include "common.fullname" . }}-int-certs |
| 137 | secret: |
| 138 | secretName: {{ include "common.fullname" . }}-int-certs |
| 139 | {{- end }} |
Kiran Kamineni | e4e81e7 | 2018-04-09 10:14:32 -0700 | [diff] [blame] | 140 | - name: {{ include "common.fullname" . }}-auth |
Sylvain Desbureaux | 7a23575 | 2019-11-28 15:01:45 +0100 | [diff] [blame] | 141 | {{- if .Values.persistence.enabled }} |
Kiran Kamineni | e4e81e7 | 2018-04-09 10:14:32 -0700 | [diff] [blame] | 142 | persistentVolumeClaim: |
| 143 | claimName: {{ include "common.fullname" . }} |
Sylvain Desbureaux | 7a23575 | 2019-11-28 15:01:45 +0100 | [diff] [blame] | 144 | {{- else }} |
| 145 | emptyDir: {} |
| 146 | {{- end }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 147 | imagePullSecrets: |
| 148 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |