Closed qinqon closed 4 days ago
I0613 05:33:50.857824 16 kube.go:154] Setting annotations map[k8s.ovn.org/active-network:hllj2_tenant-blue] on namespace primary-network-5868
E0613 05:33:50.859357 16 kube.go:163] Error in setting annotation on namespace primary-network-5868: namespaces "primary-network-5868" is forbidden: User "system:serviceaccount:ovn-kubernetes:ovnkube-cluster-manager" cannot patch resource "namespaces/status" in API group "" in the namespace "primary-network-5868"
I0613 05:33:50.859414 16 network_attach_def_controller.go:239] cluster-manager: Finished syncing net-attach-def primary-network-5868/tenant-blue: 1.870971ms
I0613 05:33:50.859462 16 network_attach_def_controller.go:272] "Error syncing net-attach-def, retrying" net-attach-def="primary-network-5868/tenant-blue" err="failed ensuring namespace active network: failed annotating namespace 'primary-network-5868' with the active network 'hllj2_tenant-blue'"
Optimistic locking is not working at the annotation utilities, we have to fix it for this PR to work.
https://github.com/ovn-org/ovn-kubernetes/pull/4462 will superceed this, this is currently only a placeholder to unblock people by building on top. @qinqon let's close this?
Superceed by https://github.com/ovn-org/ovn-kubernetes/pull/4462
What this PR does and why is it needed
This change annotate a namespace with
k8s.ovn.org/active-network
selecting the network used for the pod primary interface, by default all the namespaces will containk8s.ovn.org/active-network=default
and if a primary network is configured at a namespace using a network attachment definition the annotation will bek8s.ovn.org/active-network=[network]
.Special notes for reviewers
Stuff that will be done at follow up PRs:
How to verify it
The PR included e2e test to cover the success scenarios and some "unknown" and nad delete scenarios.
Details to documentation updates
Documentation will be done at follow up PRs.
Description for the changelog
Annotate namespaces with
k8s.ovn.org/active-network
Does this PR introduce a user-facing change?
NONE