From 7a407389891921f8cc0fd9c0218e0560a5028dec Mon Sep 17 00:00:00 2001 From: Pim Kunis Date: Wed, 17 Jul 2024 17:20:39 +0200 Subject: [PATCH] refactor(cert-manager): Consolidate NixOS module --- flake-parts/kubenix.nix | 4 ++-- .../{bootstrapDefault.nix => bootstrap-default.nix} | 0 kubenix-modules/bootstrap-kube-system.nix | 5 +++++ .../default.nix} | 12 ++++++------ .../manifests}/certificate.yaml | 0 .../manifests}/certificaterequest.yaml | 0 .../manifests}/challenge.yaml | 0 .../manifests}/clusterissuer.yaml | 0 .../manifests}/issuer.yaml | 0 .../manifests}/order.yaml | 0 10 files changed, 13 insertions(+), 8 deletions(-) rename kubenix-modules/{bootstrapDefault.nix => bootstrap-default.nix} (100%) create mode 100644 kubenix-modules/bootstrap-kube-system.nix rename kubenix-modules/{bootstrapKubeSystem.nix => cert-manager/default.nix} (76%) rename kubenix-modules/{cert-manager-manifests => cert-manager/manifests}/certificate.yaml (100%) rename kubenix-modules/{cert-manager-manifests => cert-manager/manifests}/certificaterequest.yaml (100%) rename kubenix-modules/{cert-manager-manifests => cert-manager/manifests}/challenge.yaml (100%) rename kubenix-modules/{cert-manager-manifests => cert-manager/manifests}/clusterissuer.yaml (100%) rename kubenix-modules/{cert-manager-manifests => cert-manager/manifests}/issuer.yaml (100%) rename kubenix-modules/{cert-manager-manifests => cert-manager/manifests}/order.yaml (100%) diff --git a/flake-parts/kubenix.nix b/flake-parts/kubenix.nix index 320731b..6645ca3 100644 --- a/flake-parts/kubenix.nix +++ b/flake-parts/kubenix.nix @@ -58,12 +58,12 @@ deployers = { bootstrap-default = { - module = "${self}/kubenix-modules/bootstrapDefault.nix"; + module = "${self}/kubenix-modules/bootstrap-default.nix"; namespace = "default"; }; bootstrap-kube-system = { - module = "${self}/kubenix-modules/bootstrapKubeSystem.nix"; + module = "${self}/kubenix-modules/bootstrap-kube-system.nix"; namespace = "kube-system"; }; diff --git a/kubenix-modules/bootstrapDefault.nix b/kubenix-modules/bootstrap-default.nix similarity index 100% rename from kubenix-modules/bootstrapDefault.nix rename to kubenix-modules/bootstrap-default.nix diff --git a/kubenix-modules/bootstrap-kube-system.nix b/kubenix-modules/bootstrap-kube-system.nix new file mode 100644 index 0000000..1e2ed59 --- /dev/null +++ b/kubenix-modules/bootstrap-kube-system.nix @@ -0,0 +1,5 @@ +{ + imports = [ + ./cert-manager + ]; +} diff --git a/kubenix-modules/bootstrapKubeSystem.nix b/kubenix-modules/cert-manager/default.nix similarity index 76% rename from kubenix-modules/bootstrapKubeSystem.nix rename to kubenix-modules/cert-manager/default.nix index 43db164..81570a6 100644 --- a/kubenix-modules/bootstrapKubeSystem.nix +++ b/kubenix-modules/cert-manager/default.nix @@ -5,12 +5,12 @@ # Seems kubenix cannot import a list of resources, only individual resources. # Might be good to create a PR for this. imports = [ - ./cert-manager-manifests/certificaterequest.yaml - ./cert-manager-manifests/certificate.yaml - ./cert-manager-manifests/challenge.yaml - ./cert-manager-manifests/clusterissuer.yaml - ./cert-manager-manifests/issuer.yaml - ./cert-manager-manifests/order.yaml + ./manifests/certificaterequest.yaml + ./manifests/certificate.yaml + ./manifests/challenge.yaml + ./manifests/clusterissuer.yaml + ./manifests/issuer.yaml + ./manifests/order.yaml ]; helm.releases = { diff --git a/kubenix-modules/cert-manager-manifests/certificate.yaml b/kubenix-modules/cert-manager/manifests/certificate.yaml similarity index 100% rename from kubenix-modules/cert-manager-manifests/certificate.yaml rename to kubenix-modules/cert-manager/manifests/certificate.yaml diff --git a/kubenix-modules/cert-manager-manifests/certificaterequest.yaml b/kubenix-modules/cert-manager/manifests/certificaterequest.yaml similarity index 100% rename from kubenix-modules/cert-manager-manifests/certificaterequest.yaml rename to kubenix-modules/cert-manager/manifests/certificaterequest.yaml diff --git a/kubenix-modules/cert-manager-manifests/challenge.yaml b/kubenix-modules/cert-manager/manifests/challenge.yaml similarity index 100% rename from kubenix-modules/cert-manager-manifests/challenge.yaml rename to kubenix-modules/cert-manager/manifests/challenge.yaml diff --git a/kubenix-modules/cert-manager-manifests/clusterissuer.yaml b/kubenix-modules/cert-manager/manifests/clusterissuer.yaml similarity index 100% rename from kubenix-modules/cert-manager-manifests/clusterissuer.yaml rename to kubenix-modules/cert-manager/manifests/clusterissuer.yaml diff --git a/kubenix-modules/cert-manager-manifests/issuer.yaml b/kubenix-modules/cert-manager/manifests/issuer.yaml similarity index 100% rename from kubenix-modules/cert-manager-manifests/issuer.yaml rename to kubenix-modules/cert-manager/manifests/issuer.yaml diff --git a/kubenix-modules/cert-manager-manifests/order.yaml b/kubenix-modules/cert-manager/manifests/order.yaml similarity index 100% rename from kubenix-modules/cert-manager-manifests/order.yaml rename to kubenix-modules/cert-manager/manifests/order.yaml