Add some missing permissions to the calico-kube-controller - #18
Open
james-callahan wants to merge 3 commits into
Open
Add some missing permissions to the calico-kube-controller#18james-callahan wants to merge 3 commits into
james-callahan wants to merge 3 commits into
Conversation
Without this permission, the controller logs errors of: ``` 2026-09-02 04:38:30.872 [ERROR][14] kube-controllers/policy_name_migrator.go 239: Error getting calico-node DaemonSet: daemonsets.apps "calico-node" is forbidden: User "system:serviceaccount:calico:calico-kube-controllers" cannot get resource "daemonsets" in API group "apps" in the namespace "calico" ``` Upstream grants this more broadly: as a ClusterRole across all daemonsets, and grants write access; but we want to be more precise
Without this the controller logs errors: ``` 2026-09-02 04:44:42.131 [INFO][14] kube-controllers/watchercache.go 243: Full resync is required ListRoot=".../v3/pc.org/stagednetworkpolicies" 2026-09-02 04:44:42.131 [INFO][14] kube-controllers/watchercache.go 243: Full resync is required ListRoot=".../v3/pc.org/globalnetworkpolicies" 2026-09-02 04:44:42.132 [INFO][14] kube-controllers/watchercache.go 243: Full resync is required ListRoot=".../v3/pc.org/stagedglobalnetworkpolicies" 2026-09-02 04:44:42.132 [INFO][14] kube-controllers/watchercache.go 243: Full resync is required ListRoot=".../v3/pc.org/networkpolicies" 2026-09-02 04:44:42.133 [INFO][14] kube-controllers/watchercache.go 274: Failed to perform list of current data during resync ListRoot=".../v3/pc.org/globalnetworkpolicies" error=connection is unauthorized: globalnetworkpolicies.crd.projectcalico.org is forbidden: User "system:serviceaccount:calico:calico-kube-controllers" cannot list resource "globalnetworkpolicies" in API group "crd.projectcalico.org" at the cluster scope 2026-09-02 04:44:42.133 [WARNING][14] kube-controllers/watchercache.go 284: Connection to datastore has failed - signaling error to client. ListRoot=".../v3/pc.org/globalnetworkpolicies" 2026-09-02 04:44:42.133 [INFO][14] kube-controllers/watchercache.go 274: Failed to perform list of current data during resync ListRoot=".../v3/pc.org/stagednetworkpolicies" error=connection is unauthorized: stagednetworkpolicies.crd.projectcalico.org is forbidden: User "system:serviceaccount:calico:calico-kube-controllers" cannot list resource "stagednetworkpolicies" in API group "crd.projectcalico.org" at the cluster scope 2026-09-02 04:44:42.133 [WARNING][14] kube-controllers/watchercache.go 284: Connection to datastore has failed - signaling error to client. ListRoot=".../v3/pc.org/stagednetworkpolicies" 2026-09-02 04:44:42.133 [INFO][14] kube-controllers/watchercache.go 274: Failed to perform list of current data during resync ListRoot=".../v3/pc.org/stagedglobalnetworkpolicies" error=connection is unauthorized: stagedglobalnetworkpolicies.crd.projectcalico.org is forbidden: User "system:serviceaccount:calico:calico-kube-controllers" cannot list resource "stagedglobalnetworkpolicies" in API group "crd.projectcalico.org" at the cluster scope 2026-09-02 04:44:42.133 [WARNING][14] kube-controllers/watchercache.go 284: Connection to datastore has failed - signaling error to client. ListRoot=".../v3/pc.org/stagedglobalnetworkpolicies" 2026-09-02 04:44:42.133 [INFO][14] kube-controllers/watchercache.go 274: Failed to perform list of current data during resync ListRoot=".../v3/pc.org/networkpolicies" error=connection is unauthorized: networkpolicies.crd.projectcalico.org is forbidden: User "system:serviceaccount:calico:calico-kube-controllers" cannot list resource "networkpolicies" in API group "crd.projectcalico.org" at the cluster scope 2026-09-02 04:44:42.133 [WARNING][14] kube-controllers/watchercache.go 284: Connection to datastore has failed - signaling error to client. ListRoot=".../v3/pc.org/networkpolicies" ``` Upstream also grants create, update, delete; but we choose not to here for now
Without this the controller logs errors: ``` E0902 04:48:36.337079 14 reflector.go:204] "Failed to watch" err="failed to list *v1.CustomResourceDefinition: customresourcedefinitions.apiextensions.k8s.io is forbidden: User \"system:serviceaccount:calico:calico-kube-controllers\" cannot list resource \"customresourcedefinitions\" in API group \"apiextensions.k8s.io\" at the cluster scope" logger="UnhandledError" reflector="pkg/mod/k8s.io/client-go@v0.35.8/tools/cache/reflector.go:289" type="*v1.CustomResourceDefinition" ```
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.
This fixes the errors mentioned in #17