2024-04-13 14:37:18 +00:00
|
|
|
# We deploy several resources that rely on "custom resource definitions".
|
|
|
|
# We must first import these resources definitions, before deploying resources that depend on them.
|
2024-05-24 21:40:19 +00:00
|
|
|
{ lib, kubenix, nixhelm, system, machines, ... }: {
|
2024-04-13 14:37:18 +00:00
|
|
|
imports = [
|
|
|
|
kubenix.modules.k8s
|
|
|
|
kubenix.modules.helm
|
|
|
|
];
|
|
|
|
|
|
|
|
config = {
|
|
|
|
kubenix.project = "home";
|
|
|
|
|
|
|
|
kubernetes = {
|
|
|
|
kubeconfig = "~/.kube/config";
|
|
|
|
|
|
|
|
# TODO: These were copied from https://github.com/cert-manager/cert-manager/releases/download/v1.14.4/cert-manager.crds.yaml
|
|
|
|
# See https://cert-manager.io/docs/installation/helm/
|
|
|
|
# Seems kubenix cannot import a list of resources, but 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
|
|
|
|
];
|
|
|
|
|
|
|
|
helm.releases = {
|
|
|
|
metallb = {
|
|
|
|
chart = nixhelm.chartsDerivations.${system}.metallb.metallb;
|
|
|
|
includeCRDs = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
cert-manager = {
|
|
|
|
chart = nixhelm.chartsDerivations.${system}.jetstack.cert-manager;
|
|
|
|
includeCRDs = false;
|
|
|
|
};
|
2024-05-08 19:42:08 +00:00
|
|
|
|
|
|
|
argo-workflows = {
|
|
|
|
chart = nixhelm.chartsDerivations.${system}.argoproj.argo-workflows;
|
|
|
|
includeCRDs = true;
|
|
|
|
};
|
2024-05-20 19:55:59 +00:00
|
|
|
|
|
|
|
longhorn = {
|
|
|
|
chart = nixhelm.chartsDerivations.${system}.longhorn.longhorn;
|
|
|
|
includeCRDs = true;
|
|
|
|
values = {
|
|
|
|
defaultSettings = {
|
|
|
|
defaultDataPath = "/mnt/longhorn";
|
|
|
|
storageMinimalAvailablePercentage = 0;
|
|
|
|
allowRecurringJobWhileVolumeDetached = true;
|
2024-05-26 12:34:19 +00:00
|
|
|
backupTarget = "nfs://lewis.dmz:/mnt/longhorn/persistent/longhorn-backup";
|
2024-05-20 19:55:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
persistence = {
|
|
|
|
defaultClassReplicaCount = 2;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-04-13 14:37:18 +00:00
|
|
|
};
|
2024-05-24 21:40:19 +00:00
|
|
|
|
2024-07-13 18:18:17 +00:00
|
|
|
resources = {
|
2024-07-14 09:47:46 +00:00
|
|
|
namespaces = {
|
2024-07-14 13:31:58 +00:00
|
|
|
static-websites = { };
|
2024-07-14 09:47:46 +00:00
|
|
|
freshrss = { };
|
2024-07-14 11:48:17 +00:00
|
|
|
radicale = { };
|
2024-07-14 11:58:08 +00:00
|
|
|
kms = { };
|
2024-07-14 12:14:08 +00:00
|
|
|
atuin = { };
|
2024-07-14 09:47:46 +00:00
|
|
|
};
|
|
|
|
|
2024-07-13 18:18:17 +00:00
|
|
|
nodes =
|
|
|
|
let
|
|
|
|
machinesWithKubernetesLabels = lib.filterAttrs (name: machine: machine.kubernetesNodeLabels != null) machines;
|
|
|
|
in
|
|
|
|
builtins.mapAttrs
|
|
|
|
(name: machine: {
|
|
|
|
metadata.labels = machine.kubernetesNodeLabels;
|
|
|
|
})
|
|
|
|
machinesWithKubernetesLabels;
|
|
|
|
};
|
2024-04-13 14:37:18 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|