Chandrasekaran Ramachandran | b515b96 | 2021-06-11 16:07:09 +0530 | [diff] [blame^] | 1 | ################################################################################ |
| 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 | ################################################################################ |
Chandru | 22ebf74 | 2021-06-02 17:16:37 +0530 | [diff] [blame] | 16 | {{- if .Values.enterprise.enabled }} |
| 17 | apiVersion: apps/v1 |
| 18 | kind: StatefulSet |
| 19 | metadata: |
Chandrasekaran Ramachandran | b515b96 | 2021-06-11 16:07:09 +0530 | [diff] [blame^] | 20 | name: {{ include "common.fullname.influxdb" . }}-meta |
Chandru | 22ebf74 | 2021-06-02 17:16:37 +0530 | [diff] [blame] | 21 | labels: |
Chandrasekaran Ramachandran | b515b96 | 2021-06-11 16:07:09 +0530 | [diff] [blame^] | 22 | {{- include "common.influxdb.labels" . | nindent 4 }} |
Chandru | 22ebf74 | 2021-06-02 17:16:37 +0530 | [diff] [blame] | 23 | app.kubernetes.io/component: meta |
| 24 | spec: |
| 25 | replicas: {{ .Values.enterprise.meta.clusterSize }} |
| 26 | selector: |
| 27 | matchLabels: |
Chandrasekaran Ramachandran | b515b96 | 2021-06-11 16:07:09 +0530 | [diff] [blame^] | 28 | {{- include "common.influxdb.selectorLabels" . | nindent 6 }} |
Chandru | 22ebf74 | 2021-06-02 17:16:37 +0530 | [diff] [blame] | 29 | app.kubernetes.io/component: meta |
Chandrasekaran Ramachandran | b515b96 | 2021-06-11 16:07:09 +0530 | [diff] [blame^] | 30 | serviceName: "{{ include "common.fullname.influxdb" . }}-meta" |
Chandru | 22ebf74 | 2021-06-02 17:16:37 +0530 | [diff] [blame] | 31 | template: |
| 32 | metadata: |
| 33 | labels: |
Chandrasekaran Ramachandran | b515b96 | 2021-06-11 16:07:09 +0530 | [diff] [blame^] | 34 | {{- include "common.influxdb.selectorLabels" . | nindent 8 }} |
Chandru | 22ebf74 | 2021-06-02 17:16:37 +0530 | [diff] [blame] | 35 | 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 Ramachandran | b515b96 | 2021-06-11 16:07:09 +0530 | [diff] [blame^] | 47 | serviceAccountName: {{ include "common.influxdb.serviceAccountName" . }} |
Chandru | 22ebf74 | 2021-06-02 17:16:37 +0530 | [diff] [blame] | 48 | containers: |
Chandrasekaran Ramachandran | b515b96 | 2021-06-11 16:07:09 +0530 | [diff] [blame^] | 49 | - name: "{{ include "common.fullname.influxdb" . }}-meta" |
Chandru | 22ebf74 | 2021-06-02 17:16:37 +0530 | [diff] [blame] | 50 | 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 Ramachandran | b515b96 | 2021-06-11 16:07:09 +0530 | [diff] [blame^] | 56 | containerPort: {{ include "common.serviceport.influxdb.udp.bind_address" . | default 8089 }} |
Chandru | 22ebf74 | 2021-06-02 17:16:37 +0530 | [diff] [blame] | 57 | - name: rpc |
Chandrasekaran Ramachandran | b515b96 | 2021-06-11 16:07:09 +0530 | [diff] [blame^] | 58 | containerPort: {{ include "common.serviceport.influxdb.rpc.bind_address" . | default 8088 }} |
Chandru | 22ebf74 | 2021-06-02 17:16:37 +0530 | [diff] [blame] | 59 | - name: meta |
Chandrasekaran Ramachandran | b515b96 | 2021-06-11 16:07:09 +0530 | [diff] [blame^] | 60 | containerPort: {{ include "common.serviceport.influxdb.meta.bind_address" . | default 8091 }} |
Chandru | 22ebf74 | 2021-06-02 17:16:37 +0530 | [diff] [blame] | 61 | {{- 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 Ramachandran | b515b96 | 2021-06-11 16:07:09 +0530 | [diff] [blame^] | 66 | value: "$(_HOSTNAME).{{ include "common.fullname.influxdb" . }}-meta" |
Chandru | 22ebf74 | 2021-06-02 17:16:37 +0530 | [diff] [blame] | 67 | {{- 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 Ramachandran | b515b96 | 2021-06-11 16:07:09 +0530 | [diff] [blame^] | 89 | - name: {{ include "common.fullname.influxdb" . }}-meta |
Chandru | 22ebf74 | 2021-06-02 17:16:37 +0530 | [diff] [blame] | 90 | 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 Ramachandran | b515b96 | 2021-06-11 16:07:09 +0530 | [diff] [blame^] | 100 | name: {{ include "common.fullname.influxdb" . }}-meta |
Chandru | 22ebf74 | 2021-06-02 17:16:37 +0530 | [diff] [blame] | 101 | {{- if .Values.initScripts.enabled }} |
| 102 | - name: init |
| 103 | configMap: |
Chandrasekaran Ramachandran | b515b96 | 2021-06-11 16:07:09 +0530 | [diff] [blame^] | 104 | name: {{ include "common.fullname.influxdb" . }}-init |
Chandru | 22ebf74 | 2021-06-02 17:16:37 +0530 | [diff] [blame] | 105 | {{- end }} |
| 106 | {{- if (not .Values.persistence.enabled ) }} |
Chandrasekaran Ramachandran | b515b96 | 2021-06-11 16:07:09 +0530 | [diff] [blame^] | 107 | - name: {{ include "common.fullname.influxdb" . }}-meta |
Chandru | 22ebf74 | 2021-06-02 17:16:37 +0530 | [diff] [blame] | 108 | 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 Ramachandran | b515b96 | 2021-06-11 16:07:09 +0530 | [diff] [blame^] | 128 | name: {{ include "common.fullname.influxdb" . }}-meta |
Chandru | 22ebf74 | 2021-06-02 17:16:37 +0530 | [diff] [blame] | 129 | 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 }} |