feat: Move to Cilium

This commit is contained in:
Jan-Bulthuis 2026-01-17 13:32:26 +01:00
parent cf10e1e963
commit b5a37bb46c

View File

@ -33,6 +33,8 @@
enable = true; enable = true;
extraFlags = [ extraFlags = [
"--cluster-domain ${inputs.secrets.lab.k3s.clusterDomain}" "--cluster-domain ${inputs.secrets.lab.k3s.clusterDomain}"
"--flannel-backend=none"
"--disable-network-policy"
]; ];
disable = [ disable = [
# "coredns" # CoreDNS is required for Flux to be able to bootstrap the cluster (Flux needs to resolve the git repo) # "coredns" # CoreDNS is required for Flux to be able to bootstrap the cluster (Flux needs to resolve the git repo)
@ -41,6 +43,7 @@
"local-storage" "local-storage"
"metrics-server" "metrics-server"
"runtimes" "runtimes"
"kube-proxy"
]; ];
manifests = { manifests = {
git-ssh-key = { git-ssh-key = {
@ -57,6 +60,20 @@
}; };
}; };
autoDeployCharts = { autoDeployCharts = {
cilium = {
name = "cilium";
repo = "oci://quay.io/cilium/charts/cilium";
version = "1.17.12";
hash = "sha256-TfT6sFseOKq3+3solqF6+foEukl34MZzD3T4skCVBEI=";
createNamespace = true;
targetNamespace = "cilium-system";
values = {
operator.replicas = 1;
};
extraFieldDefinitions = {
spec.bootstrap = true;
};
};
flux-operator = { flux-operator = {
name = "flux-operator"; name = "flux-operator";
repo = "oci://ghcr.io/controlplaneio-fluxcd/charts/flux-operator"; repo = "oci://ghcr.io/controlplaneio-fluxcd/charts/flux-operator";
@ -137,7 +154,7 @@
kind: List kind: List
items:" > /opt/k3s-secrets-backup/namespaces.yaml items:" > /opt/k3s-secrets-backup/namespaces.yaml
${pkgs.gnugrep}/bin/grep -oP '\snamespace: \K.*' /opt/k3s-secrets-backup/secrets.yaml | sort -u | while read -r ns; do ${pkgs.gnugrep}/bin/grep -oP '\snamespace: \K.*' /opt/k3s-secrets-backup/secrets.yaml | sort -u | ${pkgs.gnugrep}/bin/grep -v -e "cilium-secrets" | while read -r ns; do
echo "- apiVersion: v1 echo "- apiVersion: v1
kind: Namespace kind: Namespace
metadata: metadata:
@ -152,11 +169,14 @@
environment.variables = { environment.variables = {
KUBECONFIG = "/etc/rancher/k3s/k3s.yaml"; KUBECONFIG = "/etc/rancher/k3s/k3s.yaml";
CILIUM_NAMESPACE = "cilium-system";
}; };
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
fluxcd fluxcd
k9s k9s
cilium-cli
hubble
]; ];
# Use correct disko profile # Use correct disko profile