blob: baf7f2c723751cbcab6c987e2486f4a7d70fd11a [file] [log] [blame]
Chandrasekaran Ramachandranb515b962021-06-11 16:07:09 +05301################################################################################
2# Copyright (c) 2021 HCL Technolgies Limited. #
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. #
15################################################################################
Chandru22ebf742021-06-02 17:16:37 +053016{{- if .Values.enterprise.enabled }}
17apiVersion: apps/v1
18kind: StatefulSet
19metadata:
Chandrasekaran Ramachandranb515b962021-06-11 16:07:09 +053020 name: {{ include "common.fullname.influxdb" . }}-meta
Chandru22ebf742021-06-02 17:16:37 +053021 labels:
Chandrasekaran Ramachandranb515b962021-06-11 16:07:09 +053022 {{- include "common.influxdb.labels" . | nindent 4 }}
Chandru22ebf742021-06-02 17:16:37 +053023 app.kubernetes.io/component: meta
24spec:
25 replicas: {{ .Values.enterprise.meta.clusterSize }}
26 selector:
27 matchLabels:
Chandrasekaran Ramachandranb515b962021-06-11 16:07:09 +053028 {{- include "common.influxdb.selectorLabels" . | nindent 6 }}
Chandru22ebf742021-06-02 17:16:37 +053029 app.kubernetes.io/component: meta
Chandrasekaran Ramachandranb515b962021-06-11 16:07:09 +053030 serviceName: "{{ include "common.fullname.influxdb" . }}-meta"
Chandru22ebf742021-06-02 17:16:37 +053031 template:
32 metadata:
33 labels:
Chandrasekaran Ramachandranb515b962021-06-11 16:07:09 +053034 {{- include "common.influxdb.selectorLabels" . | nindent 8 }}
Chandru22ebf742021-06-02 17:16:37 +053035 app.kubernetes.io/component: meta
36 {{- if .Values.podAnnotations }}
37 annotations:
38{{ toYaml .Values.podAnnotations | indent 8 }}
39 {{- end }}
40 spec:
41 {{- if .Values.image.pullSecrets }}
42 imagePullSecrets:
43 {{- range .Values.image.pullSecrets }}
44 - name: {{ . }}
45 {{- end}}
46 {{- end }}
Chandrasekaran Ramachandranb515b962021-06-11 16:07:09 +053047 serviceAccountName: {{ include "common.influxdb.serviceAccountName" . }}
Chandru22ebf742021-06-02 17:16:37 +053048 containers:
Chandrasekaran Ramachandranb515b962021-06-11 16:07:09 +053049 - name: "{{ include "common.fullname.influxdb" . }}-meta"
Chandru22ebf742021-06-02 17:16:37 +053050 image: "{{ .Values.image.repository }}:{{ .Values.enterprise.meta.image.tag }}"
51 imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
52 resources:
53{{ toYaml .Values.enterprise.meta.resources | indent 10 }}
54 ports:
55 - name: udp
Chandrasekaran Ramachandranb515b962021-06-11 16:07:09 +053056 containerPort: {{ include "common.serviceport.influxdb.udp.bind_address" . | default 8089 }}
Chandru22ebf742021-06-02 17:16:37 +053057 - name: rpc
Chandrasekaran Ramachandranb515b962021-06-11 16:07:09 +053058 containerPort: {{ include "common.serviceport.influxdb.rpc.bind_address" . | default 8088 }}
Chandru22ebf742021-06-02 17:16:37 +053059 - name: meta
Chandrasekaran Ramachandranb515b962021-06-11 16:07:09 +053060 containerPort: {{ include "common.serviceport.influxdb.meta.bind_address" . | default 8091 }}
Chandru22ebf742021-06-02 17:16:37 +053061 {{- if .Values.env }}
62 env:
63{{ toYaml .Values.env | indent 10 }}
64 # Values.env's HOSTNAME isn't fundamentally different from $HOSTNAME, but this way we get a distinguished name for InfluxDB at runtime.
65 - name: INFLUXDB_HOSTNAME
Chandrasekaran Ramachandranb515b962021-06-11 16:07:09 +053066 value: "$(_HOSTNAME).{{ include "common.fullname.influxdb" . }}-meta"
Chandru22ebf742021-06-02 17:16:37 +053067 {{- end }}
68 livenessProbe:
69 httpGet:
70 path: {{ .Values.livenessProbe.path | default "/ping" }}
71 port: meta
72 initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds | default 30 }}
73 timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds | default 5 }}
74 readinessProbe:
75 httpGet:
76 path: {{ .Values.readinessProbe.path | default "/ping" }}
77 port: meta
78 initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds | default 5 }}
79 timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds | default 1 }}
80 {{- if .Values.startupProbe.enabled }}
81 startupProbe:
82 httpGet:
83 path: {{ .Values.startupProbe.path | default "/ping" }}
84 port: meta
85 failureThreshold: {{ .Values.startupProbe.failureThreshold | default 6 }}
86 periodSeconds: {{ .Values.startupProbe.periodSeconds | default 5 }}
87 {{- end }}
88 volumeMounts:
Chandrasekaran Ramachandranb515b962021-06-11 16:07:09 +053089 - name: {{ include "common.fullname.influxdb" . }}-meta
Chandru22ebf742021-06-02 17:16:37 +053090 mountPath: /var/lib/influxdb
91 - name: config
92 mountPath: /etc/influxdb
93 {{- if .Values.initScripts.enabled }}
94 - name: init
95 mountPath: /docker-entrypoint-initdb.d
96 {{- end }}
97 volumes:
98 - name: config
99 configMap:
Chandrasekaran Ramachandranb515b962021-06-11 16:07:09 +0530100 name: {{ include "common.fullname.influxdb" . }}-meta
Chandru22ebf742021-06-02 17:16:37 +0530101 {{- if .Values.initScripts.enabled }}
102 - name: init
103 configMap:
Chandrasekaran Ramachandranb515b962021-06-11 16:07:09 +0530104 name: {{ include "common.fullname.influxdb" . }}-init
Chandru22ebf742021-06-02 17:16:37 +0530105 {{- end }}
106 {{- if (not .Values.persistence.enabled ) }}
Chandrasekaran Ramachandranb515b962021-06-11 16:07:09 +0530107 - name: {{ include "common.fullname.influxdb" . }}-meta
Chandru22ebf742021-06-02 17:16:37 +0530108 emptyDir: {}
109 {{- end }}
110 {{- if .Values.schedulerName }}
111 schedulerName: "{{ .Values.schedulerName }}"
112 {{- end }}
113 {{- if .Values.nodeSelector }}
114 nodeSelector:
115{{ toYaml .Values.nodeSelector | indent 8 }}
116 {{- end -}}
117 {{- if .Values.affinity }}
118 affinity:
119{{ toYaml .Values.affinity | indent 8 }}
120 {{- end }}
121 {{- if .Values.tolerations }}
122 tolerations:
123{{ toYaml .Values.tolerations | indent 8 }}
124 {{- end }}
125 {{- if .Values.persistence.enabled }}
126 volumeClaimTemplates:
127 - metadata:
Chandrasekaran Ramachandranb515b962021-06-11 16:07:09 +0530128 name: {{ include "common.fullname.influxdb" . }}-meta
Chandru22ebf742021-06-02 17:16:37 +0530129 annotations:
130 {{- range $key, $value := .Values.persistence.annotations }}
131 {{ $key }}: "{{ $value }}"
132 {{- end }}
133 spec:
134 accessModes:
135 - {{ .Values.persistence.accessMode | quote}}
136 resources:
137 requests:
138 storage: {{ .Values.persistence.size | quote }}
139 {{- if .Values.persistence.storageClass }}
140 {{- if (eq "-" .Values.persistence.storageClass) }}
141 storageClassName: ""
142 {{- else }}
143 storageClassName: "{{ .Values.persistence.storageClass }}"
144 {{- end }}
145 {{- end }}
146 {{- end }}
147{{- end }}