From e5768b877dec9e01fab6ab876c5796c997ad7088 Mon Sep 17 00:00:00 2001 From: Julius de Jeu Date: Sat, 21 May 2022 23:50:30 +0200 Subject: [PATCH] Remove k3s, add podinfo to flux, begin registry --- flux/cluster/base/podinfo-source.yaml | 12 +++++++++++ nixos/flake.nix | 16 +++++++------- nixos/machines/k3s/default.nix | 30 --------------------------- nixos/machines/registry/default.nix | 10 +++++++++ 4 files changed, 30 insertions(+), 38 deletions(-) create mode 100644 flux/cluster/base/podinfo-source.yaml delete mode 100644 nixos/machines/k3s/default.nix create mode 100644 nixos/machines/registry/default.nix diff --git a/flux/cluster/base/podinfo-source.yaml b/flux/cluster/base/podinfo-source.yaml new file mode 100644 index 0000000..3314e62 --- /dev/null +++ b/flux/cluster/base/podinfo-source.yaml @@ -0,0 +1,12 @@ +--- +apiVersion: source.toolkit.fluxcd.io/v1beta2 +kind: GitRepository +metadata: + name: podinfo + namespace: flux-system +spec: + interval: 30s + ref: + branch: master + url: https://github.com/stefanprodan/podinfo + diff --git a/nixos/flake.nix b/nixos/flake.nix index 61b429e..5b74f25 100644 --- a/nixos/flake.nix +++ b/nixos/flake.nix @@ -100,14 +100,6 @@ }; }; - k3s = { - imports = [ ./machines/k3s ]; - deployment = { - targetHost = "k3s.lxd"; - tags = [ "system" ]; - }; - }; - minio = { imports = [ ./machines/minio ]; deployment = { @@ -122,6 +114,14 @@ }; }; + registry = { + imports = [ ./machines/registry ]; + deployment = { + targetHost = "registry.lxd"; + tags = [ "system" ]; + }; + }; + # k3s = { # imports = [ ./machines/k3s ]; # deployment = { diff --git a/nixos/machines/k3s/default.nix b/nixos/machines/k3s/default.nix deleted file mode 100644 index e433099..0000000 --- a/nixos/machines/k3s/default.nix +++ /dev/null @@ -1,30 +0,0 @@ -{ config, pkgs, lib, ... }: { - imports = [ ../../common ../../common/lxc.nix ]; - networking.hostName = "k3s"; - system.stateVersion = "21.11"; - - # Additional packages - environment.systemPackages = with pkgs; [ iptables vim ]; - - # Disable the firewall as we need all the ports - networking.firewall.enable = false; - - # Force-enable Cgroupv2 - systemd.enableUnifiedCgroupHierarchy = lib.mkForce true; - - # Ensure `mount` and `grep` are available - systemd.services.k3s.path = [ pkgs.gnugrep pkgs.utillinux ]; - - # Enable k3s as a master node - services.k3s = { - enable = true; - role = "server"; - - extraFlags = builtins.toString [ - "--data-dir=/var/lib/k3s" # Set data dir to var lib - "--cluster-init" # Enable embedded etcd - "--cluster-cidr=10.69.0.0/16" # the default of 10.42.0.0/16 clashes with my own network - "--tls-san asraphiel.dev" # Set the SAN to the hostname - ]; - }; -} diff --git a/nixos/machines/registry/default.nix b/nixos/machines/registry/default.nix new file mode 100644 index 0000000..878ab8f --- /dev/null +++ b/nixos/machines/registry/default.nix @@ -0,0 +1,10 @@ +{ config, pkgs, deployment, ... }: { + imports = [ ../../common ../../common/lxc.nix ]; + networking.hostName = "registry"; + system.stateVersion = "21.11"; + + deployment.keys."wahaha" = { + text = "wahaha"; + + }; +}