This repository contains Infrastructure as Code for Kubernetes home clusters, templated from the Flux2 Kustomize Helm Example.
- Talos Linux
- Fluxcd
- Helm
- Kustomize
- Task
- Sops
- Pre-Commit
pre-commit installtask talos:dash
# OR
tadash1talosctl apply-config --insecure \
--nodes [NODE IP] \
--file controlplane.yaml | worker.yaml- Update talos version in
hacking/ansible/talos-upgrade.yaml - Run
task talos:upgrade - Manually update worker and control files with new version:
sops --d --in-place talos/worker.yaml - Commit and push changes
Generate secrets.yaml from control plane configuration:
talosctl gen secrets --from-controlplane-config controlplane-1.yamltalosctl get disks --nodes 192.168.2.2Upgrade Kubernetes version:
Note: At times you need to run brew install siderolabs/tap/talosctl to upgrade talosctl CLI.
- Test a dry run upgrade via:
talosctl --nodes 192.168.2.2 upgrade-k8s --to v1.35.1 --dry-run - Run the actual upgrade:
talosctl --nodes 192.168.2.2 upgrade-k8s --to v1.35.1 - Update talos worker and control files via:
./hacking/k8-upgrade/update-sourcefiles.sh 1.35.1 - Commit and push changes
This project uses SOPS and the external-secrets operator with bit-warden as the secret store.
SOPS is used for encrypting files within the repo. This include the Talos config files.
For detailed information, see the Flux SOPS guide.
The operator is used in conjunction with the bitwarden-cli container. All api keys, password etc use the operator.
The general idea is the Operator calls the bitwarden-cli via a GET to http://bitwarden-cli.bitwarden.svc.cluster.local:8087/object/item/{{ .remoteRef.key }}. The key is the ID of the secret in bit warden.
Only the pods in the namespace external-secrets can poll the bitwarden-cli. This is achieved via a NetworkPolicy.
The bitwarden-cli quries vault and returns the secret. The Operator then creates a K8s native Secret in the cluster based of the ExternalSecret spec.
For detailed information, see the .
Build apps manifest:
flux build kustomization apps --path apps/local/Build infra local manifest:
flux build kustomization infra-controllers-local --path infrastructure/localBuild without connecting to cluster:
flux build kustomization infra-dependencies --path infrastructure/dependencies \
--kustomization-file infrastructure/dependencies/kustomization.yaml \
--dry-runSync git repo:
flux reconcile source git flux-systemSet up environment variables:
export GITHUB_TOKEN=<your-token>
export GITHUB_USER=umizoom
export GITHUB_REPO=https://github.com/umizoom/homek8sBootstrap staging cluster:
flux bootstrap github \
--context=kind-kind \
--owner=${GITHUB_USER} \
--repository=${GITHUB_REPO} \
--branch=refactor \
--personal \
--path=clusters/localBootstrap production cluster:
flux bootstrap github \
--owner=${GITHUB_USER} \
--repository=${GITHUB_REPO} \
--branch=main \
--personal \
--path=clusters/production