(tunnel_ca) allow tunnel ca to be generated externally - #5252
Open
asincu wants to merge 1 commit into
Open
Conversation
The tunnel CA doubles as voltron's tunnel server certificate, so its DNS SAN is the SNI managed clusters dial. In Calico Cloud that CA is generated by TDS and delivered as a sealed secret, carrying the cluster's fully qualified name instead of the SAN the operator would default to. Add the calicocloud.io/external-tunnel-ca annotation, read from the Tenant in multi-tenant mode and the ManagementCluster otherwise. When set, the operator waits for the tunnel secret rather than self-signing one and consumes it without writing it back. Single-tenant installs still copy it into tigera-manager, where voltron mounts it from. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for consuming a Voltron tunnel CA that is provisioned externally (instead of self-signed by the operator), keyed off a calicocloud.io/external-tunnel-ca annotation on the appropriate resource (Tenant for multi-tenant; ManagementCluster for single-tenant). This ensures Calico Cloud deployments can provide a tunnel certificate with the correct DNS SAN (managed cluster SNI) without the operator racing to create a defaulted cert.
Changes:
- Introduces
ExternalTunnelCAAnnotationandexternallyManagedTunnelCA()helper to determine when the tunnel CA should be treated as externally owned. - Updates manager reconciliation logic to (a) wait for the tunnel secret when external management is enabled, and (b) avoid writing back / taking ownership of externally delivered secrets while still copying into the install namespace where required.
- Adds unit/integration-style controller tests covering single-tenant and multi-tenant externally managed tunnel CA behavior and annotation parsing variants.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/controller/manager/manager_controller.go | Adds the external-tunnel-CA annotation gate; updates tunnel secret creation/copy behavior to avoid ownership conflicts and to wait for externally delivered secrets. |
| pkg/controller/manager/manager_controller_test.go | Adds test coverage for externally managed tunnel CA scenarios in both tenancy modes and for annotation parsing behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+122
to
+124
| logc.Error(err, "Ignoring unparseable annotation value, the operator will sign the tunnel CA itself", | ||
| "annotation", ExternalTunnelCAAnnotation, "value", value, | ||
| "kind", kind, "name", holder.GetName()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The tunnel CA doubles as voltron's tunnel server certificate, so its DNS SAN is the SNI managed clusters dial. In Calico Cloud that CA is generated by TDS and delivered as a sealed secret, carrying the cluster's fully qualified name instead of the SAN the operator would default to.
Add the calicocloud.io/external-tunnel-ca annotation, read from the Tenant in multi-tenant mode and the ManagementCluster otherwise. When set, the operator waits for the tunnel secret rather than self-signing one and consumes it without writing it back. Single-tenant installs still copy it into tigera-manager, where voltron mounts it from.
Description
Release Note
For PR author
make gen-filesmake gen-versionsFor PR reviewers
A note for code reviewers - all pull requests must have the following:
kind/bugif this is a bugfix.kind/enhancementif this is a a new feature.enterpriseif this PR applies to Calico Enterprise only.