Jakub Latusek | be89684 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 1 | {{/* |
Prateekinlinux | 445a18e | 2018-08-01 06:48:33 +0000 | [diff] [blame] | 2 | # Copyright © 2018 Amdocs, Bell Canada , ZTE |
Sylvain Desbureaux | 55af648 | 2020-11-02 18:21:11 +0100 | [diff] [blame] | 3 | # Copyright © 2021 Orange |
Prateekinlinux | 445a18e | 2018-08-01 06:48:33 +0000 | [diff] [blame] | 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. |
Jakub Latusek | be89684 | 2020-10-21 13:36:29 +0200 | [diff] [blame] | 16 | */}} |
Grzegorz-Lis | 055b6ce | 2020-07-23 10:03:54 +0200 | [diff] [blame] | 17 | apiVersion: apps/v1 |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 18 | kind: Deployment |
| 19 | metadata: |
| 20 | name: {{ include "common.fullname" . }} |
| 21 | namespace: {{ include "common.namespace" . }} |
| 22 | labels: |
| 23 | app: {{ include "common.name" . }} |
| 24 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 25 | release: {{ include "common.release" . }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 26 | heritage: {{ .Release.Service }} |
| 27 | spec: |
Grzegorz-Lis | 055b6ce | 2020-07-23 10:03:54 +0200 | [diff] [blame] | 28 | selector: |
| 29 | matchLabels: |
| 30 | app: {{ include "common.name" . }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 31 | replicas: {{ .Values.replicaCount }} |
| 32 | template: |
| 33 | metadata: |
| 34 | labels: |
| 35 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 36 | release: {{ include "common.release" . }} |
Huabing Zhao | 81b8976 | 2018-07-30 06:33:03 +0000 | [diff] [blame] | 37 | annotations: |
| 38 | sidecar.istio.io/inject: "{{.Values.istioSidecar}}" |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 39 | spec: |
| 40 | initContainers: |
Sylvain Desbureaux | 55af648 | 2020-11-02 18:21:11 +0100 | [diff] [blame] | 41 | {{ include "common.certInitializer.initContainer" . | indent 6 | trim }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 42 | - command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 43 | - /app/ready.py |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 44 | args: |
| 45 | - --container-name |
| 46 | - msb-discovery |
| 47 | env: |
| 48 | - name: NAMESPACE |
| 49 | valueFrom: |
| 50 | fieldRef: |
| 51 | apiVersion: v1 |
| 52 | fieldPath: metadata.namespace |
Sylvain Desbureaux | fd2f8b8 | 2020-11-21 22:50:06 +0100 | [diff] [blame] | 53 | image: {{ include "repositoryGenerator.image.readiness" . }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 54 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 55 | name: {{ include "common.name" . }}-readiness |
| 56 | containers: |
| 57 | - name: {{ include "common.name" . }} |
Sylvain Desbureaux | fd2f8b8 | 2020-11-21 22:50:06 +0100 | [diff] [blame] | 58 | image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 59 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 60 | ports: |
| 61 | - containerPort: {{ .Values.service.internalPort }} |
| 62 | name: {{ .Values.service.name }} |
| 63 | - containerPort: {{ .Values.service.internalPortHttps }} |
| 64 | name: {{ .Values.service.name }}-https |
| 65 | # disable liveness probe when breakpoints set in debugger |
| 66 | # so K8s doesn't restart unresponsive container |
| 67 | {{- if eq .Values.liveness.enabled true }} |
| 68 | livenessProbe: |
| 69 | tcpSocket: |
| 70 | port: {{ .Values.service.internalPort }} |
| 71 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 72 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 73 | {{ end -}} |
| 74 | readinessProbe: |
| 75 | tcpSocket: |
| 76 | port: {{ .Values.service.internalPort }} |
| 77 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 78 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 79 | env: |
| 80 | - name: CONSUL_IP |
BorislavG | 6c7ecf0 | 2018-04-01 13:08:37 +0300 | [diff] [blame] | 81 | value: msb-consul.{{ include "common.namespace" . }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 82 | - name: SDCLIENT_IP |
BorislavG | 6c7ecf0 | 2018-04-01 13:08:37 +0300 | [diff] [blame] | 83 | value: msb-discovery.{{ include "common.namespace" . }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 84 | - name: ROUTE_LABELS |
| 85 | value: {{ .Values.config.routeLabels }} |
| 86 | volumeMounts: |
Sylvain Desbureaux | 55af648 | 2020-11-02 18:21:11 +0100 | [diff] [blame] | 87 | {{ include "common.certInitializer.volumeMount" . | indent 10 | trim }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 88 | - mountPath: /etc/localtime |
| 89 | name: localtime |
| 90 | readOnly: true |
LiZi | 4dd8e11 | 2018-04-09 07:34:04 -0400 | [diff] [blame] | 91 | - mountPath: /usr/local/apiroute-works/logs |
Li Zi | c5290dc | 2018-08-06 09:26:27 +0000 | [diff] [blame] | 92 | name: {{ include "common.fullname" . }}-logs |
Sylvain Desbureaux | 55af648 | 2020-11-02 18:21:11 +0100 | [diff] [blame] | 93 | - mountPath: /usr/local/openresty/nginx/msb-enabled/msbhttps.conf |
| 94 | name: {{ include "common.fullname" . }}-nginx-conf |
| 95 | subPath: msbhttps.conf |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 96 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 97 | {{ include "common.resources" . | indent 12 }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 98 | {{- if .Values.nodeSelector }} |
| 99 | nodeSelector: |
| 100 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 101 | {{- end -}} |
| 102 | {{- if .Values.affinity }} |
| 103 | affinity: |
| 104 | {{ toYaml .Values.affinity | indent 10 }} |
| 105 | {{- end }} |
LiZi | 4dd8e11 | 2018-04-09 07:34:04 -0400 | [diff] [blame] | 106 | # side car containers |
| 107 | - name: filebeat-onap |
Sylvain Desbureaux | fd2f8b8 | 2020-11-21 22:50:06 +0100 | [diff] [blame] | 108 | image: {{ include "repositoryGenerator.image.logging" . }} |
LiZi | 4dd8e11 | 2018-04-09 07:34:04 -0400 | [diff] [blame] | 109 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 110 | volumeMounts: |
Li Zi | c5290dc | 2018-08-06 09:26:27 +0000 | [diff] [blame] | 111 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 112 | mountPath: /usr/share/filebeat/filebeat.yml |
| 113 | subPath: filebeat.yml |
| 114 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 115 | mountPath: /usr/share/filebeat/data |
| 116 | - name: {{ include "common.fullname" . }}-logs |
| 117 | mountPath: /var/log/onap/msb/msb-iag |
| 118 | - mountPath: /opt/ajsc/etc/config/logback.xml |
| 119 | name: {{ include "common.fullname" . }}-log-conf |
| 120 | subPath: logback.xml |
farida azmy | a4478e8 | 2021-10-11 13:48:11 +0200 | [diff] [blame] | 121 | serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 122 | volumes: |
Sylvain Desbureaux | 55af648 | 2020-11-02 18:21:11 +0100 | [diff] [blame] | 123 | {{ include "common.certInitializer.volumes" . | indent 8 | trim }} |
Li Zi | c5290dc | 2018-08-06 09:26:27 +0000 | [diff] [blame] | 124 | - name: {{ include "common.fullname" . }}-log-conf |
| 125 | configMap: |
| 126 | name: {{ include "common.fullname" . }}-log |
Sylvain Desbureaux | 55af648 | 2020-11-02 18:21:11 +0100 | [diff] [blame] | 127 | - name: {{ include "common.fullname" . }}-nginx-conf |
| 128 | configMap: |
| 129 | name: {{ include "common.fullname" . }}-nginx |
Li Zi | c5290dc | 2018-08-06 09:26:27 +0000 | [diff] [blame] | 130 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 131 | configMap: |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 132 | name: {{ include "common.release" . }}-msb-filebeat-configmap |
Li Zi | c5290dc | 2018-08-06 09:26:27 +0000 | [diff] [blame] | 133 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 134 | emptyDir: {} |
| 135 | - name: {{ include "common.fullname" . }}-logs |
| 136 | emptyDir: {} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 137 | - name: localtime |
| 138 | hostPath: |
| 139 | path: /etc/localtime |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 140 | imagePullSecrets: |
| 141 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |