[GENERAL] Use readiness container v3.0.1
[oom.git] / kubernetes / so / charts / so-ve-vnfm-adapter / templates / deployment.yaml
1 # Copyright © 2020 Samsung
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: {{- include "common.resourceMetadata" . | nindent 2 }}
18 spec:
19   selector: {{- include "common.selectors" . | nindent 4 }}
20   replicas: {{ index .Values.replicaCount }}
21   template:
22     metadata:
23       labels: {{- include "common.labels" . | nindent 8 }}
24     spec:
25       initContainers: {{ include "so.certificate.container_importer" . | nindent 8 }}
26         - name: {{ include "common.name" . }}-readiness
27           command:
28             - /app/ready.py
29           args:
30             - --container-name
31             - aai
32             - --container-name
33             - message-router
34           env:
35             - name: NAMESPACE
36               valueFrom:
37                 fieldRef:
38                   apiVersion: v1
39                   fieldPath: metadata.namespace
40           image: {{ include "common.repository" . }}/{{ .Values.global.readinessImage }}
41           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
42       containers:
43         - name: {{ include "common.name" . }}
44           envFrom:
45             - configMapRef:
46                 name: {{ include "common.fullname" . }}-configmap
47           image: {{ include "common.repository" . }}/{{ .Values.image }}
48           resources: {{ include "common.resources" . | nindent 12 }}
49           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
50           volumeMounts: {{ include "so.certificate.volume-mounts" . | nindent 12 }}
51             - name: logs
52               mountPath: /app/logs
53             - name: config
54               mountPath: /app/config
55               readOnly: true
56           livenessProbe:
57             tcpSocket:
58               port: {{ index .Values.livenessProbe.port }}
59             initialDelaySeconds: {{ index .Values.livenessProbe.initialDelaySeconds}}
60             periodSeconds: {{ index .Values.livenessProbe.periodSeconds}}
61             successThreshold: {{ index .Values.livenessProbe.successThreshold}}
62             failureThreshold: {{ index .Values.livenessProbe.failureThreshold}}
63           ports: {{- include "common.containerPorts" . | nindent 10 }}
64       volumes: {{ include "so.certificate.volumes" . | nindent 8 }}
65         - name: logs
66           emptyDir: {}
67         - name: config
68           configMap:
69             name: {{ include "common.fullname" . }}-app-configmap