blob: 171fc7c807b013cb9d109f0576a28d7f0b82147d [file] [log] [blame]
Jakub Latusekdf233a82020-10-21 13:36:29 +02001{{/*
Jack Lucas6fae7632019-01-25 11:46:00 -05002#============LICENSE_START========================================================
3# ================================================================================
4# Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
Jack Lucasec09fd52021-11-01 16:54:12 -04005# Copyright (c) 2021 J. F. Lucas. All rights reserved.
Jack Lucas6fae7632019-01-25 11:46:00 -05006# ================================================================================
7# Licensed under the Apache License, Version 2.0 (the "License");
8# you may not use this file except in compliance with the License.
9# You may obtain a copy of the License at
10#
11# http://www.apache.org/licenses/LICENSE-2.0
12#
13# Unless required by applicable law or agreed to in writing, software
14# distributed under the License is distributed on an "AS IS" BASIS,
15# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16# See the License for the specific language governing permissions and
17# limitations under the License.
18# ============LICENSE_END=========================================================
Jakub Latusekdf233a82020-10-21 13:36:29 +020019*/}}
Jack Lucas6fae7632019-01-25 11:46:00 -050020
Krzysztof Kuzmickiaef70072020-07-24 14:47:43 +020021apiVersion: apps/v1
Jack Lucas6fae7632019-01-25 11:46:00 -050022kind: Deployment
23metadata:
24 name: {{ include "common.fullname" . }}
25 namespace: {{ include "common.namespace" . }}
26 labels:
27 app: {{ include "common.name" . }}
28 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010029 release: {{ include "common.release" . }}
Jack Lucas6fae7632019-01-25 11:46:00 -050030 heritage: {{ .Release.Service }}
31spec:
32 replicas: 1
Krzysztof Kuzmickiaef70072020-07-24 14:47:43 +020033 selector:
34 matchLabels:
35 app: {{ include "common.name" . }}
Jack Lucas6fae7632019-01-25 11:46:00 -050036 template:
37 metadata:
38 labels:
39 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010040 release: {{ include "common.release" . }}
Jack Lucas6fae7632019-01-25 11:46:00 -050041 spec:
42 initContainers:
43 - name: {{ include "common.name" . }}-readiness
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +010044 image: {{ include "repositoryGenerator.image.readiness" . }}
Jack Lucas6fae7632019-01-25 11:46:00 -050045 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
46 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020047 - /app/ready.py
Jack Lucas6fae7632019-01-25 11:46:00 -050048 args:
49 - --container-name
50 - consul-server
Jack Lucas8c3463e2020-06-12 18:36:55 -040051 - --container-name
52 - aaf-cm
Jack Lucas6fae7632019-01-25 11:46:00 -050053 - "-t"
54 - "15"
55 env:
56 - name: NAMESPACE
57 valueFrom:
58 fieldRef:
59 apiVersion: v1
60 fieldPath: metadata.namespace
Jack Lucasc70bc7e2019-09-23 09:02:31 -040061 - name: aaf_locator_fqdn
62 value: dcae
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000063 {{- if .Values.service.secure.enabled }}
64 - name: init-tls
65 env:
66 - name: POD_IP
67 valueFrom:
68 fieldRef:
69 apiVersion: v1
70 fieldPath: status.podIP
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +010071 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.tlsImage }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000072 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
73 resources: {}
74 volumeMounts:
Jack Lucasc70bc7e2019-09-23 09:02:31 -040075 - mountPath: /opt/app/osaaf
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000076 name: tls-info
77 {{ end }}
Jack Lucas6fae7632019-01-25 11:46:00 -050078 containers:
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000079 {{- if .Values.service.secure.enabled }}
Jack Lucas6fae7632019-01-25 11:46:00 -050080 - name: {{ include "common.name" . }}
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +010081 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Jack Lucas6fae7632019-01-25 11:46:00 -050082 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
83 resources:
84{{ include "common.resources" . | indent 12 }}
85 ports:
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000086 - containerPort: {{ .Values.service.secure.internalPort }}
Jack Lucas6fae7632019-01-25 11:46:00 -050087 # disable liveness probe when breakpoints set in debugger
88 # so K8s doesn't restart unresponsive container
89 {{- if eq .Values.liveness.enabled true }}
90 livenessProbe:
91 tcpSocket:
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000092 port: {{ .Values.service.secure.internalPort }}
Jack Lucas6fae7632019-01-25 11:46:00 -050093 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
94 periodSeconds: {{ .Values.liveness.periodSeconds }}
Jakub Latusek3c75b9e2020-09-25 15:39:57 +020095 {{ end }}
Jack Lucas6fae7632019-01-25 11:46:00 -050096 readinessProbe:
97 httpGet:
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +000098 scheme: "HTTPS"
Jack Lucas6fae7632019-01-25 11:46:00 -050099 path: {{ .Values.readiness.path }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000100 port: {{ .Values.service.secure.internalPort }}
Jack Lucas6fae7632019-01-25 11:46:00 -0500101 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
102 periodSeconds: {{ .Values.readiness.periodSeconds }}
103 volumeMounts:
104 - name: {{ include "common.fullname" . }}-logs
105 mountPath: /opt/logs
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000106 - name: tls-info
107 mountPath: /opt/tls
Jack Lucas6fae7632019-01-25 11:46:00 -0500108 env:
109 - name: CONSUL_HOST
Jack Lucasec09fd52021-11-01 16:54:12 -0400110 value: consul-server-ui.{{ include "common.namespace" . }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000111 - name: USE_HTTPS
112 value: "1"
113 - name: HTTPS_CERT_PATH
114 value: "/opt/tls/cert.pem"
115 - name: HTTPS_KEY_PATH
116 value: "/opt/tls/key.pem"
Jack Lucas128c0ad2019-09-04 15:44:33 -0400117 - name: {{ include "common.name" . }}-fb-onap
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +0100118 image: {{ include "repositoryGenerator.image.logging" . }}
Jack Lucas6fae7632019-01-25 11:46:00 -0500119 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
120 volumeMounts:
Jack Lucas128c0ad2019-09-04 15:44:33 -0400121 - name: {{ include "common.fullname" . }}-fb-conf
Jack Lucas6fae7632019-01-25 11:46:00 -0500122 mountPath: /usr/share/filebeat/filebeat.yml
123 subPath: filebeat.yml
Jack Lucas128c0ad2019-09-04 15:44:33 -0400124 - name: {{ include "common.fullname" . }}-data-fb
Jack Lucas6fae7632019-01-25 11:46:00 -0500125 mountPath: /usr/share/filebeat/data
126 - name: {{ include "common.fullname" . }}-logs
Jack Lucas128c0ad2019-09-04 15:44:33 -0400127 mountPath: /var/log/onap/config-binding-service
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000128 {{ end }}
129 {{- if .Values.service.insecure.enabled }}
130 - name: {{ include "common.name" . }}-insecure
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +0100131 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000132 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
133 resources:
134{{ include "common.resources" . | indent 12 }}
135 ports:
136 - containerPort: {{ .Values.service.insecure.internalPort }}
137 # disable liveness probe when breakpoints set in debugger
138 # so K8s doesn't restart unresponsive container
139 {{- if eq .Values.liveness.enabled true }}
140 livenessProbe:
141 tcpSocket:
142 port: {{ .Values.service.insecure.internalPort }}
143 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
144 periodSeconds: {{ .Values.liveness.periodSeconds }}
Jakub Latusek3c75b9e2020-09-25 15:39:57 +0200145 {{ end }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000146 readinessProbe:
147 httpGet:
148 scheme: "HTTP"
149 path: {{ .Values.readiness.path }}
150 port: {{ .Values.service.insecure.internalPort }}
151 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
152 periodSeconds: {{ .Values.readiness.periodSeconds }}
153 volumeMounts:
Jack Lucas128c0ad2019-09-04 15:44:33 -0400154 - name: {{ include "common.fullname" . }}-logs-i
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000155 mountPath: /opt/logs
156 env:
157 - name: CONSUL_HOST
Jack Lucasec09fd52021-11-01 16:54:12 -0400158 value: consul-server-ui.{{ include "common.namespace" . }}
Jack Lucas128c0ad2019-09-04 15:44:33 -0400159 - name: {{ include "common.name" . }}-fb-onap-i
Sylvain Desbureauxcad63e52020-11-21 22:17:40 +0100160 image: {{ include "repositoryGenerator.image.logging" . }}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000161 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
162 volumeMounts:
Jack Lucas128c0ad2019-09-04 15:44:33 -0400163 - name: {{ include "common.fullname" . }}-fb-conf
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000164 mountPath: /usr/share/filebeat/filebeat.yml
165 subPath: filebeat.yml
Jack Lucas128c0ad2019-09-04 15:44:33 -0400166 - name: {{ include "common.fullname" . }}-data-fb-i
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000167 mountPath: /usr/share/filebeat/data
Jack Lucas128c0ad2019-09-04 15:44:33 -0400168 - name: {{ include "common.fullname" . }}-logs-i
169 mountPath: /var/log/onap/config-binding-service
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000170 {{ end }}
farida azmy37481802021-04-11 15:41:32 +0200171 serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
Jack Lucas6fae7632019-01-25 11:46:00 -0500172 volumes:
Jack Lucas128c0ad2019-09-04 15:44:33 -0400173 - name: {{ include "common.fullname" . }}-fb-conf
Jack Lucas6fae7632019-01-25 11:46:00 -0500174 configMap:
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +0100175 name: {{ include "common.release" . }}-cbs-filebeat-configmap
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000176 {{- if .Values.service.secure.enabled }}
Jack Lucas128c0ad2019-09-04 15:44:33 -0400177 - name: {{ include "common.fullname" . }}-data-fb
Jack Lucas6fae7632019-01-25 11:46:00 -0500178 emptyDir: {}
179 - name: {{ include "common.fullname" . }}-logs
180 emptyDir: {}
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000181 - name: tls-info
182 emptyDir: {}
183 {{ end }}
184 {{- if .Values.service.insecure.enabled }}
Jack Lucas128c0ad2019-09-04 15:44:33 -0400185 - name: {{ include "common.fullname" . }}-data-fb-i
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000186 emptyDir: {}
Jack Lucas128c0ad2019-09-04 15:44:33 -0400187 - name: {{ include "common.fullname" . }}-logs-i
Vijay Venkatesh Kumara4535c92019-08-02 01:45:23 +0000188 emptyDir: {}
189 {{ end }}
190
Jack Lucas6fae7632019-01-25 11:46:00 -0500191 imagePullSecrets:
192 - name: "{{ include "common.namespace" . }}-docker-registry-key"