Add Atuin service
This commit is contained in:
parent
dc73a0bf2c
commit
5ca2b6f473
4 changed files with 107 additions and 2 deletions
|
@ -17,6 +17,7 @@ let
|
|||
./dnsmasq.nix
|
||||
./blog.nix
|
||||
./attic.nix
|
||||
./atuin.nix
|
||||
# ./argo.nix
|
||||
# ./minecraft.nix
|
||||
];
|
||||
|
|
99
kubenix-modules/atuin.nix
Normal file
99
kubenix-modules/atuin.nix
Normal file
|
@ -0,0 +1,99 @@
|
|||
{
|
||||
kubernetes.resources = {
|
||||
secrets.atuin.stringData = {
|
||||
databasePassword = "ref+sops://secrets/sops.yaml#/atuin/databasePassword";
|
||||
databaseURL = "ref+sops://secrets/sops.yaml#/atuin/databaseURL";
|
||||
};
|
||||
|
||||
deployments.atuin = {
|
||||
metadata.labels.app = "atuin";
|
||||
|
||||
spec = {
|
||||
selector.matchLabels.app = "atuin";
|
||||
|
||||
strategy = {
|
||||
type = "RollingUpdate";
|
||||
|
||||
rollingUpdate = {
|
||||
maxSurge = 0;
|
||||
maxUnavailable = 1;
|
||||
};
|
||||
};
|
||||
|
||||
template = {
|
||||
metadata.labels.app = "atuin";
|
||||
|
||||
spec = {
|
||||
volumes = {
|
||||
data.persistentVolumeClaim.claimName = "atuin";
|
||||
db.persistentVolumeClaim.claimName = "atuin-db";
|
||||
};
|
||||
|
||||
containers = {
|
||||
atuin = {
|
||||
image = "ghcr.io/atuinsh/atuin:18.3.0";
|
||||
imagePullPolicy = "Always";
|
||||
ports.web.containerPort = 8888;
|
||||
args = [ "server" "start" ];
|
||||
|
||||
env = {
|
||||
ATUIN_HOST.value = "0.0.0.0";
|
||||
ATUIN_PORT.value = "8888";
|
||||
ATUIN_OPEN_REGISTRATION.value = "false";
|
||||
|
||||
ATUIN_DB_URI.valueFrom.secretKeyRef = {
|
||||
name = "atuin";
|
||||
key = "databaseURL";
|
||||
};
|
||||
};
|
||||
|
||||
volumeMounts = [{
|
||||
name = "data";
|
||||
mountPath = "/config";
|
||||
}];
|
||||
};
|
||||
|
||||
database = {
|
||||
image = "postgres:14";
|
||||
ports.web.containerPort = 5432;
|
||||
|
||||
env = {
|
||||
POSTGRES_DB.value = "atuin";
|
||||
POSTGRES_USER.value = "atuin";
|
||||
|
||||
POSTGRES_PASSWORD.valueFrom.secretKeyRef = {
|
||||
name = "atuin";
|
||||
key = "databasePassword";
|
||||
};
|
||||
};
|
||||
|
||||
volumeMounts = [{
|
||||
name = "db";
|
||||
mountPath = "/var/lib/postgresql/data";
|
||||
}];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.atuin.spec = {
|
||||
selector.app = "atuin";
|
||||
|
||||
ports.web = {
|
||||
port = 80;
|
||||
targetPort = "web";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
lab.ingresses.atuin = {
|
||||
host = "atuin.kun.is";
|
||||
|
||||
service = {
|
||||
name = "atuin";
|
||||
portName = "web";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -26,6 +26,8 @@
|
|||
attic.storage = "15Gi";
|
||||
attic-db.storage = "150Mi";
|
||||
immich-test.storage = "10Gi";
|
||||
atuin.storage = "600Mi";
|
||||
atuin-db.storage = "100Mi";
|
||||
};
|
||||
|
||||
nfsVolumes = {
|
||||
|
|
Reference in a new issue