Skip to content

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

Merged
kcp-ci-bot merged 1 commit intokcp-dev:mainfrom
xrstf:revision-labels
Mar 4, 2026
Merged

Add revision labels to PodTemplates in order to automatically rotate Deployments#161
kcp-ci-bot merged 1 commit intokcp-dev:mainfrom
xrstf:revision-labels

Conversation

@xrstf
Copy link
Copy Markdown
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. 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
Copy Markdown
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
Copy link
Copy Markdown
Member

@ntnn ntnn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@kcp-ci-bot kcp-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Mar 3, 2026
@kcp-ci-bot
Copy link
Copy Markdown
Contributor

LGTM label has been added.

DetailsGit tree hash: b8dd8b6f7b62e7c5316728f3324914eeebaf2377

@xrstf
Copy link
Copy Markdown
Contributor Author

xrstf commented Mar 4, 2026

/approve

@kcp-ci-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ntnn, xrstf

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

The pull request process is described 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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 4, 2026
@kcp-ci-bot kcp-ci-bot merged commit 1f6e574 into kcp-dev:main Mar 4, 2026
12 checks passed
@xrstf xrstf deleted the revision-labels branch March 4, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. 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.

3 participants