this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(nixos): bootstrap GitOps with k3s manifests

Khue Doan 2f9587d7 d0b6e6f1

+45
+45
infra/_modules/nixos/profiles/k3s-addons.nix
··· 4 4 { 5 5 services = { 6 6 k3s = { 7 + # TODO we may run into consistency problem with multiple master nodes: 8 + # From https://docs.k3s.io/installation/packaged-components: 9 + # If you have multiple server nodes, and place additional AddOn manifests on 10 + # more than one server, it is your responsibility to ensure that files stay 11 + # in sync across those nodes. K3s does not sync AddOn content between 12 + # nodes, and cannot guarantee correct behavior if different servers attempt 13 + # to deploy conflicting manifests. 7 14 manifests = { 8 15 flux = { 9 16 source = pkgs.runCommand "flux-install-manifest" { ··· 38 45 --namespace registry \ 39 46 --values ${./values/registry.yaml} > $out/registry.yaml 40 47 ''; 48 + }; 49 + gitops = { 50 + content = [ 51 + { 52 + apiVersion = "source.toolkit.fluxcd.io/v1"; 53 + kind = "GitRepository"; 54 + metadata = { 55 + name = "gitops"; 56 + namespace = "flux-system"; 57 + }; 58 + spec = { 59 + interval = "1m"; 60 + # TODO use internal URL 61 + # url = "http://forgejo-http.forgejo.svc.cluster.local:3000/khuedoan/cloudlab"; 62 + url = "https://code.khuedoan.com/khuedoan/cloudlab"; 63 + ref = { 64 + branch = "flux-migration"; # TODO switch back to master 65 + }; 66 + }; 67 + } 68 + { 69 + apiVersion = "kustomize.toolkit.fluxcd.io/v1"; 70 + kind = "Kustomization"; 71 + metadata = { 72 + name = "platform"; 73 + namespace = "flux-system"; 74 + }; 75 + spec = { 76 + interval = "1m"; 77 + path = "platform/production"; 78 + prune = true; 79 + sourceRef = { 80 + kind = "GitRepository"; 81 + name = "gitops"; 82 + }; 83 + }; 84 + } 85 + ]; 41 86 }; 42 87 }; 43 88 };