2024-07-21 18:02:40 +00:00
|
|
|
{ myLib, ... }: {
|
2024-03-28 20:44:21 +00:00
|
|
|
kubernetes.resources = {
|
2024-07-21 14:50:52 +00:00
|
|
|
serviceAccounts.syncthing = { };
|
|
|
|
|
2024-07-16 13:31:47 +00:00
|
|
|
deployments.syncthing.spec = {
|
|
|
|
selector.matchLabels.app = "syncthing";
|
2024-03-28 20:44:21 +00:00
|
|
|
|
2024-07-21 14:50:52 +00:00
|
|
|
strategy = {
|
|
|
|
type = "RollingUpdate";
|
|
|
|
|
|
|
|
rollingUpdate = {
|
|
|
|
maxSurge = 0;
|
|
|
|
maxUnavailable = 1;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-07-16 13:31:47 +00:00
|
|
|
template = {
|
|
|
|
metadata.labels.app = "syncthing";
|
2024-03-28 20:44:21 +00:00
|
|
|
|
2024-07-16 13:31:47 +00:00
|
|
|
spec = {
|
2024-07-21 14:50:52 +00:00
|
|
|
serviceAccountName = "syncthing";
|
|
|
|
|
2024-07-16 13:31:47 +00:00
|
|
|
containers.syncthing = {
|
|
|
|
image = "lscr.io/linuxserver/syncthing:1.23.6";
|
|
|
|
ports.web.containerPort = 8384;
|
2024-07-21 14:50:52 +00:00
|
|
|
imagePullPolicy = "Always";
|
2024-03-28 20:44:21 +00:00
|
|
|
|
2024-07-16 13:31:47 +00:00
|
|
|
env = {
|
|
|
|
PUID.value = "33";
|
|
|
|
PGID.value = "33";
|
|
|
|
TZ.value = "Europe/Amsterdam";
|
2024-05-23 19:34:29 +00:00
|
|
|
};
|
2024-03-28 20:44:21 +00:00
|
|
|
|
2024-07-16 13:31:47 +00:00
|
|
|
volumeMounts = [
|
|
|
|
{
|
|
|
|
name = "config";
|
|
|
|
mountPath = "/config";
|
|
|
|
}
|
|
|
|
{
|
|
|
|
name = "music";
|
|
|
|
mountPath = "/music";
|
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
2024-05-23 19:34:29 +00:00
|
|
|
|
2024-07-16 13:31:47 +00:00
|
|
|
volumes = {
|
|
|
|
config.persistentVolumeClaim.claimName = "config";
|
|
|
|
music.persistentVolumeClaim.claimName = "music";
|
|
|
|
};
|
|
|
|
|
|
|
|
securityContext = {
|
|
|
|
fsGroup = 33;
|
|
|
|
fsGroupChangePolicy = "OnRootMismatch";
|
2024-05-23 19:34:29 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2024-03-28 20:44:21 +00:00
|
|
|
|
|
|
|
services.syncthing.spec = {
|
2024-07-21 18:02:40 +00:00
|
|
|
type = "LoadBalancer";
|
|
|
|
loadBalancerIP = myLib.globals.syncthingWebIPv4;
|
2024-03-28 20:44:21 +00:00
|
|
|
selector.app = "syncthing";
|
|
|
|
|
2024-04-14 19:43:31 +00:00
|
|
|
ports.web = {
|
2024-03-28 20:44:21 +00:00
|
|
|
port = 80;
|
2024-04-14 19:43:31 +00:00
|
|
|
targetPort = "web";
|
|
|
|
};
|
2024-03-28 20:44:21 +00:00
|
|
|
};
|
2024-07-16 13:31:47 +00:00
|
|
|
|
|
|
|
persistentVolumeClaims.music.spec = {
|
|
|
|
accessModes = [ "ReadWriteMany" ];
|
|
|
|
storageClassName = "";
|
|
|
|
resources.requests.storage = "1Mi";
|
|
|
|
volumeName = "music-syncthing";
|
|
|
|
};
|
2024-04-14 21:11:19 +00:00
|
|
|
};
|
2024-03-28 20:44:21 +00:00
|
|
|
|
2024-04-14 21:34:54 +00:00
|
|
|
lab = {
|
2024-07-16 13:31:47 +00:00
|
|
|
longhorn.persistentVolumeClaim.config = {
|
|
|
|
volumeName = "syncthing";
|
|
|
|
storage = "400Mi";
|
|
|
|
};
|
2024-07-21 14:50:52 +00:00
|
|
|
|
2024-07-21 17:47:22 +00:00
|
|
|
tailscaleIngresses.tailscale = {
|
|
|
|
host = "sync";
|
|
|
|
service.name = "syncthing";
|
2024-07-21 14:50:52 +00:00
|
|
|
};
|
2024-03-28 20:44:21 +00:00
|
|
|
};
|
|
|
|
}
|