Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 1 | # Copyright 2018 Intel Corporation, Inc |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 2 | # Modifications © 2020 AT&T |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
Grzegorz-Lis | de425ce | 2020-07-23 15:05:50 +0200 | [diff] [blame] | 16 | apiVersion: apps/v1 |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 17 | kind: Deployment |
| 18 | metadata: |
| 19 | name: {{ include "common.fullname" . }} |
| 20 | namespace: {{ include "common.namespace" . }} |
| 21 | labels: |
| 22 | app: {{ include "common.name" . }} |
| 23 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 24 | release: {{ include "common.release" . }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 25 | heritage: {{ .Release.Service }} |
| 26 | spec: |
| 27 | replicas: {{ .Values.replicaCount }} |
Grzegorz-Lis | de425ce | 2020-07-23 15:05:50 +0200 | [diff] [blame] | 28 | selector: |
| 29 | matchLabels: |
| 30 | app: {{ include "common.name" . }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 31 | template: |
| 32 | metadata: |
| 33 | labels: |
| 34 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 35 | release: {{ include "common.release" . }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 36 | spec: |
Sylvain Desbureaux | 0de302a | 2020-06-05 15:19:22 +0200 | [diff] [blame] | 37 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 8 }} |
| 38 | # Currently intermediate certificate is not given by AAF CM so we need |
| 39 | # to give it "by hand" |
| 40 | {{- if .Values.global.aafEnabled }} |
| 41 | - name: {{ include "common.fullname" . }}-add-intermediate-cert |
| 42 | command: |
| 43 | - /bin/sh |
| 44 | args: |
| 45 | - -c |
| 46 | - | |
| 47 | cat /int-certs/intermediate_root_ca.pem >> {{ .Values.certInitializer.mountPath }}/local/org.onap.aaf-sms.crt |
| 48 | image: "{{ .Values.global.busyboxRepository }}/{{ .Values.global.busyboxImage }}" |
| 49 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 50 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 12 }} |
| 51 | - mountPath: /int-certs |
| 52 | name: {{ include "common.fullname" . }}-int-certs |
| 53 | readOnly: true |
| 54 | {{- end }} |
| 55 | - name: {{ include "common.fullname" . }}-fix-permission |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 56 | command: |
| 57 | - /bin/sh |
| 58 | args: |
| 59 | - -c |
| 60 | - | |
| 61 | chmod -R 775 /sms/auth |
| 62 | chown -R 1000:1000 /sms/auth |
| 63 | image: "{{ .Values.global.busyboxRepository }}/{{ .Values.global.busyboxImage }}" |
| 64 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 65 | volumeMounts: |
| 66 | - mountPath: /sms/auth |
| 67 | name: {{ include "common.fullname" . }}-auth |
| 68 | - name: {{ include "common.name" . }}-readiness |
| 69 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 70 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 71 | command: |
| 72 | - /root/ready.py |
| 73 | args: |
| 74 | - --container-name |
| 75 | - "aaf-sms-vault" |
| 76 | - --container-name |
| 77 | - "aaf-sms-vault-backend" |
| 78 | env: |
| 79 | - name: NAMESPACE |
| 80 | valueFrom: |
| 81 | fieldRef: |
| 82 | apiVersion: v1 |
| 83 | fieldPath: metadata.namespace |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 84 | containers: |
Kiran Kamineni | e4e81e7 | 2018-04-09 10:14:32 -0700 | [diff] [blame] | 85 | - image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
dkamdocs | 6ad3a1c | 2018-12-21 09:25:53 +0000 | [diff] [blame] | 86 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Kiran Kamineni | 5586906 | 2018-08-02 17:19:27 -0700 | [diff] [blame] | 87 | name: {{ include "common.name" . }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 88 | command: ["/sms/bin/sms"] |
| 89 | workingDir: /sms/ |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 90 | ports: |
| 91 | - containerPort: {{ .Values.service.internalPort }} |
| 92 | {{- if eq .Values.liveness.enabled true }} |
| 93 | livenessProbe: |
Kiran Kamineni | c808c9a | 2018-05-14 16:59:55 -0700 | [diff] [blame] | 94 | httpGet: |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 95 | port: {{ .Values.service.internalPort }} |
Kiran Kamineni | c808c9a | 2018-05-14 16:59:55 -0700 | [diff] [blame] | 96 | scheme: HTTPS |
| 97 | path: /v1/sms/quorum/status |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 98 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 99 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 100 | {{ end -}} |
| 101 | readinessProbe: |
Kiran Kamineni | c808c9a | 2018-05-14 16:59:55 -0700 | [diff] [blame] | 102 | httpGet: |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 103 | port: {{ .Values.service.internalPort }} |
Kiran Kamineni | c808c9a | 2018-05-14 16:59:55 -0700 | [diff] [blame] | 104 | scheme: HTTPS |
| 105 | path: /v1/sms/quorum/status |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 106 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 107 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Sylvain Desbureaux | 0de302a | 2020-06-05 15:19:22 +0200 | [diff] [blame] | 108 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 109 | - mountPath: /etc/localtime |
| 110 | name: localtime |
| 111 | readOnly: true |
| 112 | - mountPath: /sms/smsconfig.json |
| 113 | name: {{ include "common.name" .}} |
| 114 | subPath: smsconfig.json |
Kiran Kamineni | e4e81e7 | 2018-04-09 10:14:32 -0700 | [diff] [blame] | 115 | - mountPath: /sms/auth |
| 116 | name: {{ include "common.fullname" . }}-auth |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 117 | resources: |
dsingh.278 | 64a34bf | 2018-09-21 05:11:00 -0400 | [diff] [blame] | 118 | {{ include "common.resources" . | indent 10 }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 119 | {{- if .Values.nodeSelector }} |
| 120 | nodeSelector: |
| 121 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 122 | {{- end -}} |
| 123 | {{- if .Values.affinity }} |
| 124 | affinity: |
| 125 | {{ toYaml .Values.affinity | indent 10 }} |
| 126 | {{- end }} |
Sylvain Desbureaux | 0de302a | 2020-06-05 15:19:22 +0200 | [diff] [blame] | 127 | volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 128 | - name: localtime |
| 129 | hostPath: |
| 130 | path: /etc/localtime |
| 131 | - name : {{ include "common.name" . }} |
| 132 | configMap: |
| 133 | name: {{ include "common.fullname" . }} |
Sylvain Desbureaux | 0de302a | 2020-06-05 15:19:22 +0200 | [diff] [blame] | 134 | {{- if .Values.global.aafEnabled }} |
| 135 | - name: {{ include "common.fullname" . }}-int-certs |
| 136 | secret: |
| 137 | secretName: {{ include "common.fullname" . }}-int-certs |
| 138 | {{- end }} |
Kiran Kamineni | e4e81e7 | 2018-04-09 10:14:32 -0700 | [diff] [blame] | 139 | - name: {{ include "common.fullname" . }}-auth |
Sylvain Desbureaux | 7a23575 | 2019-11-28 15:01:45 +0100 | [diff] [blame] | 140 | {{- if .Values.persistence.enabled }} |
Kiran Kamineni | e4e81e7 | 2018-04-09 10:14:32 -0700 | [diff] [blame] | 141 | persistentVolumeClaim: |
| 142 | claimName: {{ include "common.fullname" . }} |
Sylvain Desbureaux | 7a23575 | 2019-11-28 15:01:45 +0100 | [diff] [blame] | 143 | {{- else }} |
| 144 | emptyDir: {} |
| 145 | {{- end }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 146 | imagePullSecrets: |
| 147 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |