Skip to content

Commit

Permalink
chore: Ability to add extra volumes, init containers and env variables
Browse files Browse the repository at this point in the history
  • Loading branch information
ravisingal committed Oct 30, 2023
1 parent 90e886f commit ae09917
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 1 deletion.
16 changes: 16 additions & 0 deletions helm/templates/broker/statefulset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ spec:
annotations:
{{- toYaml .Values.broker.podAnnotations | nindent 8 }}
spec:
{{- with .Values.initContainers }}
initContainers:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: pinot-broker
image: {{ include "pinot.image" . }}
Expand All @@ -45,6 +49,9 @@ spec:
env:
- name: JAVA_OPTS
value: "{{ .Values.broker.jvmOpts }} -Dlog4j2.configurationFile={{ .Values.broker.log4j2ConfFile }} -Dplugins.dir={{ .Values.broker.pluginsDir }} -Djute.maxbuffer=4194304 {{ if .Values.broker.jmx.enabled }}{{ .Values.broker.jmx.opts }}{{ end }}"
{{- with .Values.extraEnvs }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http-broker
containerPort: {{ .Values.broker.port }}
Expand All @@ -54,12 +61,18 @@ spec:
containerPort: {{ .Values.broker.jmx.port }}
protocol: TCP
{{- end }}
{{- with .Values.extraEnvs }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: config
mountPath: /var/pinot/broker/config
- name: log-config
mountPath: /opt/pinot/conf/pinot-broker-log4j2.xml
subPath: "pinot-broker-log4j2.xml"
{{- with .Values.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
livenessProbe:
httpGet:
path: /health
Expand Down Expand Up @@ -114,6 +127,9 @@ spec:
- name: log-config
configMap:
name: {{ include "pinot.broker.fullname" . }}-log-config
{{- with .Values.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
Expand Down
16 changes: 15 additions & 1 deletion helm/templates/controller/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ spec:
annotations:
{{- toYaml .Values.controller.podAnnotations | nindent 8 }}
spec:
{{- if .Values.zookeeper.path }}
{{- if or .Values.zookeeper.path .Values.initContainers }}
initContainers:
{{- if .Values.zookeeper.path }}
- name: create-zk-root-path
image: "{{ .Values.zookeeper.image.repository }}:{{ .Values.zookeeper.image.tag }}"
imagePullPolicy: {{ .Values.zookeeper.image.pullPolicy }}
Expand Down Expand Up @@ -61,6 +62,10 @@ spec:
done
exit $exitCode
{{- end }}
{{- with .Values.initContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
containers:
- name: pinot-controller
image: {{ include "pinot.image" . }}
Expand All @@ -78,6 +83,9 @@ spec:
containerPort: {{ .Values.controller.jmx.port }}
protocol: TCP
{{- end }}
{{- with .Values.extraEnvs }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: config
mountPath: /var/pinot/controller/config
Expand All @@ -90,6 +98,9 @@ spec:
- name: gcs-iam-secret
mountPath: "/account"
{{- end }}
{{- with .Values.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
livenessProbe:
tcpSocket:
port: {{ .Values.controller.port }}
Expand Down Expand Up @@ -158,6 +169,9 @@ spec:
secret:
secretName: {{ .Values.cluster.storage.gs.secretName }}
{{- end }}
{{- with .Values.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
Expand Down
13 changes: 13 additions & 0 deletions helm/templates/minion/statefulset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ spec:
annotations:
{{- toYaml .Values.minion.podAnnotations | nindent 8 }}
spec:
{{- with .Values.initContainers }}
initContainers:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: pinot-minion
image: {{ include "pinot.image" . }}
Expand All @@ -45,6 +49,9 @@ spec:
env:
- name: JAVA_OPTS
value: "{{ .Values.minion.jvmOpts }} -Dlog4j2.configurationFile={{ .Values.minion.log4j2ConfFile }} -Dplugins.dir={{ .Values.minion.pluginsDir }} -Djute.maxbuffer=4194304 {{ if .Values.minion.jmx.enabled }}{{ .Values.minion.jmx.opts }}{{ end }}"
{{- with .Values.extraEnvs }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http-minion
containerPort: {{ .Values.minion.port }}
Expand All @@ -68,6 +75,9 @@ spec:
- name: pinot-minion-storage
mountPath: "{{ .Values.minion.persistence.mountPath }}"
{{- end }}
{{- with .Values.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
# livenessProbe:
# httpGet:
# path: /health
Expand Down Expand Up @@ -123,6 +133,9 @@ spec:
secret:
secretName: {{ .Values.cluster.storage.gs.secretName }}
{{- end }}
{{- with .Values.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
Expand Down
13 changes: 13 additions & 0 deletions helm/templates/server/statefulset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ spec:
{{- end }}
annotations: {{ toYaml $tier.podAnnotations | nindent 8 }}
spec:
{{- with .Values.initContainers }}
initContainers:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: pinot-server
image: {{ include "pinot.image" $ }}
Expand Down Expand Up @@ -82,6 +86,9 @@ spec:
containerPort: {{ $tier.jmx.port }}
protocol: TCP
{{- end }}
{{- with .Values.extraEnvs }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: config
mountPath: /var/pinot/server/config
Expand All @@ -94,6 +101,9 @@ spec:
- name: gcs-iam-secret
mountPath: "/account"
{{- end }}
{{- with .Values.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if $tier.livenessProbe.enabled }}
livenessProbe:
tcpSocket:
Expand Down Expand Up @@ -163,6 +173,9 @@ spec:
secret:
secretName: {{ $.Values.cluster.storage.gs.secretName }}
{{- end }}
{{- with .Values.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if $.Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml $.Values.imagePullSecrets | nindent 8 }}
Expand Down
8 changes: 8 additions & 0 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ image:

imagePullSecrets: []

initContainers: []

extraVolumes: []

extraVolumeMounts: []

extraEnvs: []

cluster:
name: pinot
storage:
Expand Down

0 comments on commit ae09917

Please sign in to comment.