feat: add InfraAnnotations to CloudConfig#396
Conversation
Mirror Service annotations are sourced from tenant Service.Annotations on creation. This adds a new InfraAnnotations field in CloudConfig (yaml: infraAnnotations) mirroring the existing InfraLabels behavior: the operator can set default annotations applied to every mirror Service, overriding any tenant-provided annotation of the same key. Use case: passing infra-cluster-specific LoadBalancer annotations (e.g. cloud provider zone, private network ID, LB class) without requiring tenant-cluster workloads to know about them. Signed-off-by: Paul Thuriot <pth@corti.ai>
|
Hi @pthuriot-corti. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. DetailsInstructions 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-sigs/prow repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
@pthuriot-corti do you know if something similar is done for other providers ? |
|
@qinqon Well, kubevirt CCM is quite unique in the sense that it creates a mirror k8s service in another cluster. |
|
Hey @qinqon , any chance we can move forward on this? |
What this PR does
Adds an
InfraAnnotationsfield toCloudConfig, mirroring the existingInfraLabelsbehavior. The operator can set default annotations applied to every mirror Service created in the infra cluster.InfraAnnotationsoverrides any tenant-Service annotation of the same key, matching the precedence already used forInfraLabels.Why
Today, tenant Services have to carry infra-cluster-specific annotations (e.g. cloud provider zone, private network ID, LB class) for the mirror Service to be provisioned correctly by the infra cluster's CCM. This leaks infra topology into tenant workloads and prevents global operator-side defaults.
With
InfraAnnotations, the cluster operator can set these once in the CCM's cloud-config:Changes
CloudConfig.InfraAnnotations map[string]stringloadbalancerand applied duringEnsureLoadBalancerTests
go test ./pkg/provider/...passes