helm: add Kubernetes discovery support (#13262)

The K8 discovery mechanism, enabled by the druid-kubernetes-extension,
relies on each pod advertising its name and namespace on the env
variables POD_NAME and POD_NAMESPACE [1]. Add env variables to all
deployments/statefulsets.

[1] https://druid.apache.org/docs/latest/development/extensions-core/kubernetes.html

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>

Signed-off-by: Alejandro del Castillo <alejandro.delcastillo@ni.com>
This commit is contained in:
Alejandro del Castillo 2022-10-28 04:39:48 -05:00 committed by GitHub
parent 32020247d1
commit de7ef81dff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 0 deletions

View File

@ -52,6 +52,10 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: [ "broker" ]
env:
- name: POD_NAME
valueFrom: {fieldRef: {fieldPath: metadata.name}}
- name: POD_NAMESPACE
valueFrom: {fieldRef: {fieldPath: metadata.namespace}}
{{- range $key, $val := .Values.broker.config }}
- name: {{ $key }}
value: {{ $val | quote }}

View File

@ -52,6 +52,10 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: [ "coordinator" ]
env:
- name: POD_NAME
valueFrom: {fieldRef: {fieldPath: metadata.name}}
- name: POD_NAMESPACE
valueFrom: {fieldRef: {fieldPath: metadata.namespace}}
{{- range $key, $val := .Values.coordinator.config }}
- name: {{ $key }}
value: {{ $val | quote }}

View File

@ -95,6 +95,10 @@ spec:
- name: druid
args: [ "historical" ]
env:
- name: POD_NAME
valueFrom: {fieldRef: {fieldPath: metadata.name}}
- name: POD_NAMESPACE
valueFrom: {fieldRef: {fieldPath: metadata.namespace}}
{{- range $key, $val := .Values.historical.config }}
- name: {{ $key }}
value: {{ $val | quote }}

View File

@ -95,6 +95,10 @@ spec:
- name: druid
args: [ "middleManager" ]
env:
- name: POD_NAME
valueFrom: {fieldRef: {fieldPath: metadata.name}}
- name: POD_NAMESPACE
valueFrom: {fieldRef: {fieldPath: metadata.namespace}}
{{- range $key, $val := .Values.middleManager.config }}
- name: {{ $key }}
value: {{ $val | quote }}

View File

@ -52,6 +52,10 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: [ "overlord" ]
env:
- name: POD_NAME
valueFrom: {fieldRef: {fieldPath: metadata.name}}
- name: POD_NAMESPACE
valueFrom: {fieldRef: {fieldPath: metadata.namespace}}
{{- range $key, $val := .Values.overlord.config }}
- name: {{ $key }}
value: {{ $val | quote }}

View File

@ -52,6 +52,10 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: [ "router" ]
env:
- name: POD_NAME
valueFrom: {fieldRef: {fieldPath: metadata.name}}
- name: POD_NAMESPACE
valueFrom: {fieldRef: {fieldPath: metadata.namespace}}
{{- range $key, $val := .Values.router.config }}
- name: {{ $key }}
value: {{ $val | quote }}