Skip to content

Add revision labels to PodTemplates in order to automatically rotate Deployments#161

Open
xrstf wants to merge 1 commit intokcp-dev:mainfrom
xrstf:revision-labels
Open

Add revision labels to PodTemplates in order to automatically rotate Deployments#161
xrstf wants to merge 1 commit intokcp-dev:mainfrom
xrstf:revision-labels

Conversation

@xrstf
Copy link
Contributor

@xrstf xrstf commented Feb 25, 2026

Summary

This PR adds "revision labels" to the PodTemplates in the Deployments managed by the kcp-operator: One label for each mounted Secret/ConfigMap, containing those objects' resource version.

The usecase is to automatically rotate Deployments whenever Secrets change, which happens every time a Certificate is renewed or changed (like a new organization being added).

The new middleware will return an error if a mounted object does not exist yet, so while a new Shard or RootShard or FrontProxy is being rolled out, a lot of errors would happen until all Certificates have been issued by cert-manager. To avoid spamming the logs, the operator swallows these errors and relies on it watching the Secrets to reconcile again later. The other alternative would be to skip labels for non-existent mounted Secrets, but this will just lead to lots of pointless pods being created (pointless because even though the operator ignores the missing Secrets, Kubernetes cannot and so the Pods would all be in ContainerCreating). This feels worse than holding off the Deployment creation.

What Type of PR Is This?

/kind feature

Release Notes

Add revision labels to PodTemplates in order to automatically rotate Deployments whenever a mounted Secret changes.

@kcp-ci-bot kcp-ci-bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the DCO. labels Feb 25, 2026
@kcp-ci-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign mjudeikis for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kcp-ci-bot kcp-ci-bot added do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Feb 25, 2026
@xrstf
Copy link
Contributor Author

xrstf commented Feb 25, 2026

/kind feature

@kcp-ci-bot kcp-ci-bot added kind/feature Categorizes issue or PR as related to a new feature. and removed do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Feb 25, 2026
…Deployments

On-behalf-of: @SAP christoph.mewes@sap.com
@xrstf xrstf changed the title WIP Add revision labels to PodTemplates in order to automatically rotate Deployments Feb 25, 2026
@xrstf xrstf requested a review from ntnn February 25, 2026 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants