feat(atuin): Move to separate k8s namespace

This commit is contained in:
Pim Kunis 2024-07-14 14:14:08 +02:00
parent e4b7b69bbb
commit 3fcbbfa8c2
6 changed files with 78 additions and 65 deletions

View file

@ -56,6 +56,7 @@ Currently, the applications being deployed like this are:
- `freshrss` - `freshrss`
- `radicale` - `radicale`
- `kms` - `kms`
- `atuin`
## Known bugs ## Known bugs

View file

@ -72,4 +72,6 @@
"${self}/kubenix-modules/radicale.nix" "radicale" "radicale"; "${self}/kubenix-modules/radicale.nix" "radicale" "radicale";
kubenix.kms = mkDeployScriptAndManifest kubenix.kms = mkDeployScriptAndManifest
"${self}/kubenix-modules/kms.nix" "kms" "kms"; "${self}/kubenix-modules/kms.nix" "kms" "kms";
kubenix.atuin = mkDeployScriptAndManifest
"${self}/kubenix-modules/atuin.nix" "atuin" "atuin";
}) })

View file

@ -13,7 +13,6 @@ let
./dnsmasq.nix ./dnsmasq.nix
./blog.nix ./blog.nix
./attic.nix ./attic.nix
./atuin.nix
./immich.nix ./immich.nix
# ./argo.nix # ./argo.nix
# ./minecraft.nix # ./minecraft.nix

View file

@ -1,14 +1,11 @@
{ {
kubernetes.resources = { kubernetes.resources = {
secrets.atuin.stringData = { secrets.database.stringData = {
databasePassword = "ref+sops://secrets/kubernetes.yaml#/atuin/databasePassword"; databasePassword = "ref+sops://secrets/kubernetes.yaml#/atuin/databasePassword";
databaseURL = "ref+sops://secrets/kubernetes.yaml#/atuin/databaseURL"; databaseURL = "ref+sops://secrets/kubernetes.yaml#/atuin/databaseURL";
}; };
deployments.atuin = { deployments.server.spec = {
metadata.labels.app = "atuin";
spec = {
selector.matchLabels.app = "atuin"; selector.matchLabels.app = "atuin";
strategy = { strategy = {
@ -25,8 +22,8 @@
spec = { spec = {
volumes = { volumes = {
data.persistentVolumeClaim.claimName = "atuin"; data.persistentVolumeClaim.claimName = "data";
db.persistentVolumeClaim.claimName = "atuin-db"; database.persistentVolumeClaim.claimName = "database";
}; };
containers = { containers = {
@ -42,7 +39,7 @@
ATUIN_OPEN_REGISTRATION.value = "false"; ATUIN_OPEN_REGISTRATION.value = "false";
ATUIN_DB_URI.valueFrom.secretKeyRef = { ATUIN_DB_URI.valueFrom.secretKeyRef = {
name = "atuin"; name = "database";
key = "databaseURL"; key = "databaseURL";
}; };
}; };
@ -62,13 +59,13 @@
POSTGRES_USER.value = "atuin"; POSTGRES_USER.value = "atuin";
POSTGRES_PASSWORD.valueFrom.secretKeyRef = { POSTGRES_PASSWORD.valueFrom.secretKeyRef = {
name = "atuin"; name = "database";
key = "databasePassword"; key = "databasePassword";
}; };
}; };
volumeMounts = [{ volumeMounts = [{
name = "db"; name = "database";
mountPath = "/var/lib/postgresql/data"; mountPath = "/var/lib/postgresql/data";
}]; }];
}; };
@ -76,9 +73,8 @@
}; };
}; };
}; };
};
services.atuin.spec = { services.server.spec = {
selector.app = "atuin"; selector.app = "atuin";
ports.web = { ports.web = {
@ -88,12 +84,26 @@
}; };
}; };
lab.ingresses.atuin = { lab = {
ingresses.server = {
host = "atuin.kun.is"; host = "atuin.kun.is";
service = { service = {
name = "atuin"; name = "server";
portName = "web"; portName = "web";
}; };
}; };
longhorn.persistentVolumeClaim = {
data = {
volumeName = "atuin";
storage = "300Mi";
};
database = {
volumeName = "atuin-db";
storage = "300Mi";
};
};
};
} }

View file

@ -65,6 +65,7 @@
freshrss = { }; freshrss = { };
radicale = { }; radicale = { };
kms = { }; kms = { };
atuin = { };
}; };
nodes = nodes =

View file

@ -36,8 +36,6 @@
bazarr.storage = "25Mi"; bazarr.storage = "25Mi";
attic.storage = "15Gi"; attic.storage = "15Gi";
attic-db.storage = "150Mi"; attic-db.storage = "150Mi";
atuin.storage = "300Mi";
atuin-db.storage = "300Mi";
immich.storage = "50Gi"; immich.storage = "50Gi";
immich-db.storage = "5Gi"; immich-db.storage = "5Gi";
}; };
@ -45,6 +43,8 @@
longhorn.persistentVolume = { longhorn.persistentVolume = {
freshrss.storage = "1Gi"; freshrss.storage = "1Gi";
radicale.storage = "200Mi"; radicale.storage = "200Mi";
atuin.storage = "300Mi";
atuin-db.storage = "300Mi";
}; };
nfsVolumes = { nfsVolumes = {