1 ################################################################################
2 # Copyright (c) 2021 HCL Technolgies Limited. #
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 #
8 # http://www.apache.org/licenses/LICENSE-2.0 #
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 ################################################################################
19 name: {{ include "common.fullname.influxdb" . }}-meta
21 {{- include "common.influxdb.labels" . | nindent 4 }}
23 {{- if .Values.enterprise.enabled }}
24 replicas: {{ .Values.enterprise.clusterSize }}
30 {{- include "common.influxdb.selectorLabels" . | nindent 6 }}
31 serviceName: {{ include "common.fullname.influxdb" . }}-meta
35 {{- include "common.influxdb.selectorLabels" . | nindent 8 }}
36 {{- if .Values.podAnnotations }}
38 {{ toYaml .Values.podAnnotations | indent 8 }}
41 {{- if .Values.schedulerName }}
42 schedulerName: "{{ .Values.schedulerName }}"
44 {{- if .Values.nodeSelector }}
46 {{ toYaml .Values.nodeSelector | indent 8 }}
48 {{- if .Values.affinity }}
50 {{ toYaml .Values.affinity | indent 8 }}
52 {{- if .Values.tolerations }}
54 {{ toYaml .Values.tolerations | indent 8 }}
56 {{- if .Values.securityContext }}
58 {{ toYaml .Values.securityContext | indent 8 }}
60 {{- if .Values.image.pullSecrets }}
62 {{- range .Values.image.pullSecrets }}
66 serviceAccountName: {{ include "common.influxdb.serviceAccountName" . }}
68 - name: {{ include "common.fullname.influxdb" . }}
69 image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
70 imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
72 {{ toYaml .Values.resources | indent 10 }}
75 containerPort: {{ include "common.serviceport.influxdb.http.bind_address" . | default 8086 }}
76 {{- if .Values.config.graphite.enabled }}
78 containerPort: {{ include "common.serviceport.influxdb.graphite.bind_address" . | default 2003 }}
80 {{- if .Values.config.collectd.enabled }}
82 containerPort: {{ include "common.serviceport.influxdb.collectd.bind_address" . | default 25826 }}
85 {{- if .Values.config.udp.enabled }}
87 containerPort: {{ include "common.serviceport.influxdb.udp.bind_address" . | default 8089 }}
90 {{- if .Values.config.opentsdb.enabled }}
92 containerPort: {{ include "common.serviceport.influxdb.opentsdb.bind_address" . | default 4242 }}
95 containerPort: {{ include "common.serviceport.influxdb.rpc.bind_address" . | default 8088 }}
96 {{- if .Values.enterprise.enabled }}
98 containerPort: {{ include "common.serviceport.influxdb.meta.bind_address" . | default 8091 }}
100 {{- if .Values.env }}
102 {{ toYaml .Values.env | indent 10 }}
103 {{- if .Values.enterprise.enabled }}
104 - name: INFLUXDB_HOSTNAME # Values.env's HOSTNAME isn't fundamentally different from $HOSTNAME, but this way weg get a distinguished name at runtime.
105 value: "$(_HOSTNAME).{{ include "common.fullname.influxdb" . }}"
108 {{- if .Values.envFromSecret }}
111 name: {{ .Values.envFromSecret }}
115 path: {{ .Values.livenessProbe.path | default "/ping" }}
117 scheme: {{ .Values.livenessProbe.scheme | default "HTTP" }}
118 initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds | default 30 }}
119 timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds | default 5 }}
122 path: {{ .Values.readinessProbe.path | default "/ping" }}
124 scheme: {{ .Values.readinessProbe.scheme | default "HTTP" }}
125 initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds | default 5 }}
126 timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds | default 1 }}
127 {{- if .Values.startupProbe.enabled }}
130 path: {{ .Values.startupProbe.path | default "/ping" }}
132 scheme: {{ .Values.startupProbe.scheme | default "HTTP" }}
133 failureThreshold: {{ .Values.startupProbe.failureThreshold | default 6 }}
134 periodSeconds: {{ .Values.startupProbe.periodSeconds | default 5 }}
137 - name: {{ include "common.fullname.influxdb" . }}-data
138 mountPath: /var/lib/influxdb
140 mountPath: /etc/influxdb
141 {{- if .Values.initScripts.enabled }}
143 mountPath: /docker-entrypoint-initdb.d
145 {{- if .Values.mountPoints }}
146 {{ toYaml .Values.mountPoints | indent 8 }}
148 {{- if .Values.extraContainers }}
149 {{ toYaml .Values.extraContainers | indent 6}}
154 name: {{ include "common.fullname.influxdb" . }}
155 {{- if .Values.initScripts.enabled }}
158 name: {{ include "common.fullname.influxdb" . }}-init
160 {{- if (not .Values.persistence.enabled ) }}
161 - name: {{ include "common.fullname.influxdb" . }}-data
164 # Cannot use existing claim in enterprise mode
165 {{- if and .Values.persistence.enabled .Values.persistence.existingClaim (not .Values.enterprise.enabled) }}
166 - name: {{ include "common.fullname.influxdb" . }}-data
167 persistentVolumeClaim:
168 claimName: {{ .Values.persistence.existingClaim }}
170 {{- if .Values.volumes }}
171 {{ toYaml .Values.volumes | indent 6 }}
173 # Must use volume claim template in enterprise mode
174 {{- if and .Values.persistence.enabled (or (not .Values.persistence.existingClaim) .Values.enterprise.enabled) }}
175 volumeClaimTemplates:
177 name: {{ include "common.fullname.influxdb" . }}-data
179 {{- range $key, $value := .Values.persistence.annotations }}
180 {{ $key }}: "{{ $value }}"
184 - {{ .Values.persistence.accessMode | quote}}
187 storage: {{ .Values.persistence.size | quote }}
188 {{- if .Values.persistence.storageClass }}
189 {{- if (eq "-" .Values.persistence.storageClass) }}
192 storageClassName: "{{ .Values.persistence.storageClass }}"