scoutk3s: move the k3s API server's OIDC client onto kanidm-operator #59

Open
opened 2026-11-08 17:54:01 +11:00 by myagent · 0 comments
Collaborator

Problem

The scout k3s API server authenticates kubectl users through the Kanidm OIDC client scoutk3s, made by hand. Nothing in git describes it.

Live state

attribute value
uuid cefaa9a2-6f3c-4661-89e8-e8a70c9947cd
displayname Kubernetes
class public (oauth2_resource_server_public), no basic secret
oauth2_rs_origin (none)
oauth2_allow_localhost_redirect true (kubelogin's http://localhost:8000/18000)
oauth2_rs_origin_landing https://kubernetes.io/
oauth2_rs_scope_map scoutk3s_users → email, groups, openid, profile; scoutk3s_admins → email, groups, openid, profile
oauth2_strict_redirect_uri true
group scoutk3s_users uuid 4634dd41-bd67-4dc9-9c29-8884cfb98065, members: sophie
group scoutk3s_admins uuid 4a6389fb-ee90-4025-a3b3-f79f8c6e8f8f, members: sophie

Proposed

The easy one: a public client has no secret, so adoption changes nothing the API server or kubelogin sees. OAuth2Client with type: public, allowLocalhostRedirects: true, landingUrl: https://kubernetes.io/, no redirectUrls (the field is optional; an empty list is what the live client has), both scope maps, and two Group CRs with members: [sophie]. The operator writes a Secret with client_id/issuer_url/discovery_url and no client_secret; nothing reads it. The kube-apiserver's --oidc-* flags live on the node, not in git, and don't change.

Verify with a fresh kubectl login through kubelogin after adoption. Rollback: revert (remove finalizers first to keep the client).

Where the CRs would live

None of these clients has a workload on scout, so there is no app directory to put the CRs in. Proposal: one new Application scout-kanidm-clients → argo/scout/kanidm-clients/, namespace kanidm-clients, one <client>.yaml per client, for every Kanidm client whose consumer is off-cluster or not in git. Same for the other issues in this set. Say if you'd rather have a different home.

Procedure

.claude/skills/kanidm-migrate-app/SKILL.md (capture first, PR, verify adoption: Adopted events only, plus DescriptionUpdated if a description is set). Live state below was captured on 2026-11-08 with capture.sh.

## Problem The scout k3s API server authenticates `kubectl` users through the Kanidm OIDC client `scoutk3s`, made by hand. Nothing in git describes it. ## Live state | attribute | value | |---|---| | uuid | `cefaa9a2-6f3c-4661-89e8-e8a70c9947cd` | | displayname | `Kubernetes` | | class | **public** (`oauth2_resource_server_public`), no basic secret | | oauth2_rs_origin | *(none)* | | oauth2_allow_localhost_redirect | true (kubelogin's `http://localhost:8000`/`18000`) | | oauth2_rs_origin_landing | `https://kubernetes.io/` | | oauth2_rs_scope_map | `scoutk3s_users` → email, groups, openid, profile; `scoutk3s_admins` → email, groups, openid, profile | | oauth2_strict_redirect_uri | true | | group `scoutk3s_users` | uuid `4634dd41-bd67-4dc9-9c29-8884cfb98065`, members: sophie | | group `scoutk3s_admins` | uuid `4a6389fb-ee90-4025-a3b3-f79f8c6e8f8f`, members: sophie | ## Proposed The easy one: a public client has no secret, so adoption changes nothing the API server or kubelogin sees. `OAuth2Client` with `type: public`, `allowLocalhostRedirects: true`, `landingUrl: https://kubernetes.io/`, **no `redirectUrls`** (the field is optional; an empty list is what the live client has), both scope maps, and two `Group` CRs with `members: [sophie]`. The operator writes a Secret with `client_id`/`issuer_url`/`discovery_url` and no `client_secret`; nothing reads it. The kube-apiserver's `--oidc-*` flags live on the node, not in git, and don't change. Verify with a fresh `kubectl` login through kubelogin after adoption. Rollback: revert (remove finalizers first to keep the client). ## Where the CRs would live None of these clients has a workload on scout, so there is no app directory to put the CRs in. Proposal: one new Application `scout-kanidm-clients` → `argo/scout/kanidm-clients/`, namespace `kanidm-clients`, one `<client>.yaml` per client, for every Kanidm client whose consumer is off-cluster or not in git. Same for the other issues in this set. Say if you'd rather have a different home. ## Procedure `.claude/skills/kanidm-migrate-app/SKILL.md` (capture first, PR, verify adoption: `Adopted` events only, plus `DescriptionUpdated` if a description is set). Live state below was captured on 2026-11-08 with `capture.sh`.
Sign in to join this conversation.
No labels
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
sophie/homelab#59
No description provided.