blob: 40a4d7db936fe1c82ff72edc498040909e51648a [file] [log] [blame]
Jakub Latusek67f4e8d2020-10-21 13:36:29 +02001{{/*
Fiachra Corcoranbe966552018-08-07 16:58:45 +01002# Copyright © 2017 Amdocs, Bell Canada
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
Jakub Latusek67f4e8d2020-10-21 13:36:29 +020015*/}}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010016apiVersion: apps/v1
efiacor4808baa2019-03-11 23:36:05 +000017kind: StatefulSet
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010018metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010019spec:
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010020 selector: {{- include "common.selectors" . | nindent 4 }}
21 serviceName: {{ include "common.servicename" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010022 replicas: {{ .Values.replicaCount }}
23 template:
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010024 metadata: {{- include "common.templateMetadata" . | nindent 6 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010025 spec:
Fiachra Corcoranbe966552018-08-07 16:58:45 +010026 initContainers:
27 - name: {{ include "common.name" . }}-readiness
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010028 image: {{ include "repositoryGenerator.image.readiness" . }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010029 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
30 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +020031 - /app/ready.py
Fiachra Corcoranbe966552018-08-07 16:58:45 +010032 args:
33 - --container-name
econwar28266fa2019-03-05 16:39:00 +000034 - dmaap-dr-prov
Fiachra Corcoranbe966552018-08-07 16:58:45 +010035 env:
36 - name: NAMESPACE
37 valueFrom:
38 fieldRef:
39 apiVersion: v1
40 fieldPath: metadata.namespace
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010041 {{- if .Values.global.aafEnabled }}{{ include "common.aaf-config" . | nindent 8 }}{{ end }}
econwar4d9f35f2019-04-16 08:02:13 +000042 - name: {{ include "common.name" . }}-permission-fixer
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010043 image: {{ include "repositoryGenerator.image.busybox" . }}
econwar4d9f35f2019-04-16 08:02:13 +000044 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010045 volumeMounts: {{- if .Values.global.aafEnabled }}{{ include "common.aaf-config-volume-mountpath" . | nindent 10 }}{{ end }}
46 - mountPath: {{ .Values.persistence.spool.path }}
47 name: {{ include "common.fullname" . }}-spool
48 - mountPath: {{ .Values.persistence.event.path }}
Sylvain Desbureaux60141122019-11-29 15:55:11 +010049 name: {{ include "common.fullname" . }}-event-logs
efiacore62958b2019-09-27 16:54:36 +010050 command: ["chown","-Rf","1000:1001", "/opt/app/"]
Fiachra Corcoranbe966552018-08-07 16:58:45 +010051 containers:
52 - name: {{ include "common.name" . }}
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010053 image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010054 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010055 ports: {{ include "common.containerPorts" . | nindent 12 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010056 {{- if eq .Values.liveness.enabled true }}
57 livenessProbe:
58 tcpSocket:
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010059 port: {{.Values.liveness.port}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010060 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
61 periodSeconds: {{ .Values.liveness.periodSeconds }}
62 {{ end -}}
63 readinessProbe:
64 tcpSocket:
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010065 port: {{.Values.readiness.port}}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010066 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
67 periodSeconds: {{ .Values.readiness.periodSeconds }}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010068 volumeMounts: {{- if .Values.global.aafEnabled }}{{ include "common.aaf-config-volume-mountpath" . | nindent 10 }}{{ end }}
69 - mountPath: {{ .Values.persistence.spool.path }}
70 name: {{ include "common.fullname" . }}-spool
71 - mountPath: {{ .Values.persistence.event.path }}
Sylvain Desbureaux60141122019-11-29 15:55:11 +010072 name: {{ include "common.fullname" . }}-event-logs
Fiachra Corcoranbe966552018-08-07 16:58:45 +010073 - mountPath: /etc/localtime
74 name: localtime
75 readOnly: false
Fiachra Corcoranbe966552018-08-07 16:58:45 +010076 - mountPath: /opt/app/datartr/etc/node.properties
efiacoreabb6522019-04-08 09:46:09 +000077 name: {{ include "common.fullname" . }}-config
Fiachra Corcoranbe966552018-08-07 16:58:45 +010078 subPath: node.properties
efiacor7b9a0872019-08-28 21:20:22 +000079 - mountPath: /opt/app/datartr/etc/logback.xml
80 name: {{ include "common.fullname" . }}-log-conf
81 subPath: logback.xml
82 - mountPath: {{ .Values.global.loggingDirectory }}
83 name: {{ include "common.fullname" . }}-logs
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010084 resources: {{ include "common.resources" . | nindent 12 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010085 {{- if .Values.nodeSelector }}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010086 nodeSelector: {{ toYaml .Values.nodeSelector | nindent 10 }}
Fiachra Corcoranbe966552018-08-07 16:58:45 +010087 {{- end -}}
88 {{- if .Values.affinity }}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +010089 affinity: {{ toYaml .Values.affinity | nindent 10 }}
Sylvain Desbureauxe6153432021-02-04 18:26:23 +010090 {{- end }}
Krzysztof Opasiak03b10092020-01-24 22:45:16 +010091 # Filebeat sidecar container
EmmettCox6065d3e2019-04-12 09:45:30 +000092 - name: {{ include "common.name" . }}-filebeat-onap
Sylvain Desbureaux6b096542020-11-21 22:51:24 +010093 image: {{ include "repositoryGenerator.image.logging" . }}
econwar378cf192019-01-08 16:19:59 +000094 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
95 volumeMounts:
96 - name: {{ include "common.fullname" . }}-filebeat-conf
97 mountPath: /usr/share/filebeat/filebeat.yml
98 subPath: filebeat.yml
99 - name: {{ include "common.fullname" . }}-data-filebeat
100 mountPath: /usr/share/filebeat/data
efiacor7b9a0872019-08-28 21:20:22 +0000101 - name: {{ include "common.fullname" . }}-logs
econwar378cf192019-01-08 16:19:59 +0000102 mountPath: /var/log/onap/datarouter-node
Sylvain Desbureaux789d79a2018-12-20 11:04:34 +0100103 imagePullSecrets:
104 - name: "{{ include "common.namespace" . }}-docker-registry-key"
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +0100105 volumes: {{ include "common.aaf-config-volumes" . | nindent 8 }}
efiacor4808baa2019-03-11 23:36:05 +0000106 - name: localtime
107 hostPath:
108 path: /etc/localtime
efiacoreabb6522019-04-08 09:46:09 +0000109 - name: {{ include "common.fullname" . }}-config
efiacor4808baa2019-03-11 23:36:05 +0000110 configMap:
efiacoreabb6522019-04-08 09:46:09 +0000111 name: {{ include "common.fullname" . }}-configmap
112 items:
113 - key: node.properties
114 path: node.properties
efiacor4808baa2019-03-11 23:36:05 +0000115 - name: {{ include "common.fullname" . }}-log-conf
116 configMap:
117 name: {{ include "common.fullname" . }}-log
118 - name: {{ include "common.fullname" . }}-filebeat-conf
119 configMap:
efiacor7b9a0872019-08-28 21:20:22 +0000120 name: {{ include "common.fullname" . }}-dmaap-dr-node-filebeat-configmap
efiacor4808baa2019-03-11 23:36:05 +0000121 - name: {{ include "common.fullname" . }}-data-filebeat
122 emptyDir: {}
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100123 - name: {{ include "common.fullname" . }}-logs
124 emptyDir: {}
125 {{- if not .Values.persistence.enabled }}
mprzybyse1ea50d2020-01-31 10:09:02 +0000126 - name: {{ include "common.fullname" . }}-event-logs
efiacor4808baa2019-03-11 23:36:05 +0000127 emptyDir: {}
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +0100128 - name: {{ include "common.fullname" . }}-spool
efiacor7b9a0872019-08-28 21:20:22 +0000129 emptyDir: {}
Sylvain Desbureaux60141122019-11-29 15:55:11 +0100130 {{- end }}
131{{- if .Values.persistence.enabled }}
efiacor4808baa2019-03-11 23:36:05 +0000132 volumeClaimTemplates:
Sylvain Desbureauxf7768e82020-03-23 16:48:20 +0100133 - {{ include "common.PVCTemplate" (dict "dot" . "suffix" "spool" "persistenceInfos" .Values.persistence.spool) | indent 4 | trim }}
134 - {{ include "common.PVCTemplate" (dict "dot" . "suffix" "event-logs" "persistenceInfos" .Values.persistence.event) | indent 4 | trim }}
efiacore62958b2019-09-27 16:54:36 +0100135{{- end }}