Skip to content

feat(ingress-controller): support annotations on the webhook configuration - #1004

Merged
AlinsRan merged 3 commits into
apache:masterfrom
ahmedgabers:feat/ic-webhook-annotations
Oct 26, 2026
Merged

AlinsRan merged 3 commits into
apache:masterfrom
ahmedgabers:feat/ic-webhook-annotations

Conversation

@ahmedgabers

Copy link
Copy Markdown
Contributor

The ValidatingWebhookConfiguration renders with no annotations, so external CA managers cannot attach to it. With webhook.certificate.provided, operators supply a serving certificate (commonly a cert-manager Certificate) but must hand-copy the CA into webhook.certificate.caBundle and re-copy it whenever it rotates.

An webhook.annotations knob lets cert-manager's cainjector own the caBundle instead (cert-manager.io/inject-ca-from: <namespace>/<certificate>) — the standard pattern for webhook trust management.

Verified with helm template: the annotation renders onto the webhook configuration when set; unset output is byte-identical to today. Chart version bumped 1.3.0 -> 1.3.1; values doc comment and README row updated.

…ation

The ValidatingWebhookConfiguration renders with no annotations, so
external CA managers cannot be attached to it. With
webhook.certificate.provided, operators supply a serving cert (commonly
a cert-manager Certificate) but must hand-copy the CA into
webhook.certificate.caBundle and re-copy it on rotation. An annotations
knob lets cert-manager's cainjector own the caBundle instead
(cert-manager.io/inject-ca-from), the standard pattern for
webhook trust.
@ahmedgabers

Copy link
Copy Markdown
Contributor Author

Fixes #1006.

…o 1.4.1

Regenerate README with helm-docs so the webhook.annotations row is in
alphanum order, and note that cainjector must only be used with
webhook.certificate.provided=true and caBundle unset.
@AlinsRan

Copy link
Copy Markdown
Contributor

Thanks @ahmedgabers. I pushed two commits to this branch to get it mergeable:

  1. Merged master to resolve the Chart.yaml conflict. 1.3.1 was already released by fix(apisix-ingress-controller): pdb.yaml references undefined helpers, release 1.3.1 #1009, and master is now at 1.4.0, so the chart is bumped to 1.4.1.
  2. Regenerated the README with helm-docs. CI runs helm-docs with alphanum sorting, so the webhook.annotations row has to sit above webhook.certificate.provided.
  3. Scoped the CA injection in the values docs. With webhook.certificate.provided: false, the chart generates its own CA and serving cert. If an inject-ca-from annotation is also set, cainjector replaces caBundle with a different CA, and the TLS handshake to the webhook fails. That failure is silent under the default failurePolicy: Ignore, and blocks all CREATE/UPDATE under Fail. The comment now reads:
  # -- Annotations for the ValidatingWebhookConfiguration, e.g.
  # `cert-manager.io/inject-ca-from: <namespace>/<certificate>` so
  # cert-manager's cainjector maintains the webhook caBundle.
  # Only use CA injection with `certificate.provided: true` and `certificate.caBundle` unset;
  # otherwise the injected CA replaces the chart-generated one and the webhook TLS handshake fails.
  annotations: {}

Verified locally: helm lint passes, and with default values the rendered manifests match master (apart from the chart label and the generated certificates).

@AlinsRan
AlinsRan merged commit e1f8bf6 into apache:master Oct 26, 2026
2 checks passed
@AlinsRan AlinsRan self-assigned this Oct 26, 2026
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.

3 participants