Extend K8S and RIC installation instructions
[it/dep.git] / ric-aux / 80-Auxiliary-Functions / helm / aaf / charts / aaf-sms / templates / deployment.yaml
1 # Copyright 2018 Intel Corporation, Inc
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 #       http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 apiVersion: apps/v1
16 kind: Deployment
17 metadata:
18   name: {{ include "common.fullname" . }}
19   namespace: {{ include "common.namespace" . }}
20   labels:
21     app: {{ include "common.name" . }}
22     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
23     release: {{ .Release.Name }}
24     heritage: {{ .Release.Service }}
25 spec:
26   replicas: {{ .Values.replicaCount }}
27   selector:
28     matchLabels:
29       app: {{ include "common.name" . }}
30       release: {{ .Release.Name }}
31   template:
32     metadata:
33       labels:
34         app: {{ include "common.name" . }}
35         release: {{ .Release.Name }}
36     spec:
37       initContainers:
38       - image:  "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
39         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
40         name: {{ include "common.name" . }}-readiness
41         command: ["/bin/sh", "-c"]
42         args: ["sed -i s/client.AppsV1beta1Api/client.AppsV1Api/g /root/ready.py && /root/ready.py --container-name aaf-sms-vault --container-name aaf-sms-vault-backend"]
43         env:
44         - name: NAMESPACE
45           valueFrom:
46             fieldRef:
47               apiVersion: v1
48               fieldPath: metadata.namespace
49       containers:
50       - image: "{{ include "common.repository" . }}/{{ .Values.image }}"
51         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
52         name: {{ include "common.name" . }}
53         command: ["/sms/bin/sms"]
54         workingDir: /sms/
55         ports:
56         - containerPort: {{ .Values.service.internalPort }}
57         {{- if eq .Values.liveness.enabled true }}
58         livenessProbe:
59           httpGet:
60             port: {{ .Values.service.internalPort }}
61             scheme: HTTPS
62             path: /v1/sms/quorum/status
63           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
64           periodSeconds: {{ .Values.liveness.periodSeconds }}
65         {{ end -}}
66         readinessProbe:
67           httpGet:
68             port: {{ .Values.service.internalPort }}
69             scheme: HTTPS
70             path: /v1/sms/quorum/status
71           initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
72           periodSeconds: {{ .Values.readiness.periodSeconds }}
73         volumeMounts:
74           - mountPath: /etc/localtime
75             name: localtime
76             readOnly: true
77           - mountPath: /sms/smsconfig.json
78             name: {{ include "common.name" .}}
79             subPath: smsconfig.json
80           - mountPath: /sms/auth
81             name: {{ include "common.fullname" . }}-auth
82         resources:
83 {{ include "common.resources" . | indent 10 }}
84         {{- if .Values.nodeSelector }}
85         nodeSelector:
86 {{ toYaml .Values.nodeSelector | indent 10 }}
87         {{- end -}}
88         {{- if .Values.affinity }}
89         affinity:
90 {{ toYaml .Values.affinity | indent 10 }}
91         {{- end }}
92       volumes:
93       - name: localtime
94         hostPath:
95           path: /etc/localtime
96       - name : {{ include "common.name" . }}
97         configMap:
98           name: {{ include "common.fullname" . }}
99       - name: {{ include "common.fullname" . }}-auth
100         persistentVolumeClaim:
101           claimName: {{ include "common.fullname" . }}
102       imagePullSecrets:
103       - name: "{{ include "common.namespace" . }}-docker-registry-key"