Title: Operator: manager role lacks `watch` on clusterroles/clusterrolebindings, informers fail with "cannot watch resource" · Issue #7061 · feast-dev/feast · GitHub
Open Graph Title: Operator: manager role lacks `watch` on clusterroles/clusterrolebindings, informers fail with "cannot watch resource" · Issue #7061 · feast-dev/feast
X Title: Operator: manager role lacks `watch` on clusterroles/clusterrolebindings, informers fail with "cannot watch resource" · Issue #7061 · feast-dev/feast
Description: Expected Behavior The operator's RBAC covers every API call the operator makes. The controller-manager log has no permission errors. Current Behavior When a FeatureStore uses Kubernetes authorization (the default), the operator logs thes...
Open Graph Description: Expected Behavior The operator's RBAC covers every API call the operator makes. The controller-manager log has no permission errors. Current Behavior When a FeatureStore uses Kubernetes authorizati...
X Description: Expected Behavior The operator's RBAC covers every API call the operator makes. The controller-manager log has no permission errors. Current Behavior When a FeatureStore uses Kubernetes authori...
Opengraph URL: https://github.com/feast-dev/feast/issues/7061
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Operator: manager role lacks `watch` on clusterroles/clusterrolebindings, informers fail with \"cannot watch resource\"","articleBody":"## Expected Behavior\n\nThe operator's RBAC covers every API call the operator makes. The controller-manager log has no permission errors.\n\n## Current Behavior\n\nWhen a `FeatureStore` uses Kubernetes authorization (the default), the operator logs these errors every few seconds, with client-go backoff:\n\n```\nERROR controller-runtime.cache.UnhandledError Failed to watch {\"reflector\": \"go/pkg/mod/k8s.io/client-go@v0.35.2/tools/cache/reflector.go:289\", \"type\": \"*v1.ClusterRole\", \"error\": \"clusterroles.rbac.authorization.k8s.io is forbidden: User \\\"system:serviceaccount:feast-operator-system:feast-operator-controller-manager\\\" cannot watch resource \\\"clusterroles\\\" in API group \\\"rbac.authorization.k8s.io\\\" at the cluster scope\"}\nERROR controller-runtime.cache.UnhandledError Failed to watch {\"reflector\": \"go/pkg/mod/k8s.io/client-go@v0.35.2/tools/cache/reflector.go:289\", \"type\": \"*v1.ClusterRoleBinding\", \"error\": \"clusterrolebindings.rbac.authorization.k8s.io is forbidden: User \\\"system:serviceaccount:feast-operator-system:feast-operator-controller-manager\\\" cannot watch resource \\\"clusterrolebindings\\\" in API group \\\"rbac.authorization.k8s.io\\\" at the cluster scope\"}\n```\n\nReconciliation still succeeds, and the `FeatureStore` becomes `Ready`. The informers fill from the initial list, but they never receive watch events. As a result, the operator reads ClusterRoles and ClusterRoleBindings from a cache that goes stale, and the log fills with errors (55 in about 17 minutes with one FeatureStore).\n\n### Cause\n\n- The authz code reads and writes ClusterRoles and ClusterRoleBindings through the manager client with `controllerutil.CreateOrUpdate` and `Get`. See `createFeastClusterRole`, `createFeastClusterRoleBinding`, `createOidcClusterRole`, `createOidcClusterRoleBinding` and `cleanupKubernetesClusterRbac` in [`internal/controller/authz/authz.go`](https://github.com/feast-dev/feast/blob/v0.67.0/infra/feast-operator/internal/controller/authz/authz.go#L147).\n- `cmd/main.go` lists many types in `Client.Cache.DisableFor`, but not `rbacv1.ClusterRole` or `rbacv1.ClusterRoleBinding` ([L192](https://github.com/feast-dev/feast/blob/v0.67.0/infra/feast-operator/cmd/main.go#L192)). Reads of these two types therefore go through the cache, and controller-runtime starts an informer for each type on first use. An informer needs `list` and `watch`.\n- The RBAC markers grant only `get;list;create;update;delete` on clusterrolebindings and `create;get;list` on clusterroles ([`featurestore_controller.go` L74-L76](https://github.com/feast-dev/feast/blob/v0.67.0/infra/feast-operator/internal/controller/featurestore_controller.go#L74-L76)). Neither marker includes `watch`.\n\n`master` has the same markers and the same `DisableFor` list.\n\n## Steps to reproduce\n\n1. Install the operator from `infra/feast-operator/dist/install.yaml` (v0.67.0).\n2. Create a `FeatureStore` without `authz` (so it defaults to Kubernetes authorization).\n3. `kubectl -n feast-operator-system logs deploy/feast-operator-controller-manager | grep 'Failed to watch'`\n\n### Specifications\n\n- Version: Feast operator v0.67.0 (`quay.io/feastdev/feast-operator:0.67.0`), controller-runtime v0.23.3\n- Platform: vanilla Kubernetes v1.35.6 (not OpenShift)\n- Subsystem: feast-operator, RBAC / authz\n\n## Possible Solution\n\nEither change fixes the errors:\n\n1. Add `watch` to the two markers:\n ```go\n // +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterrolebindings,verbs=get;list;watch;create;update;delete\n // +kubebuilder:rbac:groups=rbac.authorization.k8s.io,resources=clusterroles,verbs=create;get;list;watch\n ```\n The role already grants `list`, so `watch` exposes no additional data.\n2. Add `&rbacv1.ClusterRole{}` and `&rbacv1.ClusterRoleBinding{}` to `Client.Cache.DisableFor`. Reads of these two types then go directly to the API server, as reads of `Role` and `RoleBinding` already do. With this change, no cluster-wide RBAC informers start at all.\n\nAs a workaround, we append a watch-only rule to `feast-operator-manager-role` with a kustomize patch:\n\n```yaml\n- target:\n kind: ClusterRole\n name: feast-operator-manager-role\n patch: |-\n - op: add\n path: /rules/-\n value:\n apiGroups: [rbac.authorization.k8s.io]\n resources: [clusterrolebindings, clusterroles]\n verbs: [watch]\n```\n\nAfter a restart, the operator logs no `Failed to watch` errors.","author":{"url":"https://github.com/imtpot","@type":"Person","name":"imtpot"},"datePublished":"2026-10-22T11:47:05Z","url":"https://github.com/feast-dev/feast/issues/7061"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c5aecfee-fbf6-b0eb-4ab7-bddde817fb63 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B04E:19EC1D:D5D940:11A26A0:6AFE922C |
| html-safe-nonce | 3a48538b0396a95ac460bf190a11bb6b94f27670b20d06c8da914592e5e7f8fe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDRFOjE5RUMxRDpENUQ5NDA6MTFBMjZBMDo2QUZFOTIyQyIsInZpc2l0b3JfaWQiOiIyNDA5MDIzMzQyNTI3ODEyMTQwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 51fd8e4c1993f99df5d7139ced5cf55f69f3545af7d8399d7728f917b880b1f3 |
| hovercard-subject-tag | issue:5978681079 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feast-dev/feast/7061/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3ade99d0c0fc365c591f9c61a29112000b201578d79f5d4fa623b32a433f0a4c/feast-dev/feast/issues/7061 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3ade99d0c0fc365c591f9c61a29112000b201578d79f5d4fa623b32a433f0a4c/feast-dev/feast/issues/7061 |
| og:image:alt | Expected Behavior The operator's RBAC covers every API call the operator makes. The controller-manager log has no permission errors. Current Behavior When a FeatureStore uses Kubernetes authorizati... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | imtpot |
| hostname | github.com |
| expected-hostname | github.com |
| None | b3c0f155eafc27e60db6e254d1ffff0e072e9ab3b4018a5ee518797c19d89f86 |
| turbo-cache-control | no-preview |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 4a10310af51a1bfffbedc4fd81cb582acf0cb0ff |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width