Nelson,Thomas(tn1381)(arthurdent3) | 4807fdf | 2018-09-19 16:52:36 -0400 | [diff] [blame] | 1 | apiVersion: apps/v1beta1 |
| 2 | kind: StatefulSet |
| 3 | metadata: |
| 4 | name: {{ template "common.fullname" . }} |
| 5 | labels: |
| 6 | app: {{ template "common.name" . }} |
| 7 | chart: {{ .Chart.Name }} |
| 8 | release: {{ .Release.Name }} |
| 9 | heritage: {{ .Release.Service }} |
| 10 | component: server |
| 11 | spec: |
| 12 | podAntiAffinity: |
| 13 | preferredDuringSchedulingIgnoredDuringExecution: |
| 14 | - weight: 1 |
| 15 | podAffinityTerm: |
| 16 | labelSelector: |
| 17 | matchExpressions: |
| 18 | - key: app |
| 19 | operator: In |
| 20 | values: |
| 21 | - "{{ .Chart.Name }}" |
| 22 | serviceName: {{ template "common.fullname" . }}-headless |
| 23 | replicas: {{ .Values.replicaCount }} |
| 24 | terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} |
| 25 | selector: |
| 26 | matchLabels: |
| 27 | app: {{ template "common.name" . }} |
| 28 | release: {{ .Release.Name }} |
| 29 | component: server |
| 30 | updateStrategy: |
| 31 | {{ toYaml .Values.updateStrategy | indent 4 }} |
| 32 | template: |
| 33 | metadata: |
| 34 | labels: |
| 35 | app: {{ template "common.name" . }} |
| 36 | release: {{ .Release.Name }} |
| 37 | component: server |
| 38 | {{- if .Values.podLabels }} |
| 39 | ## Custom pod labels |
| 40 | {{- range $key, $value := .Values.podLabels }} |
| 41 | {{ $key }}: {{ $value | quote }} |
| 42 | {{- end }} |
| 43 | {{- end }} |
| 44 | annotations: |
| 45 | {{- if .Values.podAnnotations }} |
| 46 | ## Custom pod annotations |
| 47 | {{- range $key, $value := .Values.podAnnotations }} |
| 48 | {{ $key }}: {{ $value | quote }} |
| 49 | {{- end }} |
| 50 | {{- end }} |
| 51 | spec: |
| 52 | {{- if .Values.schedulerName }} |
| 53 | schedulerName: "{{ .Values.schedulerName }}" |
| 54 | {{- end }} |
| 55 | securityContext: |
| 56 | {{ toYaml .Values.securityContext | indent 8 }} |
| 57 | containers: |
| 58 | |
| 59 | - name: zookeeper |
| 60 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" |
dkamdocs | 6ad3a1c | 2018-12-21 09:25:53 +0000 | [diff] [blame] | 61 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.image.pullPolicy }} |
Nelson,Thomas(tn1381)(arthurdent3) | 4807fdf | 2018-09-19 16:52:36 -0400 | [diff] [blame] | 62 | command: |
| 63 | - /bin/bash |
| 64 | - -xec |
| 65 | - zkGenConfig.sh && exec zkServer.sh start-foreground |
| 66 | ports: |
| 67 | {{- range $key, $port := .Values.ports }} |
| 68 | - name: {{ $key }} |
| 69 | {{ toYaml $port | indent 14 }} |
| 70 | {{- end }} |
| 71 | livenessProbe: |
| 72 | {{ toYaml .Values.livenessProbe | indent 12 }} |
| 73 | readinessProbe: |
| 74 | {{ toYaml .Values.readinessProbe | indent 12 }} |
| 75 | env: |
| 76 | - name: ZK_REPLICAS |
| 77 | value: {{ .Values.replicaCount | quote }} |
| 78 | {{- range $key, $value := .Values.env }} |
| 79 | - name: {{ $key | upper | replace "." "_" }} |
| 80 | value: {{ $value | quote }} |
| 81 | {{- end }} |
| 82 | resources: |
| 83 | {{ include "common.resources" . }} |
| 84 | volumeMounts: |
Sylvain Desbureaux | b7ed2ee | 2019-11-29 11:35:13 +0100 | [diff] [blame] | 85 | - name: {{ include "common.fullname" . }}-data |
Nelson,Thomas(tn1381)(arthurdent3) | 4807fdf | 2018-09-19 16:52:36 -0400 | [diff] [blame] | 86 | mountPath: /var/lib/zookeeper |
| 87 | |
| 88 | {{- if .Values.exporters.jmx.enabled }} |
| 89 | - name: jmx-exporter |
| 90 | image: "{{ .Values.exporters.jmx.image.repository }}:{{ .Values.exporters.jmx.image.tag }}" |
dkamdocs | 6ad3a1c | 2018-12-21 09:25:53 +0000 | [diff] [blame] | 91 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.exporters.jmx.image.pullPolicy }} |
Nelson,Thomas(tn1381)(arthurdent3) | 4807fdf | 2018-09-19 16:52:36 -0400 | [diff] [blame] | 92 | ports: |
| 93 | {{- range $key, $port := .Values.exporters.jmx.ports }} |
| 94 | - name: {{ $key }} |
| 95 | {{ toYaml $port | indent 14 }} |
| 96 | {{- end }} |
| 97 | livenessProbe: |
| 98 | {{ toYaml .Values.exporters.jmx.livenessProbe | indent 12 }} |
| 99 | readinessProbe: |
| 100 | {{ toYaml .Values.exporters.jmx.readinessProbe | indent 12 }} |
| 101 | env: |
| 102 | - name: SERVICE_PORT |
| 103 | value: {{ .Values.exporters.jmx.ports.jmxxp.containerPort | quote }} |
| 104 | {{- with .Values.exporters.jmx.env }} |
| 105 | {{- range $key, $value := . }} |
| 106 | - name: {{ $key | upper | replace "." "_" }} |
| 107 | value: {{ $value | quote }} |
| 108 | {{- end }} |
| 109 | {{- end }} |
| 110 | resources: |
| 111 | {{ toYaml .Values.exporters.jmx.resources | indent 12 }} |
| 112 | volumeMounts: |
| 113 | - name: config-jmx-exporter |
| 114 | mountPath: /opt/jmx_exporter/config.yml |
| 115 | subPath: config.yml |
| 116 | {{- end }} |
| 117 | |
| 118 | {{- if .Values.exporters.zookeeper.enabled }} |
| 119 | - name: zookeeper-exporter |
| 120 | image: "{{ .Values.exporters.zookeeper.image.repository }}:{{ .Values.exporters.zookeeper.image.tag }}" |
dkamdocs | 6ad3a1c | 2018-12-21 09:25:53 +0000 | [diff] [blame] | 121 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.exporters.zookeeper.image.pullPolicy }} |
Nelson,Thomas(tn1381)(arthurdent3) | 4807fdf | 2018-09-19 16:52:36 -0400 | [diff] [blame] | 122 | args: |
| 123 | - -bind-addr=:{{ .Values.exporters.zookeeper.ports.zookeeperxp.containerPort }} |
| 124 | - -metrics-path={{ .Values.exporters.zookeeper.path }} |
| 125 | - -zookeeper=localhost:{{ .Values.ports.client.containerPort }} |
| 126 | - -log-level={{ .Values.exporters.zookeeper.config.logLevel }} |
| 127 | - -reset-on-scrape={{ .Values.exporters.zookeeper.config.resetOnScrape }} |
| 128 | ports: |
| 129 | {{- range $key, $port := .Values.exporters.zookeeper.ports }} |
| 130 | - name: {{ $key }} |
| 131 | {{ toYaml $port | indent 14 }} |
| 132 | {{- end }} |
| 133 | livenessProbe: |
| 134 | {{ toYaml .Values.exporters.zookeeper.livenessProbe | indent 12 }} |
| 135 | readinessProbe: |
| 136 | {{ toYaml .Values.exporters.zookeeper.readinessProbe | indent 12 }} |
| 137 | env: |
| 138 | {{- range $key, $value := .Values.exporters.zookeeper.env }} |
| 139 | - name: {{ $key | upper | replace "." "_" }} |
| 140 | value: {{ $value | quote }} |
| 141 | {{- end }} |
| 142 | resources: |
| 143 | {{ toYaml .Values.exporters.zookeeper.resources | indent 12 }} |
| 144 | {{- end }} |
| 145 | |
| 146 | {{- with .Values.nodeSelector }} |
| 147 | nodeSelector: |
| 148 | {{ toYaml . | indent 8 }} |
| 149 | {{- end }} |
| 150 | {{- with .Values.affinity }} |
| 151 | affinity: |
| 152 | {{ toYaml . | indent 8 }} |
| 153 | {{- end }} |
| 154 | {{- with .Values.tolerations }} |
| 155 | tolerations: |
| 156 | {{ toYaml . | indent 8 }} |
| 157 | {{- end }} |
| 158 | {{- if (or .Values.exporters.jmx.enabled (not .Values.persistence.enabled)) }} |
| 159 | volumes: |
| 160 | {{- if .Values.exporters.jmx.enabled }} |
| 161 | - name: config-jmx-exporter |
| 162 | configMap: |
| 163 | name: {{ .Release.Name }}-jmx-exporter |
| 164 | {{- end }} |
Nelson,Thomas(tn1381)(arthurdent3) | 4807fdf | 2018-09-19 16:52:36 -0400 | [diff] [blame] | 165 | {{- end }} |
| 166 | {{- if .Values.persistence.enabled }} |
| 167 | volumeClaimTemplates: |
Sylvain Desbureaux | b7ed2ee | 2019-11-29 11:35:13 +0100 | [diff] [blame] | 168 | - metadata: |
| 169 | name: {{ include "common.fullname" . }}-data |
| 170 | labels: |
| 171 | name: {{ include "common.fullname" . }} |
| 172 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
| 173 | release: "{{ .Release.Name }}" |
| 174 | heritage: "{{ .Release.Service }}" |
| 175 | spec: |
| 176 | accessModes: |
| 177 | - {{ .Values.persistence.accessMode | quote }} |
| 178 | storageClassName: {{ include "common.storageClass" . }} |
| 179 | resources: |
| 180 | requests: |
| 181 | storage: {{ .Values.persistence.size | quote }} |
Nelson,Thomas(tn1381)(arthurdent3) | 4807fdf | 2018-09-19 16:52:36 -0400 | [diff] [blame] | 182 | {{- end }} |