blob: e0e45c457af8a0112f9df310dcd2c730e57be4c6 [file] [log] [blame]
Jack Lucas6fae7632019-01-25 11:46:00 -05001#============LICENSE_START========================================================
2# ================================================================================
3# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
4# ================================================================================
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.
16# ============LICENSE_END=========================================================
17
Krzysztof Kuzmickiaef70072020-07-24 14:47:43 +020018apiVersion: apps/v1
Jack Lucas6fae7632019-01-25 11:46:00 -050019kind: 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" . }}
Jack Lucas6fae7632019-01-25 11:46:00 -050027 heritage: {{ .Release.Service }}
28spec:
29 replicas: 1
Krzysztof Kuzmickiaef70072020-07-24 14:47:43 +020030 selector:
31 matchLabels:
32 app: {{ include "common.name" . }}
Jack Lucas6fae7632019-01-25 11:46:00 -050033 template:
34 metadata:
35 labels:
36 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010037 release: {{ include "common.release" . }}
Jack Lucas6fae7632019-01-25 11:46:00 -050038 spec:
39 initContainers:
40 - name: {{ include "common.name" . }}-readiness
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020041 image: {{ include "common.repository" . }}/{{ .Values.global.readinessImage }}
Jack Lucas6fae7632019-01-25 11:46:00 -050042 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
43 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020044 - /app/ready.py
Jack Lucas6fae7632019-01-25 11:46:00 -050045 args:
46 - --container-name
47 - consul-server
Jack Lucas8c3463e2020-06-12 18:36:55 -040048 - --container-name
49 - aaf-cm
Jack Lucas6fae7632019-01-25 11:46:00 -050050 - "-t"
51 - "15"
52 env:
53 - name: NAMESPACE
54 valueFrom:
55 fieldRef:
56 apiVersion: v1
57 fieldPath: metadata.namespace
Jack Lucasc70bc7e2019-09-23 09:02:31 -040058 - name: aaf_locator_fqdn
59 value: dcae
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000060 {{- if .Values.service.secure.enabled }}
61 - name: init-tls
62 env:
63 - name: POD_IP
64 valueFrom:
65 fieldRef:
66 apiVersion: v1
67 fieldPath: status.podIP
68 image: {{ .Values.global.tlsRepository }}/{{ .Values.global.tlsImage }}
69 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
70 resources: {}
71 volumeMounts:
Jack Lucasc70bc7e2019-09-23 09:02:31 -040072 - mountPath: /opt/app/osaaf
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000073 name: tls-info
74 {{ end }}
Jack Lucas6fae7632019-01-25 11:46:00 -050075 containers:
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000076 {{- if .Values.service.secure.enabled }}
Jack Lucas6fae7632019-01-25 11:46:00 -050077 - name: {{ include "common.name" . }}
78 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
79 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
80 resources:
81{{ include "common.resources" . | indent 12 }}
82 ports:
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000083 - containerPort: {{ .Values.service.secure.internalPort }}
Jack Lucas6fae7632019-01-25 11:46:00 -050084 # disable liveness probe when breakpoints set in debugger
85 # so K8s doesn't restart unresponsive container
86 {{- if eq .Values.liveness.enabled true }}
87 livenessProbe:
88 tcpSocket:
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000089 port: {{ .Values.service.secure.internalPort }}
Jack Lucas6fae7632019-01-25 11:46:00 -050090 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
91 periodSeconds: {{ .Values.liveness.periodSeconds }}
Jakub Latusek3c75b9e2020-09-25 15:39:57 +020092 {{ end }}
Jack Lucas6fae7632019-01-25 11:46:00 -050093 readinessProbe:
94 httpGet:
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000095 scheme: "HTTPS"
Jack Lucas6fae7632019-01-25 11:46:00 -050096 path: {{ .Values.readiness.path }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000097 port: {{ .Values.service.secure.internalPort }}
Jack Lucas6fae7632019-01-25 11:46:00 -050098 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
99 periodSeconds: {{ .Values.readiness.periodSeconds }}
100 volumeMounts:
101 - name: {{ include "common.fullname" . }}-logs
102 mountPath: /opt/logs
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000103 - name: tls-info
104 mountPath: /opt/tls
Jack Lucas6fae7632019-01-25 11:46:00 -0500105 env:
106 - name: CONSUL_HOST
107 value: consul.{{ include "common.namespace" . }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000108 - name: USE_HTTPS
109 value: "1"
110 - name: HTTPS_CERT_PATH
111 value: "/opt/tls/cert.pem"
112 - name: HTTPS_KEY_PATH
113 value: "/opt/tls/key.pem"
Jack Lucas128c0ad2019-09-04 15:44:33 -0400114 - name: {{ include "common.name" . }}-fb-onap
Jack Lucas6fae7632019-01-25 11:46:00 -0500115 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
116 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
117 volumeMounts:
Jack Lucas128c0ad2019-09-04 15:44:33 -0400118 - name: {{ include "common.fullname" . }}-fb-conf
Jack Lucas6fae7632019-01-25 11:46:00 -0500119 mountPath: /usr/share/filebeat/filebeat.yml
120 subPath: filebeat.yml
Jack Lucas128c0ad2019-09-04 15:44:33 -0400121 - name: {{ include "common.fullname" . }}-data-fb
Jack Lucas6fae7632019-01-25 11:46:00 -0500122 mountPath: /usr/share/filebeat/data
123 - name: {{ include "common.fullname" . }}-logs
Jack Lucas128c0ad2019-09-04 15:44:33 -0400124 mountPath: /var/log/onap/config-binding-service
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000125 {{ end }}
126 {{- if .Values.service.insecure.enabled }}
127 - name: {{ include "common.name" . }}-insecure
128 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
129 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
130 resources:
131{{ include "common.resources" . | indent 12 }}
132 ports:
133 - containerPort: {{ .Values.service.insecure.internalPort }}
134 # disable liveness probe when breakpoints set in debugger
135 # so K8s doesn't restart unresponsive container
136 {{- if eq .Values.liveness.enabled true }}
137 livenessProbe:
138 tcpSocket:
139 port: {{ .Values.service.insecure.internalPort }}
140 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
141 periodSeconds: {{ .Values.liveness.periodSeconds }}
Jakub Latusek3c75b9e2020-09-25 15:39:57 +0200142 {{ end }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000143 readinessProbe:
144 httpGet:
145 scheme: "HTTP"
146 path: {{ .Values.readiness.path }}
147 port: {{ .Values.service.insecure.internalPort }}
148 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
149 periodSeconds: {{ .Values.readiness.periodSeconds }}
150 volumeMounts:
Jack Lucas128c0ad2019-09-04 15:44:33 -0400151 - name: {{ include "common.fullname" . }}-logs-i
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000152 mountPath: /opt/logs
153 env:
154 - name: CONSUL_HOST
155 value: consul.{{ include "common.namespace" . }}
Jack Lucas128c0ad2019-09-04 15:44:33 -0400156 - name: {{ include "common.name" . }}-fb-onap-i
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000157 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
158 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
159 volumeMounts:
Jack Lucas128c0ad2019-09-04 15:44:33 -0400160 - name: {{ include "common.fullname" . }}-fb-conf
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000161 mountPath: /usr/share/filebeat/filebeat.yml
162 subPath: filebeat.yml
Jack Lucas128c0ad2019-09-04 15:44:33 -0400163 - name: {{ include "common.fullname" . }}-data-fb-i
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000164 mountPath: /usr/share/filebeat/data
Jack Lucas128c0ad2019-09-04 15:44:33 -0400165 - name: {{ include "common.fullname" . }}-logs-i
166 mountPath: /var/log/onap/config-binding-service
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000167 {{ end }}
Jack Lucas6fae7632019-01-25 11:46:00 -0500168 volumes:
Jack Lucas128c0ad2019-09-04 15:44:33 -0400169 - name: {{ include "common.fullname" . }}-fb-conf
Jack Lucas6fae7632019-01-25 11:46:00 -0500170 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100171 name: {{ include "common.release" . }}-cbs-filebeat-configmap
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000172 {{- if .Values.service.secure.enabled }}
Jack Lucas128c0ad2019-09-04 15:44:33 -0400173 - name: {{ include "common.fullname" . }}-data-fb
Jack Lucas6fae7632019-01-25 11:46:00 -0500174 emptyDir: {}
175 - name: {{ include "common.fullname" . }}-logs
176 emptyDir: {}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000177 - name: tls-info
178 emptyDir: {}
179 {{ end }}
180 {{- if .Values.service.insecure.enabled }}
Jack Lucas128c0ad2019-09-04 15:44:33 -0400181 - name: {{ include "common.fullname" . }}-data-fb-i
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000182 emptyDir: {}
Jack Lucas128c0ad2019-09-04 15:44:33 -0400183 - name: {{ include "common.fullname" . }}-logs-i
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000184 emptyDir: {}
185 {{ end }}
186
Jack Lucas6fae7632019-01-25 11:46:00 -0500187 imagePullSecrets:
188 - name: "{{ include "common.namespace" . }}-docker-registry-key"