blob: bb409f33c5e1c0b31612ac70fe5bf1cd6e5de1ae [file] [log] [blame]
Kiran Kamineni39648722018-03-21 14:58:11 -07001# Copyright 2018 Intel Corporation, Inc
ChrisCec86a532020-03-19 15:53:31 -05002# Modifications © 2020 AT&T
Kiran Kamineni39648722018-03-21 14:58:11 -07003#
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
16apiVersion: extensions/v1beta1
17kind: Deployment
18metadata:
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 Opasiak137d7cc2020-01-24 23:49:11 +010024 release: {{ include "common.release" . }}
Kiran Kamineni39648722018-03-21 14:58:11 -070025 heritage: {{ .Release.Service }}
26spec:
27 replicas: {{ .Values.replicaCount }}
28 template:
29 metadata:
30 labels:
31 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010032 release: {{ include "common.release" . }}
Kiran Kamineni39648722018-03-21 14:58:11 -070033 spec:
Sylvain Desbureaux0de302a2020-06-05 15:19:22 +020034 initContainers: {{ include "common.certInitializer.initContainer" . | nindent 8 }}
35 # Currently intermediate certificate is not given by AAF CM so we need
36 # to give it "by hand"
37 {{- if .Values.global.aafEnabled }}
38 - name: {{ include "common.fullname" . }}-add-intermediate-cert
39 command:
40 - /bin/sh
41 args:
42 - -c
43 - |
44 cat /int-certs/intermediate_root_ca.pem >> {{ .Values.certInitializer.mountPath }}/local/org.onap.aaf-sms.crt
45 image: "{{ .Values.global.busyboxRepository }}/{{ .Values.global.busyboxImage }}"
46 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
47 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 12 }}
48 - mountPath: /int-certs
49 name: {{ include "common.fullname" . }}-int-certs
50 readOnly: true
51 {{- end }}
52 - name: {{ include "common.fullname" . }}-fix-permission
ChrisCec86a532020-03-19 15:53:31 -050053 command:
54 - /bin/sh
55 args:
56 - -c
57 - |
58 chmod -R 775 /sms/auth
59 chown -R 1000:1000 /sms/auth
60 image: "{{ .Values.global.busyboxRepository }}/{{ .Values.global.busyboxImage }}"
61 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
62 volumeMounts:
63 - mountPath: /sms/auth
64 name: {{ include "common.fullname" . }}-auth
65 - name: {{ include "common.name" . }}-readiness
66 image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
67 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
68 command:
69 - /root/ready.py
70 args:
71 - --container-name
72 - "aaf-sms-vault"
73 - --container-name
74 - "aaf-sms-vault-backend"
75 env:
76 - name: NAMESPACE
77 valueFrom:
78 fieldRef:
79 apiVersion: v1
80 fieldPath: metadata.namespace
Kiran Kamineni39648722018-03-21 14:58:11 -070081 containers:
Kiran Kaminenie4e81e72018-04-09 10:14:32 -070082 - image: "{{ include "common.repository" . }}/{{ .Values.image }}"
dkamdocs6ad3a1c2018-12-21 09:25:53 +000083 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Kiran Kamineni55869062018-08-02 17:19:27 -070084 name: {{ include "common.name" . }}
Kiran Kamineni39648722018-03-21 14:58:11 -070085 command: ["/sms/bin/sms"]
86 workingDir: /sms/
Kiran Kamineni39648722018-03-21 14:58:11 -070087 ports:
88 - containerPort: {{ .Values.service.internalPort }}
89 {{- if eq .Values.liveness.enabled true }}
90 livenessProbe:
Kiran Kaminenic808c9a2018-05-14 16:59:55 -070091 httpGet:
Kiran Kamineni39648722018-03-21 14:58:11 -070092 port: {{ .Values.service.internalPort }}
Kiran Kaminenic808c9a2018-05-14 16:59:55 -070093 scheme: HTTPS
94 path: /v1/sms/quorum/status
Kiran Kamineni39648722018-03-21 14:58:11 -070095 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
96 periodSeconds: {{ .Values.liveness.periodSeconds }}
97 {{ end -}}
98 readinessProbe:
Kiran Kaminenic808c9a2018-05-14 16:59:55 -070099 httpGet:
Kiran Kamineni39648722018-03-21 14:58:11 -0700100 port: {{ .Values.service.internalPort }}
Kiran Kaminenic808c9a2018-05-14 16:59:55 -0700101 scheme: HTTPS
102 path: /v1/sms/quorum/status
Kiran Kamineni39648722018-03-21 14:58:11 -0700103 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
104 periodSeconds: {{ .Values.readiness.periodSeconds }}
Sylvain Desbureaux0de302a2020-06-05 15:19:22 +0200105 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
Kiran Kamineni39648722018-03-21 14:58:11 -0700106 - mountPath: /etc/localtime
107 name: localtime
108 readOnly: true
109 - mountPath: /sms/smsconfig.json
110 name: {{ include "common.name" .}}
111 subPath: smsconfig.json
Kiran Kaminenie4e81e72018-04-09 10:14:32 -0700112 - mountPath: /sms/auth
113 name: {{ include "common.fullname" . }}-auth
Kiran Kamineni39648722018-03-21 14:58:11 -0700114 resources:
dsingh.27864a34bf2018-09-21 05:11:00 -0400115{{ include "common.resources" . | indent 10 }}
Kiran Kamineni39648722018-03-21 14:58:11 -0700116 {{- if .Values.nodeSelector }}
117 nodeSelector:
118{{ toYaml .Values.nodeSelector | indent 10 }}
119 {{- end -}}
120 {{- if .Values.affinity }}
121 affinity:
122{{ toYaml .Values.affinity | indent 10 }}
123 {{- end }}
Sylvain Desbureaux0de302a2020-06-05 15:19:22 +0200124 volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
Kiran Kamineni39648722018-03-21 14:58:11 -0700125 - name: localtime
126 hostPath:
127 path: /etc/localtime
128 - name : {{ include "common.name" . }}
129 configMap:
130 name: {{ include "common.fullname" . }}
Sylvain Desbureaux0de302a2020-06-05 15:19:22 +0200131 {{- if .Values.global.aafEnabled }}
132 - name: {{ include "common.fullname" . }}-int-certs
133 secret:
134 secretName: {{ include "common.fullname" . }}-int-certs
135 {{- end }}
Kiran Kaminenie4e81e72018-04-09 10:14:32 -0700136 - name: {{ include "common.fullname" . }}-auth
Sylvain Desbureaux7a235752019-11-28 15:01:45 +0100137 {{- if .Values.persistence.enabled }}
Kiran Kaminenie4e81e72018-04-09 10:14:32 -0700138 persistentVolumeClaim:
139 claimName: {{ include "common.fullname" . }}
Sylvain Desbureaux7a235752019-11-28 15:01:45 +0100140 {{- else }}
141 emptyDir: {}
142 {{- end }}
Kiran Kamineni39648722018-03-21 14:58:11 -0700143 imagePullSecrets:
144 - name: "{{ include "common.namespace" . }}-docker-registry-key"