Skip to content

feat: Add KUBERNETES_NODE_NAME env var to operator Pods #537

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions template/deploy/helm/[[operator]]/templates/deployment.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,26 @@ spec:
- mountPath: /etc/stackable/{{ include "operator.appname" . }}/config-spec
name: config-spec
env:
# The following env vars are passed as clap (think CLI) arguments to the operator.
# They are picked up by clap using the structs defied in the operator.
# (which is turn pulls in https://github.com/stackabletech/operator-rs/blob/main/crates/stackable-operator/src/cli.rs)
# You can read there about the expected values and purposes.

# Sometimes products need to know the operator image, e.g. the opa-bundle-builder OPA
# sidecar uses the operator image.
- name: OPERATOR_IMAGE
# Tilt can use annotations as image paths, but not env variables
valueFrom:
fieldRef:
fieldPath: metadata.annotations['internal.stackable.tech/image']

# Operators need to know the node name they are running on, to e.g. discover the
# Kubernetes domain name from the kubelet API.
- name: KUBERNETES_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName

{{- if .Values.kubernetesClusterDomain }}
- name: KUBERNETES_CLUSTER_DOMAIN
value: {{ .Values.kubernetesClusterDomain | quote }}
Expand Down