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 | |
| 16 | apiVersion: extensions/v1beta1 |
| 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 }} |
| 28 | template: |
| 29 | metadata: |
| 30 | labels: |
| 31 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 32 | release: {{ include "common.release" . }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 33 | spec: |
Kiran Kamineni | 5586906 | 2018-08-02 17:19:27 -0700 | [diff] [blame] | 34 | initContainers: |
ChrisC | ec86a53 | 2020-03-19 15:53:31 -0500 | [diff] [blame] | 35 | - name: fix-permission |
| 36 | command: |
| 37 | - /bin/sh |
| 38 | args: |
| 39 | - -c |
| 40 | - | |
| 41 | chmod -R 775 /sms/auth |
| 42 | chown -R 1000:1000 /sms/auth |
| 43 | image: "{{ .Values.global.busyboxRepository }}/{{ .Values.global.busyboxImage }}" |
| 44 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 45 | volumeMounts: |
| 46 | - mountPath: /sms/auth |
| 47 | name: {{ include "common.fullname" . }}-auth |
| 48 | - name: {{ include "common.name" . }}-readiness |
| 49 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 50 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 51 | command: |
| 52 | - /root/ready.py |
| 53 | args: |
| 54 | - --container-name |
| 55 | - "aaf-sms-vault" |
| 56 | - --container-name |
| 57 | - "aaf-sms-vault-backend" |
| 58 | env: |
| 59 | - name: NAMESPACE |
| 60 | valueFrom: |
| 61 | fieldRef: |
| 62 | apiVersion: v1 |
| 63 | fieldPath: metadata.namespace |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 64 | containers: |
Kiran Kamineni | e4e81e7 | 2018-04-09 10:14:32 -0700 | [diff] [blame] | 65 | - image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
dkamdocs | 6ad3a1c | 2018-12-21 09:25:53 +0000 | [diff] [blame] | 66 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Kiran Kamineni | 5586906 | 2018-08-02 17:19:27 -0700 | [diff] [blame] | 67 | name: {{ include "common.name" . }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 68 | command: ["/sms/bin/sms"] |
| 69 | workingDir: /sms/ |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 70 | ports: |
| 71 | - containerPort: {{ .Values.service.internalPort }} |
| 72 | {{- if eq .Values.liveness.enabled true }} |
| 73 | livenessProbe: |
Kiran Kamineni | c808c9a | 2018-05-14 16:59:55 -0700 | [diff] [blame] | 74 | httpGet: |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 75 | port: {{ .Values.service.internalPort }} |
Kiran Kamineni | c808c9a | 2018-05-14 16:59:55 -0700 | [diff] [blame] | 76 | scheme: HTTPS |
| 77 | path: /v1/sms/quorum/status |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 78 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 79 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 80 | {{ end -}} |
| 81 | readinessProbe: |
Kiran Kamineni | c808c9a | 2018-05-14 16:59:55 -0700 | [diff] [blame] | 82 | httpGet: |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 83 | port: {{ .Values.service.internalPort }} |
Kiran Kamineni | c808c9a | 2018-05-14 16:59:55 -0700 | [diff] [blame] | 84 | scheme: HTTPS |
| 85 | path: /v1/sms/quorum/status |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 86 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 87 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 88 | volumeMounts: |
| 89 | - mountPath: /etc/localtime |
| 90 | name: localtime |
| 91 | readOnly: true |
| 92 | - mountPath: /sms/smsconfig.json |
| 93 | name: {{ include "common.name" .}} |
| 94 | subPath: smsconfig.json |
Kiran Kamineni | e4e81e7 | 2018-04-09 10:14:32 -0700 | [diff] [blame] | 95 | - mountPath: /sms/auth |
| 96 | name: {{ include "common.fullname" . }}-auth |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 97 | resources: |
dsingh.278 | 64a34bf | 2018-09-21 05:11:00 -0400 | [diff] [blame] | 98 | {{ include "common.resources" . | indent 10 }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 99 | {{- if .Values.nodeSelector }} |
| 100 | nodeSelector: |
| 101 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 102 | {{- end -}} |
| 103 | {{- if .Values.affinity }} |
| 104 | affinity: |
| 105 | {{ toYaml .Values.affinity | indent 10 }} |
| 106 | {{- end }} |
| 107 | volumes: |
| 108 | - name: localtime |
| 109 | hostPath: |
| 110 | path: /etc/localtime |
| 111 | - name : {{ include "common.name" . }} |
| 112 | configMap: |
| 113 | name: {{ include "common.fullname" . }} |
Kiran Kamineni | e4e81e7 | 2018-04-09 10:14:32 -0700 | [diff] [blame] | 114 | - name: {{ include "common.fullname" . }}-auth |
Sylvain Desbureaux | 7a23575 | 2019-11-28 15:01:45 +0100 | [diff] [blame] | 115 | {{- if .Values.persistence.enabled }} |
Kiran Kamineni | e4e81e7 | 2018-04-09 10:14:32 -0700 | [diff] [blame] | 116 | persistentVolumeClaim: |
| 117 | claimName: {{ include "common.fullname" . }} |
Sylvain Desbureaux | 7a23575 | 2019-11-28 15:01:45 +0100 | [diff] [blame] | 118 | {{- else }} |
| 119 | emptyDir: {} |
| 120 | {{- end }} |
Kiran Kamineni | 3964872 | 2018-03-21 14:58:11 -0700 | [diff] [blame] | 121 | imagePullSecrets: |
| 122 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |