blob: 0f9f7008102e6bc5df2fa8b4cbcb8b00a7160ddc [file] [log] [blame]
Fiachra Corcoranbe966552018-08-07 16:58:45 +01001# 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 Desbureauxf7768e82020-03-23 16:48:20 +010014apiVersion: apps/v1
efiacor4808baa2019-03-11 23:36:05 +000015kind: StatefulSet
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010016metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010017spec:
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010018 selector: {{- include "common.selectors" . | nindent 4 }}
19 serviceName: {{ include "common.servicename" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010020 replicas: {{ .Values.replicaCount }}
21 template:
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010022 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010023 spec:
Fiachra Corcoranbe966552018-08-07 16:58:45 +010024 initContainers:
25 - name: {{ include "common.name" . }}-readiness
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020026 image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
Fiachra Corcoranbe966552018-08-07 16:58:45 +010027 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
28 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020029 - /app/ready.py
Fiachra Corcoranbe966552018-08-07 16:58:45 +010030 args:
31 - --container-name
econwar28266fa2019-03-05 16:39:00 +000032 - dmaap-dr-prov
Fiachra Corcoranbe966552018-08-07 16:58:45 +010033 env:
34 - name: NAMESPACE
35 valueFrom:
36 fieldRef:
37 apiVersion: v1
38 fieldPath: metadata.namespace
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010039 {{- if .Values.global.aafEnabled }}{{ include "common.aaf-config" . | nindent 8 }}{{ end }}
econwar4d9f35f2019-04-16 08:02:13 +000040 - name: {{ include "common.name" . }}-permission-fixer
41 image: "{{ .Values.global.busyBoxRepository }}/{{ .Values.global.busyBoxImage }}"
42 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010043 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 Desbureaux60141122019-11-29 15:55:11 +010047 name: {{ include "common.fullname" . }}-event-logs
efiacore62958b2019-09-27 16:54:36 +010048 command: ["chown","-Rf","1000:1001", "/opt/app/"]
Fiachra Corcoranbe966552018-08-07 16:58:45 +010049 containers:
50 - name: {{ include "common.name" . }}
51 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
52 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010053 ports: {{ include "common.containerPorts" . | nindent 12 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010054 {{- if eq .Values.liveness.enabled true }}
55 livenessProbe:
56 tcpSocket:
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010057 port: {{.Values.liveness.port}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010058 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
59 periodSeconds: {{ .Values.liveness.periodSeconds }}
60 {{ end -}}
61 readinessProbe:
62 tcpSocket:
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010063 port: {{.Values.readiness.port}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010064 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
65 periodSeconds: {{ .Values.readiness.periodSeconds }}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010066 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 Desbureaux60141122019-11-29 15:55:11 +010070 name: {{ include "common.fullname" . }}-event-logs
Fiachra Corcoranbe966552018-08-07 16:58:45 +010071 - mountPath: /etc/localtime
72 name: localtime
73 readOnly: false
Fiachra Corcoranbe966552018-08-07 16:58:45 +010074 - mountPath: /opt/app/datartr/etc/node.properties
efiacoreabb6522019-04-08 09:46:09 +000075 name: {{ include "common.fullname" . }}-config
Fiachra Corcoranbe966552018-08-07 16:58:45 +010076 subPath: node.properties
efiacor7b9a0872019-08-28 21:20:22 +000077 - 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 Desbureauxf7768e82020-03-23 16:48:20 +010082 resources: {{ include "common.resources" . | nindent 12 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010083 {{- if .Values.nodeSelector }}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010084 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010085 {{- end -}}
86 {{- if .Values.affinity }}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010087 affinity: {{ toYaml .Values.affinity | nindent 10 }}
efiacore62958b2019-09-27 16:54:36 +010088 {{- end -}}
Krzysztof Opasiak03b10092020-01-24 22:45:16 +010089 # Filebeat sidecar container
EmmettCox6065d3e2019-04-12 09:45:30 +000090 - name: {{ include "common.name" . }}-filebeat-onap
econwar378cf192019-01-08 16:19:59 +000091 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
efiacor7b9a0872019-08-28 21:20:22 +000099 - name: {{ include "common.fullname" . }}-logs
econwar378cf192019-01-08 16:19:59 +0000100 mountPath: /var/log/onap/datarouter-node
Sylvain Desbureaux789d79a2018-12-20 11:04:34 +0100101 imagePullSecrets:
102 - name: "{{ include "common.namespace" . }}-docker-registry-key"
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +0100103 volumes: {{ include "common.aaf-config-volumes" . | nindent 8 }}
efiacor4808baa2019-03-11 23:36:05 +0000104 - name: localtime
105 hostPath:
106 path: /etc/localtime
efiacoreabb6522019-04-08 09:46:09 +0000107 - name: {{ include "common.fullname" . }}-config
efiacor4808baa2019-03-11 23:36:05 +0000108 configMap:
efiacoreabb6522019-04-08 09:46:09 +0000109 name: {{ include "common.fullname" . }}-configmap
110 items:
111 - key: node.properties
112 path: node.properties
efiacor4808baa2019-03-11 23:36:05 +0000113 - name: {{ include "common.fullname" . }}-log-conf
114 configMap:
115 name: {{ include "common.fullname" . }}-log
116 - name: {{ include "common.fullname" . }}-filebeat-conf
117 configMap:
efiacor7b9a0872019-08-28 21:20:22 +0000118 name: {{ include "common.fullname" . }}-dmaap-dr-node-filebeat-configmap
efiacor4808baa2019-03-11 23:36:05 +0000119 - name: {{ include "common.fullname" . }}-data-filebeat
120 emptyDir: {}
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100121 - name: {{ include "common.fullname" . }}-logs
122 emptyDir: {}
123 {{- if not .Values.persistence.enabled }}
mprzybyse1ea50d2020-01-31 10:09:02 +0000124 - name: {{ include "common.fullname" . }}-event-logs
efiacor4808baa2019-03-11 23:36:05 +0000125 emptyDir: {}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +0100126 - name: {{ include "common.fullname" . }}-spool
efiacor7b9a0872019-08-28 21:20:22 +0000127 emptyDir: {}
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100128 {{- end }}
129{{- if .Values.persistence.enabled }}
efiacor4808baa2019-03-11 23:36:05 +0000130 volumeClaimTemplates:
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +0100131 - {{ 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 }}
efiacore62958b2019-09-27 16:54:36 +0100133{{- end }}