Skip to content

Commit 73c73df

Browse files
committed
docs(vertical-pod-autoscaler): clean up dangling references to the retired migrator/rollout hooks
Self-review after the tls-migrator removal caught a stale comment in certificate.yaml still promising that a pre-upgrade hook would strip Helm/Flux ownership so cert-manager could adopt the legacy Secret in place. That hook no longer exists and — as kvaps' review pointed out — could not have done what it claimed anyway: \`Secret.type\` is immutable, so cert-manager cannot rewrite an Opaque Secret in place into a \`kubernetes.io/tls\` one. Rewrite the certificate.yaml secretName comment to describe the actual migration path: Helm garbage-collects the legacy Opaque Secret from the release manifest, cert-manager immediately writes a fresh \`kubernetes.io/tls\` Secret of the same name via this Certificate, and the same-upgrade rollout — driven by the fresh \`checksum/tls-cert\` annotation — brings up a pod that re-registers \`vpa-webhook-config\` with the new caBundle before the delete/ create window on the MWC matters (given failurePolicy: Ignore). Also refresh patches/cert-manager-admission-tls.diff to reflect the comment edit and re-verify end-to-end that \`rm -rf charts && helm pull && patch\` produces a byte-identical tree to what git tracks. 15/15 helm-unittest cases still pass. Signed-off-by: Ivan Okhotnikov <[email protected]>
1 parent 5e65a3e commit 73c73df

2 files changed

Lines changed: 28 additions & 16 deletions

File tree

‎packages/system/vertical-pod-autoscaler/charts/vertical-pod-autoscaler/templates/admission-controller/certificate.yaml‎

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,19 @@ spec:
6464
secretName MUST match the volume mount name in
6565
admission-controller/deployment.yaml, which is driven by
6666
`vertical-pod-autoscaler.admissionController.tls.secretName`. In the
67-
default path this resolves to
68-
`<release>-admission-controller-tls`, which is the exact same name the
69-
legacy genCA Secret uses — so on an upgrade from a pre-cert-manager
70-
chart version cert-manager adopts the existing Secret (see the
71-
pre-upgrade tls-migrator hook that strips Helm/Flux ownership) and
72-
the Deployment volume mount picks up the refreshed content on next
73-
rollout.
67+
default path this resolves to `<release>-admission-controller-tls`
68+
— the exact same name the legacy genCA Secret used. On upgrade from
69+
a pre-cert-manager chart version the legacy Opaque Secret disappears
70+
from the release manifest, Helm garbage-collects it, and cert-manager
71+
immediately writes a fresh Secret of the same name via this
72+
Certificate but with `type: kubernetes.io/tls`. In-place adoption is
73+
NOT possible — `Secret.type` is immutable — so the delete/create
74+
pass is the correct path. The seconds-long window it produces is
75+
benign because the `vpa-webhook-config` MutatingWebhookConfiguration
76+
ships with `failurePolicy: Ignore`, and the Deployment rolls in the
77+
same upgrade (its `checksum/tls-cert` annotation flips as soon as
78+
cert-manager writes the new Secret) — the fresh pod re-registers
79+
the webhook with the new caBundle before the mismatch matters.
7480
*/}}
7581
secretName: {{ include "vertical-pod-autoscaler.admissionController.tls.secretName" . }}
7682
{{- /*

‎packages/system/vertical-pod-autoscaler/patches/cert-manager-admission-tls.diff‎

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
diff --git a/charts/vertical-pod-autoscaler/templates/admission-controller/certificate.yaml b/charts/vertical-pod-autoscaler/templates/admission-controller/certificate.yaml
22
new file mode 100644
3-
index 000000000..883ab5593
3+
index 000000000..b8c0d3a4a
44
--- /dev/null
55
+++ b/charts/vertical-pod-autoscaler/templates/admission-controller/certificate.yaml
6-
@@ -0,0 +1,101 @@
6+
@@ -0,0 +1,107 @@
77
+{{- /*
88
+ cert-manager-managed TLS for the VPA admission-controller webhook.
99
+
@@ -70,13 +70,19 @@ index 000000000..883ab5593
7070
+ secretName MUST match the volume mount name in
7171
+ admission-controller/deployment.yaml, which is driven by
7272
+ `vertical-pod-autoscaler.admissionController.tls.secretName`. In the
73-
+ default path this resolves to
74-
+ `<release>-admission-controller-tls`, which is the exact same name the
75-
+ legacy genCA Secret uses — so on an upgrade from a pre-cert-manager
76-
+ chart version cert-manager adopts the existing Secret (see the
77-
+ pre-upgrade tls-migrator hook that strips Helm/Flux ownership) and
78-
+ the Deployment volume mount picks up the refreshed content on next
79-
+ rollout.
73+
+ default path this resolves to `<release>-admission-controller-tls`
74+
+ — the exact same name the legacy genCA Secret used. On upgrade from
75+
+ a pre-cert-manager chart version the legacy Opaque Secret disappears
76+
+ from the release manifest, Helm garbage-collects it, and cert-manager
77+
+ immediately writes a fresh Secret of the same name via this
78+
+ Certificate but with `type: kubernetes.io/tls`. In-place adoption is
79+
+ NOT possible — `Secret.type` is immutable — so the delete/create
80+
+ pass is the correct path. The seconds-long window it produces is
81+
+ benign because the `vpa-webhook-config` MutatingWebhookConfiguration
82+
+ ships with `failurePolicy: Ignore`, and the Deployment rolls in the
83+
+ same upgrade (its `checksum/tls-cert` annotation flips as soon as
84+
+ cert-manager writes the new Secret) — the fresh pod re-registers
85+
+ the webhook with the new caBundle before the mismatch matters.
8086
+ */}}
8187
+ secretName: {{ include "vertical-pod-autoscaler.admissionController.tls.secretName" . }}
8288
+ {{- /*

0 commit comments

Comments
 (0)