migrate jellyfin to kubernetes
This commit is contained in:
parent
d858f88681
commit
9e92c85277
4 changed files with 136 additions and 34 deletions
|
@ -19,6 +19,7 @@
|
|||
./paperless-ngx.nix
|
||||
./kitchenowl.nix
|
||||
./forgejo.nix
|
||||
./media.nix
|
||||
];
|
||||
kubernetes.kubeconfig = "~/.kube/config";
|
||||
kubenix.project = "home";
|
||||
|
|
129
nix/flake/kubenix/media.nix
Normal file
129
nix/flake/kubenix/media.nix
Normal file
|
@ -0,0 +1,129 @@
|
|||
{
|
||||
kubernetes.resources = {
|
||||
configMaps.jellyfin-env.data.JELLYFIN_PublishedServerUrl = "https://media.kun.is";
|
||||
|
||||
deployments.jellyfin = {
|
||||
metadata.labels = {
|
||||
app = "media";
|
||||
component = "jellyfin";
|
||||
};
|
||||
|
||||
spec = {
|
||||
selector.matchLabels = {
|
||||
app = "media";
|
||||
component = "jellyfin";
|
||||
};
|
||||
|
||||
template = {
|
||||
metadata.labels = {
|
||||
app = "media";
|
||||
component = "jellyfin";
|
||||
};
|
||||
|
||||
spec = {
|
||||
containers.jellyfin = {
|
||||
image = "jellyfin/jellyfin:10.8.13-1";
|
||||
envFrom = [{ configMapRef.name = "jellyfin-env"; }];
|
||||
|
||||
ports = [{
|
||||
containerPort = 8096;
|
||||
protocol = "TCP";
|
||||
}];
|
||||
|
||||
volumeMounts = [
|
||||
{
|
||||
name = "config";
|
||||
mountPath = "/config";
|
||||
}
|
||||
{
|
||||
name = "media";
|
||||
mountPath = "/media";
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
volumes = [
|
||||
{
|
||||
name = "config";
|
||||
persistentVolumeClaim.claimName = "jellyfin-config";
|
||||
}
|
||||
{
|
||||
name = "media";
|
||||
persistentVolumeClaim.claimName = "media";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
persistentVolumes = {
|
||||
jellyfin-config.spec = {
|
||||
capacity.storage = "1Mi";
|
||||
accessModes = [ "ReadWriteMany" ];
|
||||
|
||||
nfs = {
|
||||
server = "lewis.hyp";
|
||||
path = "/mnt/data/nfs/jellyfin/config";
|
||||
};
|
||||
};
|
||||
|
||||
media.spec = {
|
||||
capacity.storage = "1Mi";
|
||||
accessModes = [ "ReadWriteMany" ];
|
||||
|
||||
nfs = {
|
||||
server = "lewis.hyp";
|
||||
path = "/mnt/data/nfs/media";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
persistentVolumeClaims = {
|
||||
jellyfin-config.spec = {
|
||||
accessModes = [ "ReadWriteMany" ];
|
||||
storageClassName = "";
|
||||
resources.requests.storage = "1Mi";
|
||||
volumeName = "jellyfin-config";
|
||||
};
|
||||
|
||||
media.spec = {
|
||||
accessModes = [ "ReadWriteMany" ];
|
||||
storageClassName = "";
|
||||
resources.requests.storage = "1Mi";
|
||||
volumeName = "media";
|
||||
};
|
||||
};
|
||||
|
||||
services.jellyfin.spec = {
|
||||
selector = {
|
||||
app = "media";
|
||||
component = "jellyfin";
|
||||
};
|
||||
|
||||
ports = [{
|
||||
protocol = "TCP";
|
||||
port = 80;
|
||||
targetPort = 8096;
|
||||
}];
|
||||
};
|
||||
|
||||
ingresses.jellyfin.spec = {
|
||||
ingressClassName = "traefik";
|
||||
|
||||
rules = [{
|
||||
host = "media.kun.is";
|
||||
|
||||
http.paths = [{
|
||||
path = "/";
|
||||
pathType = "Prefix";
|
||||
|
||||
backend.service = {
|
||||
name = "jellyfin";
|
||||
port.number = 80;
|
||||
};
|
||||
}];
|
||||
}];
|
||||
};
|
||||
};
|
||||
}
|
Reference in a new issue