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