Skip to content

Commit d19ad96

Browse files
authored
feat: Add KUBERNETES_NODE_NAME env var to operator Pods (#537)
* feat: Add KUBERNETES_NODE_NAME env var to operator Pods * docs: Mention clap arguments * Update docs
1 parent 1892311 commit d19ad96

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

template/deploy/helm/[[operator]]/templates/deployment.yaml.j2

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,26 @@ spec:
4343
- mountPath: /etc/stackable/{{ include "operator.appname" . }}/config-spec
4444
name: config-spec
4545
env:
46+
# The following env vars are passed as clap (think CLI) arguments to the operator.
47+
# They are picked up by clap using the structs defied in the operator.
48+
# (which is turn pulls in https://github.com/stackabletech/operator-rs/blob/main/crates/stackable-operator/src/cli.rs)
49+
# You can read there about the expected values and purposes.
50+
51+
# Sometimes products need to know the operator image, e.g. the opa-bundle-builder OPA
52+
# sidecar uses the operator image.
4653
- name: OPERATOR_IMAGE
4754
# Tilt can use annotations as image paths, but not env variables
4855
valueFrom:
4956
fieldRef:
5057
fieldPath: metadata.annotations['internal.stackable.tech/image']
58+
59+
# Operators need to know the node name they are running on, to e.g. discover the
60+
# Kubernetes domain name from the kubelet API.
61+
- name: KUBERNETES_NODE_NAME
62+
valueFrom:
63+
fieldRef:
64+
fieldPath: spec.nodeName
65+
5166
{{- if .Values.kubernetesClusterDomain }}
5267
- name: KUBERNETES_CLUSTER_DOMAIN
5368
value: {{ .Values.kubernetesClusterDomain | quote }}

0 commit comments

Comments
 (0)