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. |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 14 | apiVersion: apps/v1 |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 15 | kind: StatefulSet |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 16 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 17 | spec: |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 18 | selector: {{- include "common.selectors" . | nindent 4 }} |
| 19 | serviceName: {{ include "common.servicename" . }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 20 | replicas: {{ .Values.replicaCount }} |
| 21 | template: |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 22 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 23 | spec: |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 24 | initContainers: |
| 25 | - name: {{ include "common.name" . }}-readiness |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 26 | image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 27 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 28 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 29 | - /app/ready.py |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 30 | args: |
| 31 | - --container-name |
econwar | 28266fa | 2019-03-05 16:39:00 +0000 | [diff] [blame] | 32 | - dmaap-dr-prov |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 33 | env: |
| 34 | - name: NAMESPACE |
| 35 | valueFrom: |
| 36 | fieldRef: |
| 37 | apiVersion: v1 |
| 38 | fieldPath: metadata.namespace |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 39 | {{- if .Values.global.aafEnabled }}{{ include "common.aaf-config" . | nindent 8 }}{{ end }} |
econwar | 4d9f35f | 2019-04-16 08:02:13 +0000 | [diff] [blame] | 40 | - name: {{ include "common.name" . }}-permission-fixer |
| 41 | image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}" |
| 42 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 43 | volumeMounts: {{- if .Values.global.aafEnabled }}{{ include "common.aaf-config-volume-mountpath" . | nindent 10 }}{{ end }} |
| 44 | - mountPath: {{ .Values.persistence.spool.path }} |
| 45 | name: {{ include "common.fullname" . }}-spool |
| 46 | - mountPath: {{ .Values.persistence.event.path }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 47 | name: {{ include "common.fullname" . }}-event-logs |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 48 | command: ["chown","-Rf","1000:1001", "/opt/app/"] |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 49 | containers: |
| 50 | - name: {{ include "common.name" . }} |
| 51 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 52 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 53 | ports: {{ include "common.containerPorts" . | nindent 12 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 54 | {{- if eq .Values.liveness.enabled true }} |
| 55 | livenessProbe: |
| 56 | tcpSocket: |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 57 | port: {{.Values.liveness.port}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 58 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 59 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 60 | {{ end -}} |
| 61 | readinessProbe: |
| 62 | tcpSocket: |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 63 | port: {{.Values.readiness.port}} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 64 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 65 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 66 | volumeMounts: {{- if .Values.global.aafEnabled }}{{ include "common.aaf-config-volume-mountpath" . | nindent 10 }}{{ end }} |
| 67 | - mountPath: {{ .Values.persistence.spool.path }} |
| 68 | name: {{ include "common.fullname" . }}-spool |
| 69 | - mountPath: {{ .Values.persistence.event.path }} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 70 | name: {{ include "common.fullname" . }}-event-logs |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 71 | - mountPath: /etc/localtime |
| 72 | name: localtime |
| 73 | readOnly: false |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 74 | - mountPath: /opt/app/datartr/etc/node.properties |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 75 | name: {{ include "common.fullname" . }}-config |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 76 | subPath: node.properties |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 77 | - mountPath: /opt/app/datartr/etc/logback.xml |
| 78 | name: {{ include "common.fullname" . }}-log-conf |
| 79 | subPath: logback.xml |
| 80 | - mountPath: {{ .Values.global.loggingDirectory }} |
| 81 | name: {{ include "common.fullname" . }}-logs |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 82 | resources: {{ include "common.resources" . | nindent 12 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 83 | {{- if .Values.nodeSelector }} |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 84 | nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }} |
Fiachra Corcoran | be96655 | 2018-08-07 16:58:45 +0100 | [diff] [blame] | 85 | {{- end -}} |
| 86 | {{- if .Values.affinity }} |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 87 | affinity: {{ toYaml .Values.affinity | nindent 10 }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 88 | {{- end -}} |
Krzysztof Opasiak | 03b1009 | 2020-01-24 22:45:16 +0100 | [diff] [blame] | 89 | # Filebeat sidecar container |
EmmettCox | 6065d3e | 2019-04-12 09:45:30 +0000 | [diff] [blame] | 90 | - name: {{ include "common.name" . }}-filebeat-onap |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 91 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 92 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 93 | volumeMounts: |
| 94 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 95 | mountPath: /usr/share/filebeat/filebeat.yml |
| 96 | subPath: filebeat.yml |
| 97 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 98 | mountPath: /usr/share/filebeat/data |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 99 | - name: {{ include "common.fullname" . }}-logs |
econwar | 378cf19 | 2019-01-08 16:19:59 +0000 | [diff] [blame] | 100 | mountPath: /var/log/onap/datarouter-node |
Sylvain Desbureaux | 789d79a | 2018-12-20 11:04:34 +0100 | [diff] [blame] | 101 | imagePullSecrets: |
| 102 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 103 | volumes: {{ include "common.aaf-config-volumes" . | nindent 8 }} |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 104 | - name: localtime |
| 105 | hostPath: |
| 106 | path: /etc/localtime |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 107 | - name: {{ include "common.fullname" . }}-config |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 108 | configMap: |
efiacor | eabb652 | 2019-04-08 09:46:09 +0000 | [diff] [blame] | 109 | name: {{ include "common.fullname" . }}-configmap |
| 110 | items: |
| 111 | - key: node.properties |
| 112 | path: node.properties |
efiacor | 4808baa | 2019-03-11 23:36:05 +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: |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 118 | name: {{ include "common.fullname" . }}-dmaap-dr-node-filebeat-configmap |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 119 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 120 | emptyDir: {} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 121 | - name: {{ include "common.fullname" . }}-logs |
| 122 | emptyDir: {} |
| 123 | {{- if not .Values.persistence.enabled }} |
mprzybys | e1ea50d | 2020-01-31 10:09:02 +0000 | [diff] [blame] | 124 | - name: {{ include "common.fullname" . }}-event-logs |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 125 | emptyDir: {} |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 126 | - name: {{ include "common.fullname" . }}-spool |
efiacor | 7b9a087 | 2019-08-28 21:20:22 +0000 | [diff] [blame] | 127 | emptyDir: {} |
Sylvain Desbureaux | 6014112 | 2019-11-29 15:55:11 +0100 | [diff] [blame] | 128 | {{- end }} |
| 129 | {{- if .Values.persistence.enabled }} |
efiacor | 4808baa | 2019-03-11 23:36:05 +0000 | [diff] [blame] | 130 | volumeClaimTemplates: |
Sylvain Desbureaux | f7768e8 | 2020-03-23 16:48:20 +0100 | [diff] [blame] | 131 | - {{ include "common.PVCTemplate" (dict "dot" . "suffix" "spool" "persistenceInfos" .Values.persistence.spool) | indent 4 | trim }} |
| 132 | - {{ include "common.PVCTemplate" (dict "dot" . "suffix" "event-logs" "persistenceInfos" .Values.persistence.event) | indent 4 | trim }} |
efiacor | e62958b | 2019-09-27 16:54:36 +0100 | [diff] [blame] | 133 | {{- end }} |