paperclip: RBAC and scoped kubeconfigs for ops and deploy agents #63

Open
opened 2026-10-25 12:06:20 +00:00 by lab · 0 comments
Owner

Context

Two agents with different cluster powers, both narrower than the workstation
kubeconfig.

Steps

  1. lxc/paperclip/manifests/paperclip-agent/
    • namespace.yaml
    • serviceaccount.yaml for ops and deploy
    • token-secret.yaml for each SA (type kubernetes.io/service-account-token)
    • clusterrolebinding-ops-view.yaml: ops -> built-in view
    • rolebindings for deploy: edit in media, monitoring, opengym
  2. lxc/paperclip/generate-kubeconfig.sh: copy of the opencode script,
    parameterised by NAMESPACE, SA_NAME, SECRET_NAME, and CONTEXT
  3. Generate temp/paperclip-ops.kubeconfig and
    temp/paperclip-deploy.kubeconfig (gitignored)

Done when

  • kubectl auth can-i --list --kubeconfig temp/paperclip-ops.kubeconfig
    shows read verbs everywhere and no writes
  • the deploy kubeconfig shows edit in the three namespaces and nothing else
  • kubectl auth can-i delete nodes --kubeconfig ... is no for both
## Context Two agents with different cluster powers, both narrower than the workstation kubeconfig. ## Steps 1. `lxc/paperclip/manifests/paperclip-agent/` - `namespace.yaml` - `serviceaccount.yaml` for `ops` and `deploy` - `token-secret.yaml` for each SA (type `kubernetes.io/service-account-token`) - `clusterrolebinding-ops-view.yaml`: `ops` -> built-in `view` - rolebindings for `deploy`: `edit` in `media`, `monitoring`, `opengym` 2. `lxc/paperclip/generate-kubeconfig.sh`: copy of the opencode script, parameterised by `NAMESPACE`, `SA_NAME`, `SECRET_NAME`, and `CONTEXT` 3. Generate `temp/paperclip-ops.kubeconfig` and `temp/paperclip-deploy.kubeconfig` (gitignored) ## Done when - `kubectl auth can-i --list --kubeconfig temp/paperclip-ops.kubeconfig` shows read verbs everywhere and no writes - the deploy kubeconfig shows `edit` in the three namespaces and nothing else - `kubectl auth can-i delete nodes --kubeconfig ...` is `no` for both
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lab/homelab#63
No description provided.