Grant krb-keys-operator RBAC for localsecrets#673
Merged
Conversation
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).
2a4a1e6 to
c95665e
Compare
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.
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
LocalSecrethandler unconditionally, but thelocalsecretsCRD 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 centralkrb-keys-operatorClusterRole - which only coverskerberos-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 grantslocalsecretsandlocalsecrets/status; the central chart just never got the matching rules. This mirrors them exactly.How to test
helm template deploy -s templates/identity/rbac.yaml- the ClusterRole now lists[kerberos-keys, localsecrets]and[kerberos-keys/status, localsecrets/status].APIForbiddenError ... localsecretstraceback.