Flux CD for the infrastructure on my home k3s cluster.
Find a file
2026-03-11 17:23:40 -04:00
.github/workflows added codeberg sync 2026-03-05 20:16:32 -05:00
apps Automated image update 2026-03-11 20:51:52 +00:00
cluster removed sops from cluster folder 2026-03-05 18:58:45 -05:00
infrastructure added always pull policy 2026-03-11 17:23:40 -04:00
.gitignore added gitignore 2026-02-02 20:44:59 -05:00
readme.md fixed github link in readme 2026-03-06 07:32:34 -05:00
sops.md disabled old apps repo 2026-03-05 17:29:20 -05:00

Flux CD Deployment

This repository is a Flux CD deployment for a k3s cluster, running on three Beelink Mini PC's. One k3s server node and one k3s worker node on each host. If you're reading this, and you're not the owner of this particular cluster, you really shouldn't try to use this repository directly. Feel free to reference the deployment strategy and specifics, but don't try to use them unless you know what you're doing.

Repository Structure

 ├── apps             # Apps Folder:
 │   ├── application1 # All top-level applications
 │   ├── application2 # running in the cluster are
 │   └── application3 # defined in this folder.
 |
 ├── cluster                    # Cluster Folder:
 │   ├── cluster-apps           # Kustomization
 │   ├── cluster-infrastructure # Kustomization
 │   ├── flux-system            # Flux Kustomization - NO TOUCHY
 │   └── update-automation      # Flux Update Automations
 |
 └── infrastructure # Infrastructure Folder:
     ├── service1   # Core services required for the cluster
     ├── service2   # to operate are defined in this folder.
     └── service3   # Storage, Ingress, Databases, etc.

Reconciliation

Watch the Flux Kustomizations

flux get kustomizations --watch

Reconcile any changes

# Apps
flux reconcile kustomization cluster-apps --with-source

# Cluster
flux reconcile kustomization flux-system --with-source

# Infrastructure
flux reconcile kustomization cluster-infrastructure --with-source

Local Machine Setup

Install kubectl

cd ~
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

Install flux

The command below will install flux on a local device to manage the cluster. This should NOT be installed on the cluster.

curl -s https://fluxcd.io/install.sh | sudo bash
# verify
flux check --pre

Install helm

Helm also needs to be installed on a local device to properly manage the cluster.

curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
# remove the script when install is complete
rm get_helm.sh

Create a GitHub Token

The token needs to have repo access. I had to create it as a classic token.

https://github.com/settings/tokens

Bootstrap the Cluster

The command below will install Flux on the cluster and reference the repository.

flux bootstrap github \
  --components-extra=image-reflector-controller,image-automation-controller \
  --owner=cvsickle \
  --repository=cluster-flux \
  --branch=main \
  --path=cluster \
  --personal \
  --token-auth
# verify
flux check
# double verify
kubectl get pods -n flux-system

Misc. Commands

Get Helm Chart Versions

helm search repo <reponame>/<chartname> --versions

Helpful Things