Skip to content

helm: honour webhook.enabled=false at runtime (ENABLE_WEBHOOKS) and add extraEnv - #179

Merged
karimra merged 1 commit into
gnmic:mainfrom
abachir:chart-webhook-disabled-env
Sep 15, 2026
Merged

karimra merged 1 commit into
gnmic:mainfrom
abachir:chart-webhook-disabled-env

Conversation

@abachir

@abachir abachir commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Problem

With webhook.enabled: false the chart stops rendering the webhook port, the certificate volume and the cert-manager Certificate/Issuer/WebhookConfiguration, but the manager still registers its admission webhooks: cmd/main.go gates them on the ENABLE_WEBHOOKS environment variable, which the chart never sets. The manager then starts the webhook server, looks for /tmp/k8s-webhook-server/serving-certs/tls.crt, finds no volume and exits:

problem running manager: open /tmp/k8s-webhook-server/serving-certs/tls.crt: no such file or directory

Observed with chart 0.4.0 on an EKS cluster without cert-manager, where webhooks were disabled for that reason; the same wiring is on main.

Change

  • templates/deployment.yaml: when webhook.enabled is false, set ENABLE_WEBHOOKS=false on the manager container.
  • values.yaml / templates/deployment.yaml: extraEnv passthrough for further environment variables.

helm lint clean. With webhook.enabled=false the render carries the variable; the default render is byte-identical to main.

Opened as a draft for your view on the approach; happy to adjust (for example a dedicated webhook.enabled → flag if you prefer a CLI flag over the environment variable).

…traEnv

With webhook.enabled: false the chart stops rendering the webhook port, the
certificate volume and the cert-manager resources, but the manager still
registers its admission webhooks (cmd/main.go gates them on the
ENABLE_WEBHOOKS environment variable, which the chart never set), starts the
webhook server, looks for /tmp/k8s-webhook-server/serving-certs/tls.crt and
exits. The chart now sets ENABLE_WEBHOOKS=false whenever webhooks are
disabled, so the operator runs without a serving certificate on clusters
without cert-manager. extraEnv is a passthrough for further environment
variables. The default render is unchanged.
@abachir
abachir marked this pull request as ready for review September 14, 2026 22:07
@karimra

karimra commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the contribution!

@karimra
karimra merged commit 4062a0e into gnmic:main Sep 15, 2026
5 checks passed
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.

2 participants