Skip to content

Fix api key from valueFrom being ignored when rendered without cluster access - #521

Open
SDkie wants to merge 1 commit into
qdrant:mainfrom
SDkie:fix-external-api-key-template
Open

SDkie wants to merge 1 commit into
qdrant:mainfrom
SDkie:fix-external-api-key-template

Conversation

@SDkie

@SDkie SDkie commented Oct 24, 2026

Copy link
Copy Markdown

Fixes #249, fixes #346

Problem

With apiKey.valueFrom.secretKeyRef (or readOnlyApiKey.valueFrom), the chart used lookup to copy the
referenced secret into <release>-apikey. Without cluster access during rendering (ArgoCD, Flux,
helm template) lookup returns nothing, so the secret is created empty, local.yaml is mounted as an
empty directory and Qdrant starts without authentication, while ArgoCD reports Synced/Healthy.

Change

  • Pass valueFrom keys to Qdrant as QDRANT__SERVICE__API_KEY / QDRANT__SERVICE__READ_ONLY_API_KEY
    env vars, so the kubelet reads the user's secret at pod start. Nothing is read from the cluster at render time.
  • Only create and mount <release>-apikey when it holds a string or generated (true) key.
  • ServiceMonitor credentials point at the user's secret when valueFrom is used.
  • String and true keys render exactly as before.

Testing

  • make lint, make test-unit, make test-integration (32/32 pass)
  • New test/integration/external_api_key_template.bats: deploys with helm template | kubectl apply and checks
    correct key → 200, no key / wrong key → 401. The 401 checks fail on main (200) and pass with this change.
  • Added a "no key → 401" check to external_api_key.bats.
  • ArgoCD in a kind cluster with apiKey.valueFrom: on main, no key / wrong key → 200; with this branch → 401, correct key → 200.

Notes for users upgrading

  • The previously copied <release>-apikey secret is no longer part of the chart when only valueFrom keys are used.
    Helm removes it on upgrade; ArgoCD shows it as OutOfSync until it is pruned.
  • Pods no longer restart on helm upgrade when only the referenced secret changes; restart them or use a tool like Reloader.

…r access

Pass apiKey/readOnlyApiKey valueFrom to Qdrant as QDRANT__SERVICE__* env vars instead of copying
the secret with lookup, which returns nothing under ArgoCD/helm template and left Qdrant without auth.
Only create and mount the chart secret for string or generated keys; point ServiceMonitor at the user's secret.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Generating apiKey ArgoCD doesn't support helm k8s lookup and thus qdrant existing secret lookup fails

1 participant