Repository navigation
Conversation
moonming
left a comment
There was a problem hiding this comment.
Thanks for adding a deterministic opt-in path, @cvas22! I rendered this branch twice with webhook.certManager.enabled=true: the output is identical, no chart-managed Secret is rendered, and caBundle is left to cainjector. The Certificate and inject-ca-from names also line up.
A few changes are needed before merging:
- Give the default SelfSigned Certificate a non-empty
subjectorcommonName. cert-manager's SelfSigned documentation warns about an empty Issuer DN andBadConfigevents. - Handle upgrades where old coalesced values do not contain
webhook.certManager, such as--reuse-values. Removing that new map to simulate the old defaults currently causes a nil-pointer error. - Add committed render tests for repeatability and the new modes, plus live cert-manager/cainjector coverage for issuance, CA injection, renewal, and upgrade.
- Rebase and update the chart version from the already-released 1.5.0.
Since the default certManager.enabled=false path still generates random certificates, please use Refs #993 or Partially addresses #993 rather than closing that issue automatically. This is a valuable opt-in improvement; the default-path follow-up can remain tracked separately. Thanks again!
6647799 to
72ef855
Compare
|
Pushed 72ef855: the Certificate now has a commonName, the template copes with values that have no webhook.certManager (the --reuse-values case), I rebased and bumped the chart to 1.6.0, and the PR now says Refs #993. I also added render tests and an e2e script with cert-manager in kind (issuance, CA injection, renewal, upgrade from 1.5.0) plus a CI job. The render tests pass locally, but I couldn't run the e2e one here, so CI will be its first run. thx |
moonming
left a comment
There was a problem hiding this comment.
Thanks for the quick follow-up, @cvas22! The commonName, missing-values handling, chart version, and PR scope now look good. I ran the render suite through bash: all 31 checks passed.
I found a few issues in the new CI/E2E path that we should fix before running it:
- Both new shell scripts have mode 100644, while the workflow invokes them directly. Please mark them executable, or invoke them with
bash, to avoidPermission denied. - The second release reuses the cluster-scoped
IngressClass/apisixcreated by the first release. Helm will reject the second installation because of ownership metadata. Please give the upgrade release its own class, for example--set config.kubernetes.ingressClass=apisix-upgrade, and preserve it during the subsequent upgrades. - The normal Helm upgrade at
test/e2e/webhook-cert-manager.shis not wrapped incheck, and the script does not useset -e. If that upgrade fails, the unchanged serial and CA checks can still pass. Please assert that the upgrade itself succeeds before checking those invariants.
Two smaller cleanup items: use fixed release names in the cleanup trap so the first release is not left behind, and consider a short stable commonName such as apisix-ingress-webhook; the full Service DNS names are already in dnsNames, while a long FQDN can exceed the recommended commonName length.
Once those are fixed, we can run the full Helm 3/4 and cert-manager E2E matrix. Thanks again for adding this coverage!
…ager The chart generates the webhook CA and certificate with genCA/genSignedCert and keeps the live ones with lookup. Tools that render offline, like Argo CD, can't run lookup, so every render produced new certificates and a new caBundle, leaving the app OutOfSync and rotating the webhook trust chain on each automated sync. Add webhook.certManager. When enabled the chart renders a cert-manager Certificate (and a self-signed Issuer unless issuerRef is set), annotates the ValidatingWebhookConfiguration with cert-manager.io/inject-ca-from and leaves caBundle to the cainjector, so repeated renders are identical. It can't be combined with certificate.provided. Default behavior is unchanged. Refs apache#993 Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
72ef855 to
fe52959
Compare
|
Fixed in fe52959: both scripts are executable now, the upgrade release has its own ingress class (apisix-upgrade), the plain helm upgrade is wrapped in a check, the cleanup uses fixed release names, and the commonName is now apisix-ingress-webhook. Render tests still pass, the e2e one hasn't run yet. thx |
moonming
left a comment
There was a problem hiding this comment.
Thanks for the quick fixes, @cvas22! The full CI matrix is green on fe52959. Both Helm 3.22.1 and 4.2.4 passed all 31 render checks and all 15 live cert-manager E2E checks, including issuance, CA injection, renewal, normal upgrade, and migration from chart 1.5.0. I also verified the final render suite locally. Approving.
Refs #993
The ingress controller chart generates the webhook CA and cert with
genCA/genSignedCertand relies onlookupto keep the live ones. Argo CD renders offline, solookupreturns nothing and every comparison wants a new Secret andcaBundle. The app never settles and an automated sync rotates the webhook trust chain.This adds the cert-manager path suggested in the issue:
When it's on, the chart renders a
Certificatefor the webhook service (writing into the same secret name the deployment already mounts), a self-signedIssuerunlessissuerRefis set, addscert-manager.io/inject-ca-fromto the ValidatingWebhookConfiguration and leavescaBundleout so the cainjector fills it. Nothing is generated at render time, so twohelm templateruns with the same input give identical output. Combining it withcertificate.providedfails with a clear message. With it off (the default) nothing changes.Notes
I checked it with
helm template: the default render is the same as before, two renders withcertManager.enabled=truehash the same, there's nocaBundlein that mode, the customissuerRefdrops the self-signed Issuer, and enabling both options fails. Bumped the chart to 1.5.0 since it's a new option and added the README rows the way helm-docs lays them out. I didn't run it against a live cluster with cert-manager, so a second pair of eyes there would be nice.