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. |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 14 | apiVersion: apps/v1beta1 |
| 15 | kind: StatefulSet |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 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 }} |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 26 | serviceName: {{ .Values.config.dmaapDrNode.name }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 27 | template: |
| 28 | metadata: |
| 29 | labels: |
| 30 | app: {{ include "common.name" . }} |
| 31 | release: {{ .Release.Name }} |
| 32 | spec: |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 33 | initContainers: |
| 34 | - name: {{ include "common.name" . }}-readiness |
| 35 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 36 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 37 | command: |
| 38 | - /root/ready.py |
| 39 | args: |
| 40 | - --container-name |
econwar | 28266fa | 2019-03-05 16:39:00 +0000 | [diff] [blame] | 41 | - dmaap-dr-prov |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 42 | env: |
| 43 | - name: NAMESPACE |
| 44 | valueFrom: |
| 45 | fieldRef: |
| 46 | apiVersion: v1 |
| 47 | fieldPath: metadata.namespace |
| 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.dmaapDrNode.externalPort}} |
| 54 | - containerPort: {{.Values.config.dmaapDrNode.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.dmaapDrNode.internalPort}} |
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.dmaapDrNode.internalPort}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 65 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 66 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 67 | volumeMounts: |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 68 | - mountPath: {{ .Values.persistence.spoolPath }} |
| 69 | name: {{ include "common.fullname" . }}-spool-data-pvc |
| 70 | - mountPath: {{ .Values.persistence.eventLogsPath }} |
| 71 | name: {{ include "common.fullname" . }}-event-logs-pvc |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 72 | - mountPath: /etc/localtime |
| 73 | name: localtime |
| 74 | readOnly: false |
| 75 | - mountPath: /opt/app/datartr/etc/dedicatedFeed.json |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 76 | name: {{ include "common.fullname" . }}-create-feed-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 77 | subPath: dedicatedFeed.json |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 78 | - mountPath: /opt/app/datartr/etc/createFeed.sh |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 79 | name: {{ include "common.fullname" . }}-create-feed-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 80 | subPath: createFeed.sh |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 81 | - mountPath: /opt/app/datartr/etc/node.properties |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 82 | name: {{ include "common.fullname" . }}-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 83 | subPath: node.properties |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 84 | - mountPath: /opt/app/datartr/etc/drNodeCadi.properties |
| 85 | name: {{ include "common.fullname" . }}-config |
| 86 | subPath: drNodeCadi.properties |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 87 | lifecycle: |
| 88 | postStart: |
| 89 | exec: |
| 90 | command: |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 91 | - /opt/app/datartr/etc/createFeed.sh |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 92 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 93 | {{ include "common.resources" . | indent 12 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 94 | {{- if .Values.nodeSelector }} |
| 95 | nodeSelector: |
| 96 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 97 | {{- end -}} |
| 98 | {{- if .Values.affinity }} |
| 99 | affinity: |
| 100 | {{ toYaml .Values.affinity | indent 10 }} |
| 101 | {{- end }} |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 102 | # Filebeat sidecar container |
EmmettCox | 6065d3e | 2019-04-12 09:45:30 +0000 | [diff] [blame^] | 103 | - name: {{ include "common.name" . }}-filebeat-onap |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 104 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 105 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 106 | volumeMounts: |
| 107 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 108 | mountPath: /usr/share/filebeat/filebeat.yml |
| 109 | subPath: filebeat.yml |
| 110 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 111 | mountPath: /usr/share/filebeat/data |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 112 | - name: {{ include "common.fullname" . }}-event-logs-pvc |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 113 | mountPath: /var/log/onap/datarouter-node |
Sylvain Desbureaux | 789d79a | 2018-12-20 11:04:34 +0100 | [diff] [blame] | 114 | imagePullSecrets: |
| 115 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 116 | volumes: |
| 117 | - name: localtime |
| 118 | hostPath: |
| 119 | path: /etc/localtime |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 120 | - name: {{ include "common.fullname" . }}-create-feed-config |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 121 | configMap: |
| 122 | name: {{ include "common.fullname" . }}-create-feed-configmap |
| 123 | defaultMode: 0755 |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 124 | items: |
| 125 | - key: createFeed.sh |
| 126 | path: createFeed.sh |
| 127 | - key: dedicatedFeed.json |
| 128 | path: dedicatedFeed.json |
| 129 | - name: {{ include "common.fullname" . }}-config |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 130 | configMap: |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 131 | name: {{ include "common.fullname" . }}-configmap |
| 132 | items: |
| 133 | - key: node.properties |
| 134 | path: node.properties |
| 135 | - key: drNodeCadi.properties |
| 136 | path: drNodeCadi.properties |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 137 | - name: {{ include "common.fullname" . }}-log-conf |
| 138 | configMap: |
| 139 | name: {{ include "common.fullname" . }}-log |
| 140 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 141 | configMap: |
EmmettCox | 6065d3e | 2019-04-12 09:45:30 +0000 | [diff] [blame^] | 142 | name: {{ .Release.Name }}-dmaap-filebeat-configmap |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 143 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 144 | emptyDir: {} |
| 145 | - name: {{ include "common.fullname" . }}-event-logs-pvc |
| 146 | emptyDir: {} |
| 147 | volumeClaimTemplates: |
| 148 | - metadata: |
| 149 | name: {{ include "common.fullname" . }}-spool-data-pvc |
| 150 | labels: |
| 151 | name: {{ include "common.fullname" . }} |
| 152 | spec: |
| 153 | accessModes: [ {{ .Values.persistence.accessMode }} ] |
| 154 | storageClassName: {{ include "common.fullname" . }}-spool-data-stcl |
| 155 | resources: |
| 156 | requests: |
| 157 | storage: {{ .Values.persistence.spoolSize }} |
| 158 | selector: |
| 159 | matchLabels: |
| 160 | name: {{ include "common.fullname" . }}-spool-data-pv |
| 161 | - metadata: |
| 162 | name: {{ include "common.fullname" . }}-event-logs-pvc |
| 163 | labels: |
| 164 | name: {{ include "common.fullname" . }} |
| 165 | spec: |
| 166 | accessModes: [ {{ .Values.persistence.accessMode }} ] |
| 167 | storageClassName: {{ include "common.fullname" . }}-event-logs-stcl |
| 168 | resources: |
| 169 | requests: |
| 170 | storage: {{ .Values.persistence.eventLogSize }} |
| 171 | selector: |
| 172 | matchLabels: |
| 173 | name: {{ include "common.fullname" . }}-event-logs-pv |