2024-07-30 19:28:35 +00:00
|
|
|
{ myLib, ... }: {
|
2024-06-12 21:14:55 +00:00
|
|
|
kubernetes.resources = {
|
2024-07-14 12:14:08 +00:00
|
|
|
secrets.database.stringData = {
|
2024-06-15 20:27:07 +00:00
|
|
|
databasePassword = "ref+sops://secrets/kubernetes.yaml#/atuin/databasePassword";
|
|
|
|
databaseURL = "ref+sops://secrets/kubernetes.yaml#/atuin/databaseURL";
|
2024-06-12 21:14:55 +00:00
|
|
|
};
|
|
|
|
|
2024-07-14 12:14:08 +00:00
|
|
|
deployments.server.spec = {
|
|
|
|
selector.matchLabels.app = "atuin";
|
2024-06-12 21:14:55 +00:00
|
|
|
|
2024-07-14 12:14:08 +00:00
|
|
|
strategy = {
|
|
|
|
type = "RollingUpdate";
|
2024-06-12 21:14:55 +00:00
|
|
|
|
2024-07-14 12:14:08 +00:00
|
|
|
rollingUpdate = {
|
|
|
|
maxSurge = 0;
|
|
|
|
maxUnavailable = 1;
|
2024-06-12 21:14:55 +00:00
|
|
|
};
|
2024-07-14 12:14:08 +00:00
|
|
|
};
|
2024-06-12 21:14:55 +00:00
|
|
|
|
2024-07-14 12:14:08 +00:00
|
|
|
template = {
|
|
|
|
metadata.labels.app = "atuin";
|
2024-06-12 21:14:55 +00:00
|
|
|
|
2024-07-14 12:14:08 +00:00
|
|
|
spec = {
|
|
|
|
volumes = {
|
|
|
|
data.persistentVolumeClaim.claimName = "data";
|
|
|
|
database.persistentVolumeClaim.claimName = "database";
|
|
|
|
};
|
2024-06-12 21:14:55 +00:00
|
|
|
|
2024-07-14 12:14:08 +00:00
|
|
|
containers = {
|
|
|
|
atuin = {
|
2024-07-30 19:28:35 +00:00
|
|
|
image = myLib.globals.images.atuin;
|
2024-07-28 12:32:28 +00:00
|
|
|
imagePullPolicy = "IfNotPresent";
|
2024-07-14 12:14:08 +00:00
|
|
|
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 = "database";
|
|
|
|
key = "databaseURL";
|
2024-06-12 21:14:55 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-07-14 12:14:08 +00:00
|
|
|
volumeMounts = [{
|
|
|
|
name = "data";
|
|
|
|
mountPath = "/config";
|
|
|
|
}];
|
|
|
|
};
|
2024-06-12 21:14:55 +00:00
|
|
|
|
2024-07-14 12:14:08 +00:00
|
|
|
database = {
|
2024-07-30 19:28:35 +00:00
|
|
|
image = myLib.globals.images.atuinPostgres;
|
2024-07-14 12:14:08 +00:00
|
|
|
ports.web.containerPort = 5432;
|
2024-06-12 21:14:55 +00:00
|
|
|
|
2024-07-14 12:14:08 +00:00
|
|
|
env = {
|
|
|
|
POSTGRES_DB.value = "atuin";
|
|
|
|
POSTGRES_USER.value = "atuin";
|
2024-06-12 21:14:55 +00:00
|
|
|
|
2024-07-14 12:14:08 +00:00
|
|
|
POSTGRES_PASSWORD.valueFrom.secretKeyRef = {
|
|
|
|
name = "database";
|
|
|
|
key = "databasePassword";
|
|
|
|
};
|
2024-06-12 21:14:55 +00:00
|
|
|
};
|
2024-07-14 12:14:08 +00:00
|
|
|
|
|
|
|
volumeMounts = [{
|
|
|
|
name = "database";
|
|
|
|
mountPath = "/var/lib/postgresql/data";
|
|
|
|
}];
|
2024-06-12 21:14:55 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-07-14 12:14:08 +00:00
|
|
|
services.server.spec = {
|
2024-06-12 21:14:55 +00:00
|
|
|
selector.app = "atuin";
|
|
|
|
|
|
|
|
ports.web = {
|
|
|
|
port = 80;
|
|
|
|
targetPort = "web";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-07-14 12:14:08 +00:00
|
|
|
lab = {
|
|
|
|
ingresses.server = {
|
|
|
|
host = "atuin.kun.is";
|
|
|
|
|
|
|
|
service = {
|
|
|
|
name = "server";
|
|
|
|
portName = "web";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
longhorn.persistentVolumeClaim = {
|
|
|
|
data = {
|
|
|
|
volumeName = "atuin";
|
|
|
|
storage = "300Mi";
|
|
|
|
};
|
2024-06-12 21:14:55 +00:00
|
|
|
|
2024-07-14 12:14:08 +00:00
|
|
|
database = {
|
|
|
|
volumeName = "atuin-db";
|
|
|
|
storage = "300Mi";
|
|
|
|
};
|
2024-06-12 21:14:55 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|