Skip to content

Fix CNI plugin RBAC during manifest-to-operator migration#4514

Merged
caseydavenport merged 2 commits intotigera:masterfrom
caseydavenport:casey/fix-cni-plugin-migration-rbac
Mar 10, 2026
Merged

Fix CNI plugin RBAC during manifest-to-operator migration#4514
caseydavenport merged 2 commits intotigera:masterfrom
caseydavenport:casey/fix-cni-plugin-migration-rbac

Conversation

@caseydavenport
Copy link
Copy Markdown
Member

During manifest-to-operator namespace migration, the operator updates the calico-cni-plugin ClusterRoleBinding to reference calico-system:calico-cni-plugin — but nodes that haven't been migrated yet still have the CNI plugin running as kube-system:calico-cni-plugin. This means pod creation fails on those nodes with permission errors like:

User "system:serviceaccount:kube-system:calico-cni-plugin" cannot get resource
"clusterinformations" in API group "crd.projectcalico.org" at the cluster scope

We already handle this correctly for the calico-node CRB via AddBindingForKubeSystemNode, which adds a kube-system:calico-node subject during migration. The calico-cni-plugin CRB was just missing the same treatment.

The fix adds AddBindingForKubeSystemCNIPlugin (mirroring the existing node pattern) and calls it from cniPluginRoleBinding() when MigrateNamespaces is true.

Related: CI-1949

Fix pod creation failures during manifest-to-operator migration caused by the calico-cni-plugin
ClusterRoleBinding losing its kube-system subject before all nodes are migrated.

During namespace migration, the calico-node ClusterRoleBinding correctly
includes a kube-system subject so that unmigrated nodes retain access.
The calico-cni-plugin ClusterRoleBinding was missing the same treatment,
causing pod creation to fail on not-yet-migrated nodes with:

  "system:serviceaccount:kube-system:calico-cni-plugin" cannot get
  resource "clusterinformations" in API group "crd.projectcalico.org"

Add AddBindingForKubeSystemCNIPlugin and call it from cniPluginRoleBinding
when MigrateNamespaces is true, mirroring the existing calico-node logic.
Copy link
Copy Markdown
Member

@tmjd tmjd left a comment

Choose a reason for hiding this comment

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

LGTM, I appreciate the comment on that new function. Thank you.

@caseydavenport caseydavenport merged commit af80ba3 into tigera:master Mar 10, 2026
6 checks passed
@caseydavenport caseydavenport deleted the casey/fix-cni-plugin-migration-rbac branch March 10, 2026 21:09
caseydavenport added a commit to caseydavenport/operator that referenced this pull request Mar 10, 2026
caseydavenport added a commit to caseydavenport/operator that referenced this pull request Mar 10, 2026
caseydavenport added a commit to caseydavenport/operator that referenced this pull request Mar 10, 2026
caseydavenport added a commit to caseydavenport/operator that referenced this pull request Mar 10, 2026
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.

3 participants