Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 1 | # Copyright © 2017 Amdocs, Bell Canada |
| 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 | apiVersion: extensions/v1beta1 |
| 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 "+" "_" }} |
| 22 | release: {{ .Release.Name }} |
| 23 | heritage: {{ .Release.Service }} |
| 24 | spec: |
| 25 | replicas: {{ .Values.replicaCount }} |
| 26 | template: |
| 27 | metadata: |
| 28 | labels: |
| 29 | app: {{ include "common.name" . }} |
| 30 | release: {{ .Release.Name }} |
| 31 | spec: |
econwar | 28266fa | 2019-03-05 16:39:00 +0000 | [diff] [blame^] | 32 | hostname: {{.Values.config.dmaapDrProv.name}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 33 | initContainers: |
| 34 | - command: |
| 35 | - /root/ready.py |
| 36 | args: |
| 37 | - --container-name |
econwar | 28266fa | 2019-03-05 16:39:00 +0000 | [diff] [blame^] | 38 | - {{.Values.config.dmaapDrDb.mariadbContName}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 39 | env: |
| 40 | - name: NAMESPACE |
| 41 | valueFrom: |
| 42 | fieldRef: |
| 43 | apiVersion: v1 |
| 44 | fieldPath: metadata.namespace |
| 45 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 46 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 47 | name: {{ include "common.name" . }}-readiness |
| 48 | containers: |
| 49 | - name: {{ include "common.name" . }} |
| 50 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 51 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 52 | ports: |
econwar | 28266fa | 2019-03-05 16:39:00 +0000 | [diff] [blame^] | 53 | - containerPort: {{.Values.config.dmaapDrProv.externalPort}} |
| 54 | - containerPort: {{.Values.config.dmaapDrProv.externalPort2}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 55 | {{- if eq .Values.liveness.enabled true }} |
| 56 | livenessProbe: |
| 57 | tcpSocket: |
econwar | 28266fa | 2019-03-05 16:39:00 +0000 | [diff] [blame^] | 58 | port: {{.Values.config.dmaapDrProv.externalPort}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 59 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 60 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 61 | {{ end -}} |
| 62 | readinessProbe: |
| 63 | tcpSocket: |
econwar | 28266fa | 2019-03-05 16:39:00 +0000 | [diff] [blame^] | 64 | port: {{.Values.config.dmaapDrProv.externalPort}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 65 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 66 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 67 | volumeMounts: |
| 68 | - mountPath: /etc/localtime |
| 69 | name: localtime |
| 70 | readOnly: false |
| 71 | - mountPath: /opt/app/datartr/etc/provserver.properties |
| 72 | subPath: provserver.properties |
| 73 | name: prov-props |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 74 | - name: {{ include "common.fullname" . }}-logs |
| 75 | mountPath: {{ .Values.global.loggingDirectory }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 76 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 77 | {{ include "common.resources" . | indent 12 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 78 | {{- if .Values.nodeSelector }} |
| 79 | nodeSelector: |
| 80 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 81 | {{- end -}} |
| 82 | {{- if .Values.affinity }} |
| 83 | affinity: |
| 84 | {{ toYaml .Values.affinity | indent 10 }} |
| 85 | {{- end }} |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 86 | |
| 87 | # Filebeat sidecar container |
| 88 | - name: {{ include "common.name" . }}-filebeat-onap |
| 89 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 90 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 91 | volumeMounts: |
| 92 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 93 | mountPath: /usr/share/filebeat/filebeat.yml |
| 94 | subPath: filebeat.yml |
| 95 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 96 | mountPath: /usr/share/filebeat/data |
| 97 | - name: {{ include "common.fullname" . }}-logs |
| 98 | mountPath: /var/log/onap/datarouter-prov |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 99 | volumes: |
| 100 | - name: localtime |
| 101 | hostPath: |
| 102 | path: /etc/localtime |
| 103 | - name: prov-props |
| 104 | configMap: |
| 105 | name: {{ include "common.fullname" . }}-prov-props-configmap |
| 106 | - name: dr-prov-data |
| 107 | {{- if .Values.persistence.enabled }} |
| 108 | persistentVolumeClaim: |
| 109 | claimName: {{ include "common.fullname" . }} |
| 110 | {{- else }} |
| 111 | emptyDir: {} |
| 112 | {{- end }} |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 113 | - name: {{ include "common.fullname" . }}-log-conf |
| 114 | configMap: |
| 115 | name: {{ include "common.fullname" . }}-log |
| 116 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 117 | configMap: |
| 118 | name: {{ .Release.Name }}-dmaap-filebeat-configmap |
| 119 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 120 | emptyDir: {} |
| 121 | - name: {{ include "common.fullname" . }}-logs |
| 122 | emptyDir: {} |
Sylvain Desbureaux | 435ef53 | 2018-12-20 10:58:09 +0100 | [diff] [blame] | 123 | imagePullSecrets: |
| 124 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |