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 |
econwar | 4d9f35f | 2019-04-16 08:02:13 +0000 | [diff] [blame] | 48 | - name: {{ include "common.name" . }}-permission-fixer |
| 49 | image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}" |
| 50 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 51 | volumeMounts: |
| 52 | - mountPath: {{ .Values.persistence.spoolPath }} |
| 53 | name: {{ include "common.fullname" . }}-spool-data-pvc |
| 54 | - mountPath: {{ .Values.persistence.eventLogsPath }} |
| 55 | name: {{ include "common.fullname" . }}-event-logs-pvc |
| 56 | command: ["chown","-Rf","1000:1001", "/opt/app/datartr"] |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 57 | containers: |
| 58 | - name: {{ include "common.name" . }} |
| 59 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 60 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 61 | ports: |
econwar | 28266fa | 2019-03-05 16:39:00 +0000 | [diff] [blame] | 62 | - containerPort: {{.Values.config.dmaapDrNode.externalPort}} |
| 63 | - containerPort: {{.Values.config.dmaapDrNode.externalPort2}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 64 | {{- if eq .Values.liveness.enabled true }} |
| 65 | livenessProbe: |
| 66 | tcpSocket: |
econwar | 28266fa | 2019-03-05 16:39:00 +0000 | [diff] [blame] | 67 | port: {{.Values.config.dmaapDrNode.internalPort}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 68 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 69 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 70 | {{ end -}} |
| 71 | readinessProbe: |
| 72 | tcpSocket: |
econwar | 28266fa | 2019-03-05 16:39:00 +0000 | [diff] [blame] | 73 | port: {{.Values.config.dmaapDrNode.internalPort}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 74 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 75 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 76 | volumeMounts: |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 77 | - mountPath: {{ .Values.persistence.spoolPath }} |
| 78 | name: {{ include "common.fullname" . }}-spool-data-pvc |
| 79 | - mountPath: {{ .Values.persistence.eventLogsPath }} |
| 80 | name: {{ include "common.fullname" . }}-event-logs-pvc |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 81 | - mountPath: /etc/localtime |
| 82 | name: localtime |
| 83 | readOnly: false |
| 84 | - mountPath: /opt/app/datartr/etc/dedicatedFeed.json |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 85 | name: {{ include "common.fullname" . }}-create-feed-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 86 | subPath: dedicatedFeed.json |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 87 | - mountPath: /opt/app/datartr/etc/createFeed.sh |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 88 | name: {{ include "common.fullname" . }}-create-feed-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 89 | subPath: createFeed.sh |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 90 | - mountPath: /opt/app/datartr/etc/node.properties |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 91 | name: {{ include "common.fullname" . }}-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 92 | subPath: node.properties |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 93 | - mountPath: /opt/app/datartr/etc/drNodeCadi.properties |
| 94 | name: {{ include "common.fullname" . }}-config |
| 95 | subPath: drNodeCadi.properties |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 96 | lifecycle: |
| 97 | postStart: |
| 98 | exec: |
| 99 | command: |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 100 | - /opt/app/datartr/etc/createFeed.sh |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 101 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 102 | {{ include "common.resources" . | indent 12 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 103 | {{- if .Values.nodeSelector }} |
| 104 | nodeSelector: |
| 105 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 106 | {{- end -}} |
| 107 | {{- if .Values.affinity }} |
| 108 | affinity: |
| 109 | {{ toYaml .Values.affinity | indent 10 }} |
| 110 | {{- end }} |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 111 | # Filebeat sidecar container |
EmmettCox | 6065d3e | 2019-04-12 09:45:30 +0000 | [diff] [blame] | 112 | - name: {{ include "common.name" . }}-filebeat-onap |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 113 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 114 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 115 | volumeMounts: |
| 116 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 117 | mountPath: /usr/share/filebeat/filebeat.yml |
| 118 | subPath: filebeat.yml |
| 119 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 120 | mountPath: /usr/share/filebeat/data |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 121 | - name: {{ include "common.fullname" . }}-event-logs-pvc |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 122 | mountPath: /var/log/onap/datarouter-node |
Sylvain Desbureaux | 789d79a | 2018-12-20 11:04:34 +0100 | [diff] [blame] | 123 | imagePullSecrets: |
| 124 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 125 | volumes: |
| 126 | - name: localtime |
| 127 | hostPath: |
| 128 | path: /etc/localtime |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 129 | - name: {{ include "common.fullname" . }}-create-feed-config |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 130 | configMap: |
| 131 | name: {{ include "common.fullname" . }}-create-feed-configmap |
| 132 | defaultMode: 0755 |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 133 | items: |
| 134 | - key: createFeed.sh |
| 135 | path: createFeed.sh |
| 136 | - key: dedicatedFeed.json |
| 137 | path: dedicatedFeed.json |
| 138 | - name: {{ include "common.fullname" . }}-config |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 139 | configMap: |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 140 | name: {{ include "common.fullname" . }}-configmap |
| 141 | items: |
| 142 | - key: node.properties |
| 143 | path: node.properties |
| 144 | - key: drNodeCadi.properties |
| 145 | path: drNodeCadi.properties |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 146 | - name: {{ include "common.fullname" . }}-log-conf |
| 147 | configMap: |
| 148 | name: {{ include "common.fullname" . }}-log |
| 149 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 150 | configMap: |
EmmettCox | 6065d3e | 2019-04-12 09:45:30 +0000 | [diff] [blame] | 151 | name: {{ .Release.Name }}-dmaap-filebeat-configmap |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 152 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 153 | emptyDir: {} |
| 154 | - name: {{ include "common.fullname" . }}-event-logs-pvc |
| 155 | emptyDir: {} |
| 156 | volumeClaimTemplates: |
| 157 | - metadata: |
| 158 | name: {{ include "common.fullname" . }}-spool-data-pvc |
| 159 | labels: |
| 160 | name: {{ include "common.fullname" . }} |
| 161 | spec: |
| 162 | accessModes: [ {{ .Values.persistence.accessMode }} ] |
| 163 | storageClassName: {{ include "common.fullname" . }}-spool-data-stcl |
| 164 | resources: |
| 165 | requests: |
| 166 | storage: {{ .Values.persistence.spoolSize }} |
| 167 | selector: |
| 168 | matchLabels: |
| 169 | name: {{ include "common.fullname" . }}-spool-data-pv |
| 170 | - metadata: |
| 171 | name: {{ include "common.fullname" . }}-event-logs-pvc |
| 172 | labels: |
| 173 | name: {{ include "common.fullname" . }} |
| 174 | spec: |
| 175 | accessModes: [ {{ .Values.persistence.accessMode }} ] |
| 176 | storageClassName: {{ include "common.fullname" . }}-event-logs-stcl |
| 177 | resources: |
| 178 | requests: |
| 179 | storage: {{ .Values.persistence.eventLogSize }} |
| 180 | selector: |
| 181 | matchLabels: |
| 182 | name: {{ include "common.fullname" . }}-event-logs-pv |