93 lines
2.8 KiB
Nix
93 lines
2.8 KiB
Nix
# We deploy several resources that rely on "custom resource definitions".
|
|
# We must first import these resources definitions, before deploying resources that depend on them.
|
|
{ lib, kubenix, nixhelm, system, machines, ... }: {
|
|
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;
|
|
};
|
|
|
|
argo-workflows = {
|
|
chart = nixhelm.chartsDerivations.${system}.argoproj.argo-workflows;
|
|
includeCRDs = true;
|
|
};
|
|
|
|
longhorn = {
|
|
chart = nixhelm.chartsDerivations.${system}.longhorn.longhorn;
|
|
includeCRDs = true;
|
|
values = {
|
|
defaultSettings = {
|
|
defaultDataPath = "/mnt/longhorn";
|
|
storageMinimalAvailablePercentage = 0;
|
|
allowRecurringJobWhileVolumeDetached = true;
|
|
backupTarget = "nfs://lewis.dmz:/mnt/longhorn/persistent/longhorn-backup";
|
|
};
|
|
|
|
persistence = {
|
|
defaultClassReplicaCount = 2;
|
|
};
|
|
};
|
|
};
|
|
|
|
immich = {
|
|
chart = nixhelm.chartsDerivations.${system}.immich.immich;
|
|
includeCRDs = true;
|
|
values = {
|
|
immich.persistence.library.existingClaim = "immich-test";
|
|
redis.enabled = true;
|
|
postgresql.enabled = true;
|
|
};
|
|
};
|
|
};
|
|
|
|
resources.nodes =
|
|
let
|
|
machinesWithKubernetesLabels = lib.filterAttrs (name: machine: machine.kubernetesNodeLabels != null) machines;
|
|
in
|
|
builtins.mapAttrs
|
|
(name: machine: {
|
|
metadata.labels = machine.kubernetesNodeLabels;
|
|
})
|
|
machinesWithKubernetesLabels;
|
|
};
|
|
|
|
lab.ingresses.immich-test = {
|
|
host = "immich.kun.is";
|
|
entrypoint = "localsecure";
|
|
|
|
service = {
|
|
name = "immich-server";
|
|
portName = "http";
|
|
};
|
|
};
|
|
};
|
|
}
|