SecretProviderClass should be versioned similar to configmaps #1471
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
lifecycle/frozen
Indicates that an issue or PR should not be auto-closed due to staleness.
Describe the solution you'd like
Let's say we have a service A, which currently depends on 2 secrets, B & C, provided by a
SecretProviderClass
.Then, a new version of A removed the usage of secret C, so it now only need one secret B.
When deploying the new version, 2 things will happen:
SecretProviderClass
being updated to remove C and only provide BBut since 1 is almost immediate while 2 is always a gradual rollout, after 1 is replaced the old pods still requiring both B and C will likely start to fail because the update of
SecretProviderClass
that removed C that they still require.Even if we tweak the order to only do 1 after 2 is fully done, it can still cause the reverse problem (a new version that requires a new secret).
Currently, to avoid this issue we need to be extra careful and do 2-step deploys, first deploy a superset of
SecretProviderClass
that contains the secrets for both new and old version of code with the new code, and after that's fully done, do another deploy to shrinkSecretProviderClass
to only the ones needed by the new version.But I think to fully address this problem, we should make
SecretProviderClass
versioned (similar to how configmaps are versioned), so every pod can use their matching version ofSecretProviderClass
to provide the secrets they need.Anything else you would like to add:
(ported from kubernetes/kubernetes#123955)
Environment:
kubectl version
):1.27.10
The text was updated successfully, but these errors were encountered: