Skip to content

Grant krb-keys-operator RBAC for localsecrets#673

Merged
AlexGodbehere merged 1 commit into
mainfrom
ago/fix-krb-keys-rbac
Jul 9, 2026
Merged

Grant krb-keys-operator RBAC for localsecrets#673
AlexGodbehere merged 1 commit into
mainfrom
ago/fix-krb-keys-rbac

Conversation

@AlexGodbehere

Copy link
Copy Markdown
Contributor

Summary

The central krb-keys-operator crash-loops its kopf watch with APIForbiddenError: cannot list resource "localsecrets" on any cluster that has (or has ever had) an edge cluster provisioned.

The operator registers a LocalSecret handler unconditionally, but the localsecrets CRD is only shipped by the edge-cluster chart. When the first edge cluster is provisioned the CRD gets installed on the central cluster too, kopf notices the now-served resource and tries to watch it, and the central krb-keys-operator ClusterRole - which only covers kerberos-keys - denies it. kopf then retries with backoff and escalates roughly every minute, forever.

The edge chart's own role (edge-cluster/templates/krb-keys.yaml) already grants localsecrets and localsecrets/status; the central chart just never got the matching rules. This mirrors them exactly.

How to test

  1. helm template deploy -s templates/identity/rbac.yaml - the ClusterRole now lists [kerberos-keys, localsecrets] and [kerberos-keys/status, localsecrets/status].
  2. Upgrade a cluster that has at least one edge cluster (so the CRD exists), restart the krb-keys-operator pod.
  3. The operator log should no longer show the once-a-minute APIForbiddenError ... localsecrets traceback.

The operator registers a LocalSecret kopf handler unconditionally,
and the localsecrets CRD ships in the edge-cluster chart's crds/, so
it lands on the central cluster as soon as the first edge cluster is
provisioned. From that point the central operator's watch crash-loops
with APIForbiddenError every minute because the central ClusterRole
only covers kerberos-keys.

Mirror the localsecrets rules the edge chart already grants
(edge-cluster/templates/krb-keys.yaml).
@AlexGodbehere AlexGodbehere force-pushed the ago/fix-krb-keys-rbac branch from 2a4a1e6 to c95665e Compare July 9, 2026 11:47
@AlexGodbehere AlexGodbehere merged commit 6a6c259 into main Jul 9, 2026
1 check passed
@AlexGodbehere AlexGodbehere deleted the ago/fix-krb-keys-rbac branch July 9, 2026 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant