Skip to content

feat(clustertool)!: adopt the single-cluster repository layout - #669

Merged
Boemeltrein merged 7 commits into
codex/single-cluster-structurefrom
codex/single-cluster-folder-moves
Nov 3, 2026
Merged

Boemeltrein merged 7 commits into
codex/single-cluster-structurefrom
codex/single-cluster-folder-moves

Conversation

@Boemeltrein

Copy link
Copy Markdown
Member

Description

Generated repositories still use the clusters/main/ directory layer after removal of the cluster selector. This change introduces the agreed single-cluster layout for new installations and updates its consumers.

  • Place Talos configuration under talos/, rename inactive examples to example-patches/, and keep Talos ignore rules in talos/.gitignore.
  • Place shared configuration, repositories and Flux entry under kubernetes/config/, kubernetes/repositories/ and kubernetes/flux-entry/.
  • Group applications under kubernetes/apps/, preserving existing groups and app/jobs/plans boundaries. Move LibreSpeed to other/librespeed/.
  • Rename the shared configuration to cluster-secrets.sops.yaml and its Kubernetes Secret to cluster-secrets.
  • Generate the age-key manifest at kubernetes/apps/flux-system/sops-age.sops.yaml and apply it during bootstrap before installing Flux. Keep the Git deploy-key location unchanged.
  • Restrict genks to kubernetes/apps/ while retaining its existing generation rules.
  • Remove the explicit Cilium cluster name and ID.
  • Update affected bootstrap, SOPS/precommit, environment, documentation and CI references.

The three Flux entry resources retain their dependencies, decryption, substitution, shared defaults and opt-outs. Flux remains optional.

⚙️ Type of change

  • 🆕 New feature (e.g., bootstrap, cluster config, or automation)
  • 🐛 Bugfix (e.g., node setup, config generation)
  • 🔃 Chart Updates/Changes included with clustertool
  • 🔃 Refactor (internal changes, no functional impact)
  • ⚠️ Breaking change (changes Talos cluster behavior)

🧪 How Has This Been Tested?

  • Run clustertool commands locally
  • Verified cluster bootstrap on Talos nodes
  • Checked generated configs are valid
  • Validated cluster state after changes

Passed on Windows:

  • go test ./cmd ./pkg/initfiles ./pkg/fluxhandler ./pkg/sops
  • Dummy initialization and CLI subprocess checks for genks, kustomizations, checkcrypt and precommit.
  • Kustomize builds for the Flux entry resources and child application, job and plan paths.
  • Checks that genks preserves existing ks.yaml files, leaves files outside apps unchanged, and excludes the age-key Secret from Flux resources.
  • SOPS encrypt/decrypt checks, including optional component secrets.
  • A freshly built standalone precommit checker, verifying encrypted contents in both the working tree and Git index.
  • Generated Git ignore rules and git diff --check.

The layout test uses a dummy existing Talos identity. No live cluster operations were performed. Linux runtime testing and GitHub CI remain pending.

📃 Notes:

🤖 This PR is AI generated.

This draft targets codex/single-cluster-structure.

This layout is intended for new installations. Existing repositories are not migrated automatically; initialize a fresh repository to obtain the new structure.

Adding clusterName to clustertool.yaml and changing Kubernetes API endpoint selection remain outside this change.

✔️ Checklist:

  • ⚖️ Followed project style and contribution guidelines
  • 👀 Self-reviewed my changes
  • 🧪 Documented testing steps
  • 🏷️ PR title follows convention:
    • feat(clustertool):
    • fix(clustertool):
    • chore(clustertool):

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 4a39f72e-537c-4bbc-a0d0-704f8a07c7f6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@trueforge-bot

trueforge-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

🚀 HelmRelease CI Report

Overall Status

Stage Result
🔍 Detect HelmReleases success
🧪 Helm Tests success

🧪 HelmReleases Tested

embed/generic/kubernetes/apps/core/blocky/app/helm-release.yaml
embed/generic/kubernetes/apps/core/metallb-config/app/helm-release.yaml
embed/generic/kubernetes/apps/flux-system/flux-operator/app/helm-release.yaml
embed/generic/kubernetes/apps/kube-system/kubelet-csr-approver/app/helm-release.yaml
embed/generic/kubernetes/apps/kube-system/metrics-server/app/helm-release.yaml
embed/generic/kubernetes/apps/kube-system/node-feature-discovery/app/helm-release.yaml
embed/generic/kubernetes/apps/networking/nginx-external/app/helm-release.yaml
embed/generic/kubernetes/apps/networking/nginx-internal/app/helm-release.yaml
embed/generic/kubernetes/apps/observability/headlamp/app/helm-release.yaml
embed/generic/kubernetes/apps/observability/kube-prometheus-stack/app/helm-release.yaml
embed/generic/kubernetes/apps/other/librespeed/app/helm-release.yaml
embed/generic/kubernetes/apps/system/cert-manager/app/helm-release.yaml
embed/generic/kubernetes/apps/system/cloudnative-pg/app/helm-release.yaml
embed/generic/kubernetes/apps/system/kubernetes-reflector/app/helm-release.yaml
embed/generic/kubernetes/apps/system/metallb/app/helm-release.yaml
embed/generic/kubernetes/apps/system/openebs/app/helm-release.yaml
embed/generic/kubernetes/apps/system/snapshot-controller/app/helm-release.yaml
embed/generic/kubernetes/apps/system/volsync/app/helm-release.yaml


⏭️ HelmReleases Skipped

embed/generic/kubernetes/apps/core/clusterissuer/app/helm-release.yaml
embed/generic/kubernetes/apps/flux-system/flux-instance/app/helm-release.yaml
embed/generic/kubernetes/apps/kube-system/cilium/app/helm-release.yaml
embed/generic/kubernetes/apps/system/longhorn/app/helm-release.yaml
embed/generic/kubernetes/apps/system/system-upgrade/tuppr/app/helm-release.yaml


Result

✅ All HelmRelease tests passed

@Boemeltrein
Boemeltrein marked this pull request as ready for review November 3, 2026 16:17
@Boemeltrein
Boemeltrein merged commit d5f02c1 into codex/single-cluster-structure Nov 3, 2026
28 checks passed
@Boemeltrein
Boemeltrein deleted the codex/single-cluster-folder-moves branch November 3, 2026 16:18
Boemeltrein added a commit that referenced this pull request Nov 4, 2026
* feat(clustertool)!: remove the cluster selector (#666)

BREAKING CHANGE: ClusterTool no longer accepts the cluster selector and uses clusters/main. Existing initialization safeguards are retained.

* feat(clustertool)!: adopt the single-cluster repository layout (#669)

* feat(clustertool)!: adopt the single-cluster repository layout

* clean up

* apps move into sub folder

* fix: update HelmRelease paths to reflect new directory structure under 'apps'

* fix: simplify resource exclusion logic in kustomization.yaml processing

* refactor: replace ioutil with os package for file operations in kustomizations.go

* delete: remove repository_layout_test.go file

* feat(clustertool)!: read the Talos cluster name from configuration (#676)

* feat(clustertool)!: read the Talos cluster name from configuration

* feat(clustertool): rename file multinode to generate

* idem

* fix(clustertool): detect the previous native Talos layout during init (#683)

* fix(clustertool): set namespaces on Flux Kustomizations (#684)

* fix(clustertool): exclude age secret from generated Flux resources

* fix(clustertool): exclude age secret from generated Flux resources (#686)

* zucht
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