Skip to content

Conversation

@rahul810050
Copy link

chore(backend): add TLS certificate rotation documentation and helper scripts. Fixes #12328

Description of your changes:

This PR adds missing documentation for TLS certificate rotation required when using the pod-to-pod TLS feature introduced in PR #12082. When TLS secrets are renewed, backend services (API server, persistence agent, metadata writer, cache server, etc.) do not automatically reload updated certificate data. A rolling restart is required. This behavior was previously undocumented.

The updates included in this PR:

  1. Documentation update (backend/README.md):

    • Added a new section “TLS Certificate Rotation (Pod-to-Pod TLS)”.
    • Explained why certificate rotation is needed, how secrets interact with backend components, and why pods must be restarted.
    • Added a complete, copy-paste-ready rotation procedure:
      • Generate/obtain new TLS certs (server.crt / server.key)
      • Update the TLS secret using kubectl create secret tls ... | kubectl apply -f -
      • Restart affected deployments with kubectl rollout restart
      • Verify rollouts and confirm certificate is active.
    • Added best practices, troubleshooting notes, common errors, and automation guidance (cert-manager + checksum annotations).
    • Added cluster discovery commands to help users identify the exact secret and deployments referencing it.
  2. Helper scripts added (optional but helpful for operators):

    • scripts/find-tls-refs.sh
      Identifies which pods/deployments reference the TLS secret (via volumes or env secretKeyRef).
      Helps operators know exactly which deployments must be restarted.
    • scripts/rotate-tls.sh
      Applies new TLS cert/key to the Kubernetes Secret and automatically restarts all deployments referencing the secret, waiting for rollout completion.
  3. General improvements:

    • Normalized README formatting.
    • Ensured all examples are reproducible and use correct fenced code blocks.
    • Provided safer and clearer operational guidance for cluster administrators.

These changes directly address the missing operational documentation noted in issue #12328 and align with the maintainers’ suggestion to include example commands.


Checklist:


Links

@google-oss-prow
Copy link

[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 chensun for approval. For more information see the Kubernetes Code Review Process.

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

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

@google-oss-prow
Copy link

Hi @rahul810050. Thanks for your PR.

I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@@ -1,359 +1,194 @@
# Kubeflow Pipelines Backend
# Kubeflow Pipelines backend API
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like you've made some changes to this file that are out of scope for this PR - would you mind reverting the changes that are separate from ## TLS Certificate Rotation (Pod-to-Pod TLS)?

[Delve](https://github.com/go-delve/delve), builds the binary without compiler optimizations so the binary matches the
source code (via `GCFLAGS="all=-N -l"`), and copies the source code to the destination container for the debugger.
Any changes to the Driver code will require rebuilding this container image.
# Update the Kubernetes TLS secret
Copy link
Contributor

Choose a reason for hiding this comment

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

A couple of your headings (including this one) have incorrect formatting - as this is a sub-heading below Recommended rotation procedure, it should be preceded by ####

### Context

You can also access the Kubeflow Pipelines web interface at [http://localhost:3000](http://localhost:3000).
When pod-to-pod TLS is enabled (see PR #12082), backend components (API server, launcher, persistence agent, cache, metadata writer, etc.) use TLS certificates stored in Kubernetes Secret(s). These certificates expire and must be rotated periodically. Updating the Secret object does not automatically make running pods load the new certificate: a restart (rolling restart) of the affected deployments is required so that they mount/read the new secret.
Copy link
Contributor

Choose a reason for hiding this comment

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

You don't need to reference the PR here

```bash
mysql -h 127.0.0.1 -u root
```
### Which secrets and components are typically impacted
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove "typically", as the same deployments will be impacted each time

kubectl -n kubeflow scale deployment ml-pipeline-scheduledworkflow --replicas=0
```
* `pipelines-api-server`
* `pipelines-persistenceagent`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `pipelines-persistenceagent`
* `ml-pipeline-persistenceagent`

```bash
kubectl -n kubeflow scale deployment ml-pipeline-scheduledworkflow --replicas=0
```
* `pipelines-api-server`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `pipelines-api-server`
* `ml-pipeline-apiserver`

```
* `pipelines-api-server`
* `pipelines-persistenceagent`
* `pipelines-metadata-writer`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* `pipelines-metadata-writer`
* `metadata-writer`

* `pipelines-api-server`
* `pipelines-persistenceagent`
* `pipelines-metadata-writer`
* `pipelines-cache`
Copy link
Contributor

Choose a reason for hiding this comment

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

cache deployment does not require CA cert

* `pipelines-persistenceagent`
* `pipelines-metadata-writer`
* `pipelines-cache`
* `(Any other pipeline-related deployments that reference the TLS secret)`
Copy link
Contributor

Choose a reason for hiding this comment

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

Include also:
metadata-envoy-deployment, metadata-grpc-deployment, ml-pipeline-scheduledworkflow, ml-pipeline-ui

@rahul810050
Copy link
Author

Hii @alyssacgoins !!

Thanks for the clarifications!!
I will update the PR soon

…scripts. Fixes kubeflow#12328

Signed-off-by: rahul810050 <rahul810050@gmail.com>
@rahul810050 rahul810050 force-pushed the docs/backend/tls-cert-rotation branch from 1336f6f to 2830e7d Compare November 28, 2025 09:46
@google-oss-prow google-oss-prow bot added size/L and removed size/XL labels Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(backend): Add documentation for TLS cert rotation

2 participants