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
{{ message }}
Repository navigation
Commit 8e61ad5
Browse filesBrowse the repository at this point in the historyBrowse files
* fix(cluster-install): correct v1.4.x namespace, storageclass gate, dashboard OIDC
Three corrections to the cluster-install skill found while installing
Cozystack v1.4.2 on a fresh Talos cluster end to end.
cozy-installer namespace: install into cozy-system with
--create-namespace. v1.4.0 stopped templating the cozy-system Namespace
in the chart and moved namespace creation to --create-namespace plus a
pre-install labeler hook (in kube-system, hostNetwork, NotReady-tolerant)
that stamps PSA=privileged. The previous --namespace kube-system form
(no --create-namespace) makes the labeler hook fail with
'namespaces "cozy-system" not found' and aborts the install before the
operator deploys. Both v1.3.x and v1.4.x forms are now documented
side by side.
StorageClasses: gate on a live 'kubectl get storageclass' check instead
of a version branch. The prior guidance skipped this phase on
installer_version >= 1.4.0 assuming the tenant CRD exposes
spec.storageClasses and the operator auto-creates them. On v1.4.2 the
shipped tenant CRD has no storageClasses field and nothing creates the
classes, so the cluster reaches all-HRs-Ready with zero StorageClasses
and every stateful PVC stuck Pending. The live check creates the
linstor defaults whenever the cluster comes up empty and self-skips if a
future release starts creating them. Also documents that SC creation
belongs inside the Phase 8 watch loop, gated on linstor-controller
Ready, to avoid deadlocking on PVC-dependent HRs.
dashboard OIDC: enable authentication.oidc, set the root tenant
spec.host (it does not inherit publishing.host), and expose keycloak.
The non-OIDC token-proxy dashboard path is broken on v1.4.2 (container
never binds its port and CrashLoops on its own liveness probe), so a
working web dashboard requires Keycloak. This mirrors what the upstream
e2e install does.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
* fix(cluster-install): normalise installer OCI tag in values-template helm commands
The cozy-installer OCI chart tags are published as X.Y.Z with no leading
v (verified against the ghcr registry), but both helm command examples in
the reference passed $INSTALLER_VERSION verbatim. An operator-supplied
v1.4.2 would not match the registry tag 1.4.2 and the install would fail.
Strip the leading v into $INSTALLER_VERSION_OCI before --version, matching
what SKILL.md Phase 6 already does.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
* fix(cluster-install): align operator-facing snippets to v1.4 cozy-system namespace
Phase 6 was updated to the v1.4 release layout (cozy-system,
--create-namespace, pre-install labeler hook), but the plan-view summary,
the artifacts summary, and the issue reproduction template still described
the v1.3 form where cozy-installer lived in kube-system and the chart
templated the namespace itself. An operator following those leftover
snippets would run --namespace kube-system against a v1.4 chart and the
labeler hook would abort the install. Bring all three in line with Phase 6.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
* fix(cluster-install): correct StorageClass auto-creation claim for v1.4
Phase 8.6 was changed to create default StorageClasses whenever the live
cluster comes up empty, on the finding that v1.4.2 does not auto-create
them. But two sibling references still asserted the opposite — that v1.4+
exposes tenants.apps.cozystack.io spec.storageClasses and the operator
creates the classes from the tenant declaration. That field is absent from
the shipped tenant CRD on v1.4.2 and from the monorepo source through
current HEAD, so nothing auto-creates StorageClasses on v1.4 either. Align
the pitfall note and the wizard preflight entry with the live-gate guidance
so the bundle no longer carries contradictory instructions.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
* fix(cluster-install): patch root tenant host alongside ingress everywhere
The Phase 8 watch loop was updated to set both spec.host and spec.ingress
on the root tenant, because it ships with spec.host: "" and does not
inherit publishing.host. Every other spot still patched or described ingress
alone: the plan-view action list, the standing rule in the lessons section,
the system-bundle extended-patch example (which also used a <HOST>
placeholder instead of ${HOST}), the After Package apply reference snippet,
and the stalled-install recovery snippet in known-failures. Set host in all
of them so no example leaves the per-tenant ingress objects rendering
against an empty domain.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
---------
Signed-off-by: Aleksei Sviridkin <f@lex.la>
For a v1.3.x install the form is `--namespace kube-system` with NO `--create-namespace` (the v1.3 chart templates the namespace itself). See `references/values-template.md`for both forms side by side — pick the one matching `installer_version`.
644
+
636
645
For `talos` and `hosted`, drop `cozystack.apiServerHost` / `apiServerPort`if not required by the chart.
637
646
638
647
Verify:
@@ -671,20 +680,45 @@ This phase merges what used to be Phase 7.5 (root Tenant ingress patch) into the
671
680
672
681
**Why the patch is needed**: cozystack's dashboard ships gatekeeper (oauth2-proxy) which, on startup, does OIDC discovery against the **public FQDN**`https://keycloak.${HOST}/realms/cozy/.well-known/openid-configuration` — not an in-cluster service. Without the root ingress controller running, nothing listens on 443, gatekeeper CrashLoopBackOffs, the `cozy-dashboard/dashboard` HR sits in`Unknown: Running 'install' action with timeout of 10m0s` and then`InstallFailed: context deadline exceeded`, Flux remediates and retries forever. `cozy-fluxcd/flux-plunger` has a hard dependency on `cozy-dashboard/dashboard` and stays `False: dependency is not ready`. The phase would never go green.
673
682
683
+
**The dashboard requires OIDC/Keycloak — it is not optional on the supported path.** The "Why the patch is needed" note above describes gatekeeper doing OIDC discovery against Keycloak. But Keycloak only deploys when `authentication.oidc.enabled: true`in the Platform Package — and that key defaults to `false`, with the `isp-full*` overlays NOT turning it on. If the skill enables `ingress` + sets `host` but never enables OIDC, the result on v1.4.2 is: no `cozy-keycloak` namespace, no Keycloak HR, and the dashboard falls back to its non-OIDC `token-proxy` container, which is **broken on v1.4.2** — the container starts, never binds `:8000` (connection refused, zero logs), and is killed by its own `/ping` liveness probe every ~45 s → CrashLoopBackOff → the `cozy-dashboard/dashboard` HR fails install → `flux-plunger` and the rest of the chain hang. The cluster reports 88/90 HRs Ready and looks "almost done" forever.
684
+
685
+
So for a usable dashboard the skill must enable OIDC. This is exactly what cozystack's own e2e (`hack/e2e-install-cozystack.bats`) does — patch the root tenant host, then enable OIDC and expose Keycloak:
686
+
687
+
```bash
688
+
# Enable OIDC and expose keycloak (do this once, after the Package exists).
Better: bake both into the Platform Package CR written in Phase 4/7 from the start (`authentication.oidc.enabled: true` and `keycloak` in `exposedServices`) so there is no second reconcile. The Phase 4 intake should collect a **dashboard auth** decision — OIDC/Keycloak (recommended; the only path with a working dashboard on 1.4.2) vs none (API-only, no web dashboard) — and only enable OIDC when the operator wants the dashboard. When OIDC is enabled, Keycloak needs a working LE cert for `keycloak.${HOST}`, so the same DNS/port-80 preconditions as the dashboard host apply (Phase 4 publishing gate already covers this — just make sure `keycloak.${HOST}` is inside the wildcard).
699
+
674
700
Skip the root-Tenant patch entirely on `isp-hosted` or when the `system` bundle was disabled in Phase 4 — there is no root Tenant CR in those modes.
675
701
676
702
Watch loop (per 30 s poll):
677
703
678
704
```bash
679
705
# 1) Has the root Tenant CR landed? If yes and not yet patched, patch it.
706
+
# Set BOTH spec.host and spec.ingress. The root tenant ships with
707
+
# spec.host: "" and does NOT inherit publishing.host from the Platform
708
+
# Package (verified on v1.4.2). With an empty host the per-tenant ingress
709
+
# objects (dashboard.${HOST}, keycloak.${HOST}, …) render against an empty
710
+
# domain and Keycloak/dashboard never get usable URLs. $HOST is the
711
+
# publishing.host collected in Phase 4.
680
712
if kubectl --context $CTX --namespace tenant-root get tenants.apps.cozystack.io root \
681
713
--output jsonpath='{.metadata.name}' 2>/dev/null | grep -q '^root$'; then
682
-
CURRENT=$(kubectl --context $CTX --namespace tenant-root get tenants.apps.cozystack.io root \
683
-
--output jsonpath='{.spec.ingress}')
684
-
if [ "$CURRENT"!="true" ];then
714
+
CUR_INGRESS=$(kubectl --context $CTX --namespace tenant-root get tenants.apps.cozystack.io root \
715
+
--output jsonpath='{.spec.ingress}')
716
+
CUR_HOST=$(kubectl --context $CTX --namespace tenant-root get tenants.apps.cozystack.io root \
717
+
--output jsonpath='{.spec.host}')
718
+
if [ "$CUR_INGRESS" != "true" ] || [ "$CUR_HOST" != "$HOST" ]; then
On the full `system`-bundle path you may also want the root tenant's `etcd`/`monitoring`/`seaweedfs` services (this is what cozystack's own `hack/e2e-install-cozystack.bats` patches): extend the patch to `{"spec":{"ingress":true,"host":"${HOST}","monitoring":true,"etcd":true,"seaweedfs":true}}` when those were selected in Phase 4. Leave them at their defaults otherwise.
731
+
696
732
```text
697
733
HelmRelease $NS/$NAME has been Failing for $T minutes.
Skip on `cluster.cozystack.installer_version` ≥ `1.4.0`. The cozystack `tenants.apps.cozystack.io` CRD in v1.4+ exposes `spec.storageClasses` and the operator creates the StorageClasses based on the tenant declaration. v1.3.x does **not**do this — the cluster reaches "all HRs Ready" with zero StorageClasses, and every stateful tenant workload sits in`Pending: pod has unbound immediate PersistentVolumeClaims`until the operator applies them by hand.
816
+
**Gate on the live cluster, not on a version number.** Earlier guidance skipped this phase on `installer_version ≥ 1.4.0` on the assumption that the `tenants.apps.cozystack.io` CRD exposes `spec.storageClasses` and the operator creates the StorageClasses from the tenant declaration. That assumption is **false on at least v1.4.2** — the shipped tenant CRD has no `storageClasses` field (`kubectl get crd tenants.apps.cozystack.io -o yaml | grep -c storageClass` → `0`), nothing auto-creates StorageClasses, and the cluster reaches "all HRs Ready" with `kubectl get storageclass` empty. Every stateful workload (keycloak-db, etcd, seaweedfs, vmstorage/vlstorage) then sits in `Pending: unbound immediate PersistentVolumeClaims`, which cascades: keycloak CrashLoops with no DB → cozystack-api/controller/dashboard never go Ready.
781
817
782
-
The skill writes two StorageClasses by default for v1.3.x:
818
+
So the correct gate is a live check, not a version branch:
819
+
820
+
```bash
821
+
# Only create defaults if the cluster has none AND nothing else owns the names.
822
+
EXISTING_SC=$(kubectl --context $CTX get storageclass --output name 2>/dev/null | wc -l | tr -d '')
823
+
if [ "$EXISTING_SC" -gt 0 ]; then
824
+
echo "StorageClasses already present — skip (operator or a future chart created them):"
825
+
kubectl --context $CTX get storageclass
826
+
else
827
+
echo "No StorageClasses — applying linstor defaults (see manifest below)."
828
+
# apply storageclasses-default.yaml
829
+
fi
830
+
```
831
+
832
+
If a future cozystack release does start auto-creating StorageClasses, the live check skips this phase automatically — no version bump to the skill needed. Until then, the skill creates them on every version where the cluster comes up empty.
833
+
834
+
The skill writes two StorageClasses:
783
835
784
836
```yaml
785
837
# <config-dir>/storageclasses-default.yaml
@@ -823,6 +875,8 @@ kubectl --context $CTX get storageclass
**Timing — create the StorageClasses inside the Phase 8 watch loop, not after it.** Apply them as soon as `local`/`replicated` are absent and the LINSTOR pools are registered (same gate as the inline pool registration), NOT after "all HRs Ready". stateful HRs in the `paas`/`monitoring` bundles (keycloak, etcd, seaweedfs, vmstorage) request PVCs that stay `Pending` until a default StorageClass exists, so an "all-HRs-Ready → then create SCs" ordering deadlocks the watch loop the same way the LINSTOR pool registration would. Folding SC creation into the loop (gated on `linstor-controller` Ready) lets those PVCs bind and the dependent HRs converge. One subtlety: a PVC created with no `storageClassName` **before** a default SC exists records `storageClassName: ""` and will NOT retroactively pick up a later default — but every cozystack chart pins `storageClassName` explicitly (`replicated`), so in practice the Pending PVCs bind as soon as the named class appears. If you do hit a genuinely class-less Pending PVC, it must be recreated after the default exists.
879
+
826
880
`replicated` is marked as the default; `local` is a single-replica fallback for system workloads that don't need replication. On clusters with fewer than 3 storage-providing nodes, drop `placementCount`for`replicated` to match — the skill auto-derives this from `cozystack.storage.nodes[]` count.
@@ -1032,7 +1086,7 @@ If any phase hits a fatal failure that looks like an upstream bug or doc gap, fo
1032
1086
- NEVER bootstrap Talos nodes or invoke `boot-to-talos` / `talm` from inside this skill — that flow lives in`/cozystack:talos-bootstrap`. Refuse and hand off.
1033
1087
- NEVER auto-rollback a partially provisioned storage state — print backout commands and let the operator decide.
1034
1088
- NEVER accept a custom `publishing.host` without an explicit operator confirmation that they own the domain and will configure wildcard DNS — the HTTP-01 cert solver fails silently otherwise. nip.io patterns skip this gate because nip.io is publicly hosted DNS.
1035
-
- ALWAYS patch `tenants/root.spec.ingress=true` from inside the Phase 8 watch loop as soon as the CR appears, on `system`-bundle installs. The OIDC chicken-and-egg makes Phase 8 unreachable otherwise — dashboard / keycloak / flux-plunger loop forever, every other downstream HR stalls on the missing root ingress. The CR can appear at any point during the watch loop;do not gate the patch behind a fixed pre-Phase-8 wait.
1089
+
- ALWAYS patch `tenants/root` with BOTH `spec.host=$HOST` and `spec.ingress=true` from inside the Phase 8 watch loop as soon as the CR appears, on `system`-bundle installs. The root tenant ships with `spec.host: ""` and does not inherit `publishing.host`, so an ingress-only patch leaves every per-tenant ingress object rendering against an empty domain. The OIDC chicken-and-egg makes Phase 8 unreachable otherwise — dashboard / keycloak / flux-plunger loop forever, every other downstream HR stalls on the missing root ingress. The CR can appear at any point during the watch loop;do not gate the patch behind a fixed pre-Phase-8 wait.
1036
1090
- ALWAYS read variant overlays and `requirements.md` before declaring "this looks fine" — variant-specific checks (CP-label value, ZFS availability, KubeOVN MASTER_NODES) are easy to miss.
1037
1091
- ALWAYS pull live data over cached assumption: `kubectl get` over "I think this is …".
1038
1092
- ALWAYS write Phase 4 collected values to disk in`<config-dir>/cozystack-platform-package.yaml` before applying — the file is part of the diagnostic bundle if Phase 8 fails. ZFS pool registration is stored separately under `<config-dir>/.state.yaml``cozystack.storage.nodes[]` and replayed by the Phase 8 post-Ready hook (there is no `LinstorSatelliteConfiguration` CR for the ZFS path).
Copy file name to clipboardExpand all lines: plugins/cozystack/skills/cluster-install/references/known-failures.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,11 +36,11 @@ The root ingress controller doesn't start until `tenants.apps.cozystack.io/root`
36
36
37
37
This is a chicken-and-egg of the `isp-full*` variant + OIDC combination, not a bug in any single component:
38
38
39
-
- Platform Package does not patch `tenant root.spec.ingress`.
39
+
- Platform Package does not patch `tenant root.spec.host` / `spec.ingress`.
40
40
- The cozystack dependency graph is built so gatekeeper can't come up before ingress, and dashboard can't come up before gatekeeper.
41
41
- But flux-plunger waits on dashboard, which waits on ingress, which waits on the missing manual patch.
42
42
43
-
`cozystack:cluster-install` Phase 8 patches `tenants/root.spec.ingress=true` inline as soon as the CR appears in the watch loop, which avoids the trap entirely on a fresh install regardless of when the CRD lands relative to other HRs.
43
+
`cozystack:cluster-install` Phase 8 patches `tenants/root` with both `spec.host` and `spec.ingress=true` inline as soon as the CR appears in the watch loop, which avoids the trap entirely on a fresh install regardless of when the CRD lands relative to other HRs.
44
44
45
45
**Recovery on an install that has already stalled in Phase 8**
Copy file name to clipboardExpand all lines: plugins/cozystack/skills/cluster-install/references/provider-pitfalls.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,13 +78,13 @@ wipefs --all "$DEVICE"
78
78
79
79
The skill's Phase 5.5 step 7 (pre-existing-data check) catches this before `zpool create` and refuses to proceed without operator approval of the wipe.
80
80
81
-
## Cozystack v1.3.x does not create StorageClasses automatically
81
+
## Cozystack does not create StorageClasses automatically (v1.3.x and v1.4.2)
82
82
83
83
**Symptom**: cluster reaches "all HRs Ready", but every stateful tenant workload sits in `Pending: pod has unbound immediate PersistentVolumeClaims`. `kubectl get storageclass` returns no rows.
84
84
85
-
**Mechanism**: in v1.3.x, neither the cozy-installer chart nor the Platform Package emits StorageClasses; they expect the operator to apply them by hand after `linstor storage-pool create`. v1.4+ exposes `tenants.apps.cozystack.io spec.storageClasses` and the operator creates them based on the tenant declaration.
85
+
**Mechanism**: neither the cozy-installer chart nor the Platform Package emits StorageClasses; the operator must apply them by hand after `linstor storage-pool create`. An earlier assumption that v1.4+ exposes `tenants.apps.cozystack.io spec.storageClasses` and auto-creates the classes is **false** — the field is absent from the shipped tenant CRD on v1.4.2 (`kubectl get crd tenants.apps.cozystack.io -o yaml | grep -c storageClass` → `0`) and from the monorepo source through current HEAD, so nothing auto-creates them on v1.4 either.
86
86
87
-
**Fix**: SKILL.md Phase 8.6 creates `local` (placementCount=1) and `replicated` (placementCount=3, isDefaultClass=true) for v1.3.x. Skip on v1.4+.
87
+
**Fix**: SKILL.md Phase 8.6 creates `local` (placementCount=1) and `replicated` (placementCount=3, isDefaultClass=true) whenever the live cluster comes up with no StorageClasses. The gate is the live `kubectl get storageclass` check, not a version number, so it self-skips if a future release ever starts creating them.
88
88
89
89
## Cozystack v1.3.3 `isp-full` bundle does not include Keycloak
0 commit comments