diff --git a/template/deploy/helm/[[operator]]/templates/deployment.yaml.j2 b/template/deploy/helm/[[operator]]/templates/deployment.yaml.j2 index 2626c3f2..4ff5c593 100644 --- a/template/deploy/helm/[[operator]]/templates/deployment.yaml.j2 +++ b/template/deploy/helm/[[operator]]/templates/deployment.yaml.j2 @@ -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 }}