Describe the Bug
In commit adcb27c, the Nautobot Helm chart introduced support for defining the database user from an existing Kubernetes secret when using an external database (postgresql.enabled=false and existingSecret provided). This change uses the Helm lookup function to dynamically fetch and validate the secret from the cluster, then populates environment variables like NAUTOBOT_DB_USER and NAUTOBOT_DB_PASSWORD using secretKeyRef.
While this enhances security for direct Helm deployments, it breaks compatibility with ArgoCD. ArgoCD does not support the Helm lookup function, as it requires contacting the destination cluster during template rendering, which ArgoCD's rendering process does not allow.
Expected Behavior
The chart should render successfully in ArgoCD without errors related to unsupported Helm functions.
Actual Behavior
When deploying via ArgoCD, the application fails to sync with errors indicating that the lookup function is not supported. This prevents users from using the chart in ArgoCD-managed environments.
Steps to Reproduce
- Configure the Nautobot Helm chart with
postgresql.enabled=false and provide an existingSecret for the database credentials.
- Deploy the chart as an ArgoCD Application.
- Observe sync failures due to the unsupported
lookup function.
References
- Nautobot Helm chart commit introducing the change: adcb27c
- Related ArgoCD issue: argoproj/argo-cd#21745 (This is an open enhancement proposal to add support for
lookup via a --helm-server-dry-run flag, but it's still in progress and not yet implemented.)
Suggested Fix
To maintain compatibility with ArgoCD (a common tool for GitOps deployments), consider one of the following:
- Make the
lookup usage optional, controlled by a new value (e.g., useLookupFunction: true). When disabled, fall back to a non-lookup method, such as assuming the secret exists without validation or providing a warning in the docs.
- Document a workaround in the chart's README, such as using ArgoCD's Helm hooks or post-renderers to handle secret fetching externally.
- If feasible, explore alternative Helm patterns that avoid
lookup entirely while still supporting existing secrets (e.g., using required for validation without cluster queries).
This would allow users to deploy Nautobot via ArgoCD without waiting for upstream fixes in ArgoCD.
Environment
- Nautobot Helm chart version: 3.0.1
- ArgoCD version: 3.2.0
- Kubernetes version: 1.34.1
Thanks for considering this! Let me know if more details are needed.
Describe the Bug
In commit adcb27c, the Nautobot Helm chart introduced support for defining the database user from an existing Kubernetes secret when using an external database (
postgresql.enabled=falseandexistingSecretprovided). This change uses the Helmlookupfunction to dynamically fetch and validate the secret from the cluster, then populates environment variables likeNAUTOBOT_DB_USERandNAUTOBOT_DB_PASSWORDusingsecretKeyRef.While this enhances security for direct Helm deployments, it breaks compatibility with ArgoCD. ArgoCD does not support the Helm
lookupfunction, as it requires contacting the destination cluster during template rendering, which ArgoCD's rendering process does not allow.Expected Behavior
The chart should render successfully in ArgoCD without errors related to unsupported Helm functions.
Actual Behavior
When deploying via ArgoCD, the application fails to sync with errors indicating that the
lookupfunction is not supported. This prevents users from using the chart in ArgoCD-managed environments.Steps to Reproduce
postgresql.enabled=falseand provide anexistingSecretfor the database credentials.lookupfunction.References
lookupvia a--helm-server-dry-runflag, but it's still in progress and not yet implemented.)Suggested Fix
To maintain compatibility with ArgoCD (a common tool for GitOps deployments), consider one of the following:
lookupusage optional, controlled by a new value (e.g.,useLookupFunction: true). When disabled, fall back to a non-lookup method, such as assuming the secret exists without validation or providing a warning in the docs.lookupentirely while still supporting existing secrets (e.g., usingrequiredfor validation without cluster queries).This would allow users to deploy Nautobot via ArgoCD without waiting for upstream fixes in ArgoCD.
Environment
Thanks for considering this! Let me know if more details are needed.