Skip to content

feat(rbac): bind makeitworkcloud:admins GitHub team to cluster-admin#22

Merged
xnoto merged 1 commit intomainfrom
feat/oidc-cluster-admin-rbac
Apr 30, 2026
Merged

feat(rbac): bind makeitworkcloud:admins GitHub team to cluster-admin#22
xnoto merged 1 commit intomainfrom
feat/oidc-cluster-admin-rbac

Conversation

@xnoto
Copy link
Copy Markdown
Contributor

@xnoto xnoto commented Apr 30, 2026

Summary

When Headlamp authenticates a user via Dex, the resulting ID token is forwarded to kube-apiserver. With the apiserver's `--oidc-issuer-url` / `--oidc-client-id=headlamp` / `--oidc-username-claim=email` / `--oidc-groups-claim=groups` flags (added to k3s cloud-init in the matching tfroot-libvirt PR), the apiserver validates the token and surfaces the user as e.g. `steven@makeitwork.cloud` with groups like `makeitworkcloud:admins`. Without an RBAC binding the user is recognized but not authorized → 401 from the apiserver, which Headlamp interprets as a failed login and re-prompts.

This adds a single ClusterRoleBinding mapping the GitHub team `makeitworkcloud:admins` to cluster-admin. Anyone in that team gets full kubectl/Headlamp access; non-members get the standard denied response.

Pairs with

  • tfroot-libvirt PR (incoming): adds `--oidc-*` apiserver args to k3s cloud-init.

Test plan

  • Already validated on the live cluster — the same binding was applied manually after restarting k3s with the OIDC apiserver flags, and Headlamp login completed (no more 401 loop).
  • After merge: `kubectl get clusterrolebinding oidc-makeitworkcloud-admins` exists and is owned by ArgoCD.

🤖 Generated with Claude Code

Pairs with the k3s apiserver --oidc-* flags (tfroot-libvirt). When a user
authenticates to Headlamp (or any OIDC-aware kubectl) via Dex, their ID
token carries `groups: ["makeitworkcloud:admins"]`. This ClusterRoleBinding
maps that group to cluster-admin so the apiserver authorizes their requests
without per-user RoleBindings.
@xnoto xnoto self-assigned this Apr 30, 2026
@xnoto xnoto merged commit 783cb84 into main Apr 30, 2026
2 checks passed
@xnoto xnoto deleted the feat/oidc-cluster-admin-rbac branch April 30, 2026 04:24
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