local base = import "k8s/configs/base.libsonnet"; local secrets = import "k8s/configs/environments/media/secrets.json"; local audiobookshelf = import "k8s/configs/templates/personal/media/audiobookshelf.libsonnet"; local jellyfin = import "k8s/configs/templates/personal/media/jellyfin.libsonnet"; local medusa = import "k8s/configs/templates/personal/media/medusa.libsonnet"; local overseerr = import "k8s/configs/templates/personal/media/overseerr.libsonnet"; local radarr = import "k8s/configs/templates/personal/media/radarr.libsonnet"; local readarr = import "k8s/configs/templates/personal/media/readarr.libsonnet"; local sabnzbd = import "k8s/configs/templates/personal/media/sabnzbd.libsonnet"; local sonarr = import "k8s/configs/templates/personal/media/sonarr.libsonnet"; local transmission = import "k8s/configs/templates/personal/media/transmission.libsonnet"; local nginxIngress = import "k8s/configs/templates/core/network/nginx-ingress.libsonnet"; local postgres = import "k8s/configs/templates/core/storage/postgres.libsonnet"; local namespace = "media"; local ctx = base.NewContext(base.helm); { namespace: { apiVersion: "v1", kind: "Namespace", metadata: { name: namespace, }, }, secrets: { sonarr: base.Secret("media", "sonarr") { type: "Opaque", data: { sonarr_pwd: secrets.sonarr_pwd, sonarr_db_pwd: secrets.sonarr_db_pwd, }, }, }, apps: { audiobookshelf: { audiobookPvc: base.RecoverableSimpleManyPvc(namespace, "audiobookshelf-audiobooks", "nfs-bulk", "200Gi",{ nfsServer: "apollo2.dominion.lan", volumeName: "pvc-37984a4e-9d89-4d5d-b348-bd5e25c81920", nfsPath: "/volume4/fs-bulk/home-audiobookshelf-audiobooks-pvc-37984a4e-9d89-4d5d-b348-bd5e25c81920", }), podcastPvc: base.RecoverableSimpleManyPvc(namespace, "audiobookshelf-podcasts", "nfs-bulk", "100Gi", { nfsServer: "apollo2.dominion.lan", volumeName: "pvc-553b981b-2cfb-4bdc-9ced-7e61e2444135", nfsPath: "/volume4/fs-bulk/home-audiobookshelf-podcasts-pvc-553b981b-2cfb-4bdc-9ced-7e61e2444135", }), configPvc: base.RecoverableSimpleManyPvc(namespace, "audiobookshelf-config", "nfs-client", "2Gi", { nfsServer: "apollo1.dominion.lan", volumeName: "pvc-fc159333-7d10-43d2-b5b7-9bf5c2a90756", nfsPath: "/volume3/fs/home-audiobookshelf-config-pvc-fc159333-7d10-43d2-b5b7-9bf5c2a90756", }), metadataPvc: base.RecoverableSimpleManyPvc(namespace, "audiobookshelf-metadata", "nfs-client", "20Gi", { nfsServer: "apollo1.dominion.lan", volumeName: "pvc-e5d188d0-a865-48d6-9b73-d52e51968b09", nfsPath: "/volume3/fs/home-audiobookshelf-metadata-pvc-e5d188d0-a865-48d6-9b73-d52e51968b09", }), app: audiobookshelf.App(audiobookshelf.Params { namespace: namespace, name: "audiobookshelf", filePath: std.thisFile, // Defined in "home" audiobookClaimName: "audiobookshelf-audiobooks", podcastClaimName: "audiobookshelf-podcasts", configClaimName: "audiobookshelf-config", metadataClaimName: "audiobookshelf-metadata", }), ingress: nginxIngress.Ingress(nginxIngress.IngressParams { namespace: namespace, name: "audiobookshelf", hosts: [ "audiobook.csbx.dev", ], serviceName: "audiobookshelf-ui", }), }, jellyfin: { seriesLakePvc: base.RecoverableSimpleManyPvc(namespace, "series-lake", "nfs-bulk", "1Ti", { volumeName: "pvc-25d9b914-8f6b-11e9-b70e-b8aeed7dc356", nfsPath: "/volume4/fs-bulk/media-series-lake-pvc-25d9b914-8f6b-11e9-b70e-b8aeed7dc356", nfsServer: "apollo2.dominion.lan", }), embyMoviesPvc: base.RecoverableSimpleManyPvc(namespace, "emby-movies", "nfs-bulk", "200Gi", { volumeName: "pvc-55dbf5e3-2b7d-11ea-9568-b8aeed7dc356", nfsPath: "/volume4/fs-bulk/media-emby-movies-pvc-55dbf5e3-2b7d-11ea-9568-b8aeed7dc356", nfsServer: "apollo2.dominion.lan", }), configPvc: base.RecoverableSimpleManyPvc(namespace, "jellyfin-config", "nfs-client", "10Gi", { volumeName: "pvc-74dbcc56-ecb1-42a7-a58e-9f99812ade7b", nfsPath: "/volume3/fs/media-jellyfin-config-pvc-74dbcc56-ecb1-42a7-a58e-9f99812ade7b", nfsServer: "apollo1.dominion.lan", }), animeConfigPvc: base.RecoverableSimpleManyPvc(namespace, "jellyfin-anime-config", "nfs-client", "10Gi", { volumeName: "pvc-080c47bf-d4ab-4c54-a5ea-004af6efafb9", nfsPath: "/volume3/fs/media-jellyfin-anime-config-pvc-080c47bf-d4ab-4c54-a5ea-004af6efafb9", nfsServer: "apollo1.dominion.lan", }), transcodePvc: base.RecoverableSimpleManyPvc(namespace, "jellyfin-transcode", "nfs-client", "200Gi", { volumeName: "pvc-cad1fdcd-a5eb-4f18-b248-f10d2f3c7e49", nfsPath: "/volume3/fs/media-jellyfin-transcode-pvc-cad1fdcd-a5eb-4f18-b248-f10d2f3c7e49", nfsServer: "apollo1.dominion.lan", }), animeSeriesPvc: base.RecoverableSimpleManyPvc(namespace, "anime-series", "nfs-bulk", "1Ti", { volumeName: "pvc-a80be844-bd62-4c27-842f-515e5d53da16", nfsPath: "/volume4/fs-bulk/media-anime-series-pvc-a80be844-bd62-4c27-842f-515e5d53da16", nfsServer: "apollo2.dominion.lan", }), animeMoviesPvc: base.RecoverableSimpleManyPvc(namespace, "anime-movies", "nfs-bulk", "200Gi", { volumeName: "pvc-2b2be1de-3f07-405e-a6be-52e1ae887a2f", nfsPath: "/volume4/fs-bulk/media-anime-movies-pvc-2b2be1de-3f07-405e-a6be-52e1ae887a2f", nfsServer: "apollo2.dominion.lan", }), app: jellyfin.App(jellyfin.Params { namespace: namespace, name: "jellyfin", filePath: std.thisFile, // Defined in "media/pvc.jsonnet" configClaimName: "jellyfin-config", serialClaimName: "series-lake", filmClaimName: "emby-movies", animeSeriesClaimName: "anime-series", animeMovieClaimName: "anime-movies", transcodeClaimName: "jellyfin-transcode", gpuNodeSelectorName: "nvidia" }), animeApp: jellyfin.App(jellyfin.Params { namespace: namespace, name: "jellyfin-anime", filePath: std.thisFile, configClaimName: "jellyfin-anime-config", serialClaimName: "anime-series", filmClaimName: "anime-movies", transcodeClaimName: "jellyfin-transcode", gpuNodeSelectorName: "nvidia", lsParams+: { resources: { limits: { cpu: "1000m", memory: "3Gi", }, requests: { cpu: "500m", memory: "1Gi", }, }, }, }), ingress: nginxIngress.Ingress(nginxIngress.IngressParams { namespace: namespace, name: "jellyfin", hosts: [ "jellyfin.cheapassbox.com", "jellyfin.csbx.dev", ], serviceName: "jellyfin-ui", }), animeIngress: nginxIngress.Ingress(nginxIngress.IngressParams { namespace: namespace, name: "jellyfin-anime", hosts: [ "anime.cheapassbox.com", "anime.csbx.dev", ], serviceName: "jellyfin-anime-ui", }), }, /* medusa: { medusaConfig: base.RecoverableSimpleManyPvc(namespace, "medusa-config", "nfs-client", "50Gi", { volumeName: "pvc-3e7f00bd-a03f-11e9-bad8-b8aeed7dc356", nfsPath: "/volume3/fs/media-medusa-config-pvc-3e7f00bd-a03f-11e9-bad8-b8aeed7dc356", nfsServer: "apollo1.dominion.lan", }), app: medusa.App(medusa.Params { namespace: namespace, name: "medusa", filePath: std.thisFile, // Defined in "media" configClaimName: "medusa-config", // Defined in "media" downloadsClaimName: "sabnzbd-downloads", // Defined in "media" tvSeriesClaimName: "series-lake", // Defined in "media" torrentFilesClaimName: "torrent-files", }), ingress: nginxIngress.Ingress(nginxIngress.IngressParams { namespace: namespace, name: "medusa", hosts: [ "medusa.csbx.dev", ], serviceName: "medusa-ui", annotations: nginxIngress.KubeCsbxOauthProxyAnnotations, }), }, */ overseerr: { configPvc: base.RecoverableSimpleManyPvc(namespace, "overseerr-config", "nfs-client", "1Gi", { volumeName: "pvc-6127be61-cfc9-4368-8a26-033d6aded518", nfsPath: "/volume3/fs/media-overseerr-config-pvc-6127be61-cfc9-4368-8a26-033d6aded518", nfsServer: "apollo1.dominion.lan", }), app: overseerr.App(overseerr.Params { namespace: namespace, name: "overseerr", filePath: std.thisFile, // Defined in "media" configClaimName: "overseerr-config", }), ingress: nginxIngress.Ingress(nginxIngress.IngressParams { namespace: namespace, name: "overseerr-alt", hosts: [ "overseerr.cheapassbox.com", "jellyseerr.csbx.dev", ], serviceName: "overseerr-ui", }), }, radarr: { configPvc: base.RecoverableSimplePvc(namespace, "radarr-config", "nfs-client", "200Mi", { volumeName: "pvc-3498101c-2b74-11ea-9568-b8aeed7dc356", nfsPath: "/volume3/fs/media-radarr-config-pvc-3498101c-2b74-11ea-9568-b8aeed7dc356", nfsServer: "apollo1.dominion.lan", }), app: radarr.App(radarr.Params { namespace: namespace, name: "radarr", filePath: std.thisFile, // Defined in "media" configClaimName: "radarr-config", // Defined in "media" downloadsClaimName: "sabnzbd-downloads", downloadsSubdirectory: null, // Defined in "media" moviesClaimName: "emby-movies", }), ingress: nginxIngress.Ingress(nginxIngress.IngressParams { namespace: namespace, name: "radarr", hosts: [ "radarr.cheapassbox.com", ], serviceName: "radarr-ui", annotations: nginxIngress.KubeOauthProxyAnnotations, }), ingress2: nginxIngress.Ingress(nginxIngress.IngressParams { namespace: namespace, name: "radarr-csbx", hosts: [ "radarr.csbx.dev", ], serviceName: "radarr-ui", annotations: nginxIngress.KubeCsbxOauthProxyAnnotations, }), }, sabnzbd: { configPvc: base.RecoverableSimplePvc(namespace, "sabnzbd-config", "nfs-client", "500Mi", { volumeName: "pvc-f623f46b-2b6f-11ea-9568-b8aeed7dc356", nfsPath: "/volume3/fs/media-sabnzbd-config-pvc-f623f46b-2b6f-11ea-9568-b8aeed7dc356", nfsServer: "apollo1.dominion.lan", }), downloadsLakePvc: base.RecoverableSimpleManyPvc(namespace, "downloads-lake", "nfs-bulk", "100Gi", { volumeName: "pvc-25dc4b81-8f6b-11e9-b70e-b8aeed7dc356", nfsPath: "/volume4/fs-bulk/media-downloads-lake-pvc-25dc4b81-8f6b-11e9-b70e-b8aeed7dc356", nfsServer: "apollo2.dominion.lan", }), sabnzbdDownloadsPvc: base.RecoverableSimpleManyPvc(namespace, "sabnzbd-downloads", "nfs-bulk", "500Gi", { volumeName: "pvc-34ed7806-2b74-11ea-9568-b8aeed7dc356", nfsPath: "/volume4/fs-bulk/media-sabnzbd-downloads-pvc-34ed7806-2b74-11ea-9568-b8aeed7dc356", nfsServer: "apollo2.dominion.lan", }), sabnzbdIncompleteDownloadsPvc: base.RecoverableSimpleManyPvc(namespace, "sabnzbd-incomplete-downloads", "nfs-bulk", "200Gi", { volumeName: "pvc-352a82d2-2b74-11ea-9568-b8aeed7dc356", nfsPath: "/volume4/fs-bulk/media-sabnzbd-incomplete-downloads-pvc-352a82d2-2b74-11ea-9568-b8aeed7dc356", nfsServer: "apollo2.dominion.lan", }), app: sabnzbd.App(sabnzbd.Params { namespace: namespace, name: "sabnzbd", filePath: std.thisFile, // Defined in "media" configClaimName: "sabnzbd-config", // Defined in "media" incompleteDownloadsClaimName: "sabnzbd-incomplete-downloads", // Defined in "media" downloadsClaimName: "sabnzbd-downloads", }), ingress: nginxIngress.Ingress(nginxIngress.IngressParams { namespace: namespace, name: "sabnzbd", hosts: [ "sabnzbd.cheapassbox.com", ], serviceName: "sabnzbd-ui", annotations: nginxIngress.KubeOauthProxyAnnotations, }), ingress2: nginxIngress.Ingress(nginxIngress.IngressParams { namespace: namespace, name: "sabnzbd-csbx", hosts: [ "sabnzbd.csbx.dev", ], serviceName: "sabnzbd-ui", annotations: nginxIngress.KubeCsbxOauthProxyAnnotations, }), }, sonarr: { regular: { configPvc: base.RecoverableSimplePvc(namespace, "sonarr-config", "nfs-client", "200Mi", { volumeName: "pvc-358613d9-2b74-11ea-9568-b8aeed7dc356", nfsPath: "/volume3/fs/media-sonarr-config-pvc-358613d9-2b74-11ea-9568-b8aeed7dc356", nfsServer: "apollo1.dominion.lan", }), db17Pvc: base.RecoverableSimpleManyPvc(namespace, "sonarr-pg-17", "nfs-client", "50Gi", { volumeName: "pvc-6c49c704-c33b-4159-8ceb-b87470a4f323", nfsPath: "/volume3/fs/media-sonarr-pg-17-pvc-6c49c704-c33b-4159-8ceb-b87470a4f323", nfsServer: "apollo1.dominion.lan", }), db17App: postgres.App(postgres.Params { namespace: namespace, name: "sonarr-pg-17", // TODO: image: "docker.io/bitnami/postgresql:17.2.0", filePath: std.thisFile, // Defined in "//kube/cfg/secrets/media.jsonnet" dataClaimName: "sonarr-pg-17", dbName: "sonarr-not-used", dbUser: "postgres", // Defined in local secrets dbPwdSecret: "sonarr", dbPwdSecretKey: "sonarr_db_pwd", }), app: sonarr.App(sonarr.Params { namespace: namespace, name: "sonarr", filePath: std.thisFile, // Defined in "media" configClaimName: "sonarr-config", // Defined in "media" downloadsClaimName: "sabnzbd-downloads", downloadsSubdirectory: null, // Defined in "media" tvSeriesClaimName: "series-lake", }), ingress: nginxIngress.Ingress(nginxIngress.IngressParams { namespace: namespace, name: "sonarr", hosts: [ "sonarr.cheapassbox.com", ], serviceName: "sonarr-ui", annotations: nginxIngress.KubeOauthProxyAnnotations, }), ingress2: nginxIngress.Ingress(nginxIngress.IngressParams { namespace: namespace, name: "sonarr-csbx", hosts: [ "sonarr.csbx.dev", ], serviceName: "sonarr-ui", annotations: nginxIngress.KubeCsbxOauthProxyAnnotations, }), }, anime: { configPvc: base.RecoverableSimplePvc(namespace, "sonarr-anime-config", "nfs-client", "200Mi", { volumeName: "pvc-ee075c1a-9fd0-4911-a0b0-926369d219e7", nfsPath: "/volume3/fs/media-sonarr-anime-config-pvc-ee075c1a-9fd0-4911-a0b0-926369d219e7", nfsServer: "apollo1.dominion.lan", }), db17Pvc: base.RecoverableSimpleManyPvc(namespace, "sonarr-anime-pg-17", "nfs-client", "50Gi", { volumeName: "pvc-5b7278af-e371-48da-a951-f28786b90b03", nfsPath: "/volume3/fs/media-sonarr-anime-pg-17-pvc-5b7278af-e371-48da-a951-f28786b90b03", nfsServer: "apollo1.dominion.lan", }), db17App: postgres.App(postgres.Params { namespace: namespace, name: "sonarr-anime-pg-17", filePath: std.thisFile, // TODO: image: "docker.io/bitnami/postgresql:17.2.0", // Defined in "//kube/cfg/secrets/media.jsonnet" dataClaimName: "sonarr-anime-pg-17", dbName: "sonarr-not-used", dbUser: "postgres", // Defined in local secrets dbPwdSecret: "sonarr", dbPwdSecretKey: "sonarr_db_pwd", }), app: sonarr.App(sonarr.Params { namespace: namespace, name: "sonarr-anime", filePath: std.thisFile, // Defined in "media" configClaimName: "sonarr-anime-config", // Defined in "media" downloadsClaimName: "sabnzbd-downloads", downloadsSubdirectory: null, // Defined in "media" tvSeriesClaimName: "anime-series", }), ingress: nginxIngress.Ingress(nginxIngress.IngressParams { namespace: namespace, name: "sonarr-anime", hosts: [ "sonarr-anime.cheapassbox.com", ], serviceName: "sonarr-anime-ui", annotations: nginxIngress.KubeOauthProxyAnnotations, }), ingress2: nginxIngress.Ingress(nginxIngress.IngressParams { namespace: namespace, name: "sonarr-anime-csbx", hosts: [ "sonarr-anime.csbx.dev", ], serviceName: "sonarr-anime-ui", annotations: nginxIngress.KubeCsbxOauthProxyAnnotations, }), }, }, transmission: { torrentFilesPvc: base.RecoverableSimpleManyPvc(namespace, "torrent-files", "nfs-client", "50Mi", { volumeName: "pvc-6ccda018-9e3a-11e9-bad8-b8aeed7dc356", nfsPath: "/volume3/fs/media-torrent-files-pvc-6ccda018-9e3a-11e9-bad8-b8aeed7dc356", nfsServer: "apollo1.dominion.lan", }), incompleteDownloadsPvc: base.RecoverableSimpleManyPvc(namespace, "transmission-incomplete-downloads", "nfs-bulk", "100Gi", { volumeName: "pvc-449918e4-46a2-4a47-a096-6e45ab4e62b1", nfsPath: "/volume4/fs-bulk/media-transmission-incomplete-downloads-pvc-449918e4-46a2-4a47-a096-6e45ab4e62b1", nfsServer: "apollo2.dominion.lan", }), configPvc: base.RecoverableSimpleManyPvc(namespace, "transmission-config", "nfs-client", "50Mi", { volumeName: "pvc-6c2b9097-9f8c-11e9-bad8-b8aeed7dc356", nfsPath: "/volume3/fs/media-transmission-config-pvc-6c2b9097-9f8c-11e9-bad8-b8aeed7dc356", nfsServer: "apollo1.dominion.lan", }), app: transmission.App(transmission.Params { namespace: namespace, name: "transmission", filePath: std.thisFile, // Defined in "media" configClaimName: "transmission-config", // Defined in "media" incompleteDownloadsClaimName: "transmission-incomplete-downloads", downloadsClaimName: "downloads-lake", //Defined in "media" torrentFilesClaimName: "torrent-files", // TODO(acmcarther): Import from central location dataNodePort: 32700, }), ingress: nginxIngress.Ingress(nginxIngress.IngressParams { namespace: namespace, name: "transmission", hosts: [ "transmission.cheapassbox.com", ], serviceName: "transmission-ui", annotations: nginxIngress.KubeOauthProxyAnnotations, }), ingress2: nginxIngress.Ingress(nginxIngress.IngressParams { namespace: namespace, name: "transmission-csbx", hosts: [ "transmission.csbx.dev", ], serviceName: "transmission-ui", annotations: nginxIngress.KubeCsbxOauthProxyAnnotations, }), }, }, }