From 6aecbffd6202579e94fdd8fbfdd208428c60d4f5 Mon Sep 17 00:00:00 2001 From: TheMeinerLP Date: Wed, 25 Nov 2026 11:02:38 +0100 Subject: [PATCH] feat(chart): pass agent token hashes to the controller The controller reads GRUS_AGENT_TOKENS to authenticate agent hosts, but the chart never set it. Add agents.tokens.existingSecret and key; when the Secret is named, the controller gets the variable from it. The Secret holds only SHA-256 hashes of the agent tokens. --- deploy/helm/grus/templates/deployment.yaml | 7 +++++++ deploy/helm/grus/values.yaml | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/deploy/helm/grus/templates/deployment.yaml b/deploy/helm/grus/templates/deployment.yaml index fe6dcd5..1d486c1 100644 --- a/deploy/helm/grus/templates/deployment.yaml +++ b/deploy/helm/grus/templates/deployment.yaml @@ -145,6 +145,13 @@ spec: secretKeyRef: name: {{ required "adminToken.existingSecret is required: name an existing Secret that holds the admin token" .Values.adminToken.existingSecret }} key: {{ .Values.adminToken.key | quote }} + {{- if .Values.agents.tokens.existingSecret }} + - name: GRUS_AGENT_TOKENS + valueFrom: + secretKeyRef: + name: {{ .Values.agents.tokens.existingSecret | quote }} + key: {{ .Values.agents.tokens.key | quote }} + {{- end }} {{- range $name, $value := .Values.controller.extraEnv }} - name: {{ $name }} value: {{ $value | quote }} diff --git a/deploy/helm/grus/values.yaml b/deploy/helm/grus/values.yaml index c4c290e..4e428c6 100644 --- a/deploy/helm/grus/values.yaml +++ b/deploy/helm/grus/values.yaml @@ -23,6 +23,15 @@ adminToken: # Key inside that Secret. key: GRUS_ADMIN_TOKEN +agents: + tokens: + # Optional. Existing Secret with the agent token hashes (GRUS_AGENT_TOKENS). The value has the form + # host=[,host2=...]. Only hashes belong in the Secret, never the plain + # tokens; see deploy/agent/README.md. Empty means no agent host can authenticate. + existingSecret: "" + # Key inside that Secret. + key: GRUS_AGENT_TOKENS + controller: # Base URL that instances use to reach the controller. Empty means the in-cluster Service URL # http://..svc.cluster.local:.