blob: cfe54cf07bacecbb941f10f929026238275372c6 [file] [log] [blame]
Jakub Latuseka6d04ad2020-10-21 13:26:45 +02001{{/*
Kiran Kamineni39648722018-03-21 14:58:11 -07002# Copyright 2018 Intel Corporation, Inc
ChrisCec86a532020-03-19 15:53:31 -05003# Modifications © 2020 AT&T
Kiran Kamineni39648722018-03-21 14:58:11 -07004#
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 Latuseka6d04ad2020-10-21 13:26:45 +020016*/}}
Kiran Kamineni39648722018-03-21 14:58:11 -070017
Grzegorz-Lisde425ce2020-07-23 15:05:50 +020018apiVersion: apps/v1
Kiran Kamineni39648722018-03-21 14:58:11 -070019kind: Deployment
20metadata:
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 Opasiak137d7cc2020-01-24 23:49:11 +010026 release: {{ include "common.release" . }}
Kiran Kamineni39648722018-03-21 14:58:11 -070027 heritage: {{ .Release.Service }}
28spec:
29 replicas: {{ .Values.replicaCount }}
Grzegorz-Lisde425ce2020-07-23 15:05:50 +020030 selector:
31 matchLabels:
32 app: {{ include "common.name" . }}
Kiran Kamineni39648722018-03-21 14:58:11 -070033 template:
34 metadata:
35 labels:
36 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010037 release: {{ include "common.release" . }}
Kiran Kamineni39648722018-03-21 14:58:11 -070038 spec:
Sylvain Desbureaux0de302a2020-06-05 15:19:22 +020039 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 Desbureaux0dfa3872020-11-21 21:29:17 +010050 image: {{ include "repositoryGenerator.image.busybox" . }}
Sylvain Desbureaux0de302a2020-06-05 15:19:22 +020051 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
ChrisCec86a532020-03-19 15:53:31 -050058 command:
59 - /bin/sh
60 args:
61 - -c
62 - |
63 chmod -R 775 /sms/auth
64 chown -R 1000:1000 /sms/auth
Sylvain Desbureaux0dfa3872020-11-21 21:29:17 +010065 image: {{ include "repositoryGenerator.image.busybox" . }}
ChrisCec86a532020-03-19 15:53:31 -050066 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 Desbureaux0dfa3872020-11-21 21:29:17 +010071 image: {{ include "repositoryGenerator.image.readiness" . }}
ChrisCec86a532020-03-19 15:53:31 -050072 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
73 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020074 - /app/ready.py
ChrisCec86a532020-03-19 15:53:31 -050075 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 Kamineni39648722018-03-21 14:58:11 -070086 containers:
Sylvain Desbureaux0dfa3872020-11-21 21:29:17 +010087 - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
dkamdocs6ad3a1c2018-12-21 09:25:53 +000088 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Kiran Kamineni55869062018-08-02 17:19:27 -070089 name: {{ include "common.name" . }}
Kiran Kamineni39648722018-03-21 14:58:11 -070090 command: ["/sms/bin/sms"]
91 workingDir: /sms/
Kiran Kamineni39648722018-03-21 14:58:11 -070092 ports:
93 - containerPort: {{ .Values.service.internalPort }}
94 {{- if eq .Values.liveness.enabled true }}
95 livenessProbe:
Kiran Kaminenic808c9a2018-05-14 16:59:55 -070096 httpGet:
Kiran Kamineni39648722018-03-21 14:58:11 -070097 port: {{ .Values.service.internalPort }}
Kiran Kaminenic808c9a2018-05-14 16:59:55 -070098 scheme: HTTPS
99 path: /v1/sms/quorum/status
Kiran Kamineni39648722018-03-21 14:58:11 -0700100 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
101 periodSeconds: {{ .Values.liveness.periodSeconds }}
102 {{ end -}}
103 readinessProbe:
Kiran Kaminenic808c9a2018-05-14 16:59:55 -0700104 httpGet:
Kiran Kamineni39648722018-03-21 14:58:11 -0700105 port: {{ .Values.service.internalPort }}
Kiran Kaminenic808c9a2018-05-14 16:59:55 -0700106 scheme: HTTPS
107 path: /v1/sms/quorum/status
Kiran Kamineni39648722018-03-21 14:58:11 -0700108 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
109 periodSeconds: {{ .Values.readiness.periodSeconds }}
Sylvain Desbureaux0de302a2020-06-05 15:19:22 +0200110 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
Kiran Kamineni39648722018-03-21 14:58:11 -0700111 - mountPath: /etc/localtime
112 name: localtime
113 readOnly: true
114 - mountPath: /sms/smsconfig.json
115 name: {{ include "common.name" .}}
116 subPath: smsconfig.json
Kiran Kaminenie4e81e72018-04-09 10:14:32 -0700117 - mountPath: /sms/auth
118 name: {{ include "common.fullname" . }}-auth
Kiran Kamineni39648722018-03-21 14:58:11 -0700119 resources:
dsingh.27864a34bf2018-09-21 05:11:00 -0400120{{ include "common.resources" . | indent 10 }}
Kiran Kamineni39648722018-03-21 14:58:11 -0700121 {{- if .Values.nodeSelector }}
122 nodeSelector:
123{{ toYaml .Values.nodeSelector | indent 10 }}
124 {{- end -}}
125 {{- if .Values.affinity }}
126 affinity:
127{{ toYaml .Values.affinity | indent 10 }}
128 {{- end }}
Sylvain Desbureaux0de302a2020-06-05 15:19:22 +0200129 volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
Kiran Kamineni39648722018-03-21 14:58:11 -0700130 - name: localtime
131 hostPath:
132 path: /etc/localtime
133 - name : {{ include "common.name" . }}
134 configMap:
135 name: {{ include "common.fullname" . }}
Sylvain Desbureaux0de302a2020-06-05 15:19:22 +0200136 {{- if .Values.global.aafEnabled }}
137 - name: {{ include "common.fullname" . }}-int-certs
138 secret:
139 secretName: {{ include "common.fullname" . }}-int-certs
140 {{- end }}
Kiran Kaminenie4e81e72018-04-09 10:14:32 -0700141 - name: {{ include "common.fullname" . }}-auth
Sylvain Desbureaux7a235752019-11-28 15:01:45 +0100142 {{- if .Values.persistence.enabled }}
Kiran Kaminenie4e81e72018-04-09 10:14:32 -0700143 persistentVolumeClaim:
144 claimName: {{ include "common.fullname" . }}
Sylvain Desbureaux7a235752019-11-28 15:01:45 +0100145 {{- else }}
146 emptyDir: {}
147 {{- end }}
Kiran Kamineni39648722018-03-21 14:58:11 -0700148 imagePullSecrets:
149 - name: "{{ include "common.namespace" . }}-docker-registry-key"