You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(operator): self-register and manage the host cluster (#5237)
* feat(operator): self-register and manage the host cluster
The operator now registers the cluster it runs ON as a Cluster resource
named "host" (labelled ksail.io/host-cluster) in its own namespace, so the
hub itself appears in the cluster list and its workloads can be browsed,
scaled, restarted, and reconciled through the dashboard — following the
pattern of Rancher's "local" cluster, Argo CD's "in-cluster" destination,
and Headlamp's in-cluster "main" context.
- A leader-gated startup runnable ensures the registration exists
(idempotent; a same-named unlabelled cluster is never adopted).
- The reconciler skips provisioning/drift/components and the teardown
finalizer for host-labelled clusters: it only observes status (endpoint,
node readiness) through the operator's own credentials and reports
Ready; ComponentsReady is Unknown (reason HostCluster). Deleting a
host-labelled resource never invokes a provisioner.
- The resource browser resolves the host cluster to an in-cluster dynamic
client instead of a vcluster kubeconfig Secret.
- The REST API rejects create/update/delete of the host registration with
403 (kubectl remains the escape hatch; CR deletion only deregisters).
- The chart gains hostCluster.enabled (default true), the POD_NAMESPACE
downward-API env, and host-browse RBAC (nodes/events read, metrics API,
GitOps CRs read+patch).
- The UI badges the host cluster and hides edit/delete for it; the
Overview no longer backfills create-form defaults into its empty spec.
Verified end-to-end against a throwaway Kind cluster: self-registration,
Ready status with live node counts, node browsing, and 403 lifecycle
guards.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* chore: Apply megalinter fixes
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: devantler <26203420+devantler@users.noreply.github.com>
Copy file name to clipboardExpand all lines: charts/ksail-operator/README.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ The operator reconciles `Cluster` resources (`ksail.io/v1alpha1`) so you can pro
12
12
-**REST API** — served by the operator and consumed by the UI (toggle with `api.bindPort`).
13
13
-**Web UI**_(optional)_ — a dashboard that talks to the REST API (`ui.enabled`).
14
14
-**OIDC auth**_(optional)_ — app-driven OIDC login that protects the REST API and UI (`auth.oidc.enabled`).
15
+
-**Host cluster registration** — the operator self-registers the cluster it runs on as a `Cluster` resource named `host` (labelled `ksail.io/host-cluster`) in the release namespace, so the hub itself appears in the cluster list and its workloads can be browsed in the UI — like Rancher's `local` cluster or Argo CD's `in-cluster` destination. The operator never provisions, updates, or deletes the underlying cluster for this entry, and the API rejects lifecycle mutations on it. Disable with `hostCluster.enabled=false`.
15
16
16
17
> **Note:** The REST API is unauthenticated by default. Enable OIDC (`auth.oidc.enabled=true`) to require sign-in, or set `api.bindPort=0` to disable the API entirely when you don't need the UI.
17
18
@@ -135,6 +136,12 @@ Register the redirect URL with your provider, and point `ksail.local` at your In
|`hostCluster.enabled`| Self-register the cluster the operator runs on as a `Cluster` resource named `host` so it appears in the cluster list. |`true`|
0 commit comments