Test with pod and container

This commit is contained in:
pazpi 2024-08-25 22:05:36 +02:00
parent 7df20acc14
commit 4a39b2cbfd
No known key found for this signature in database
GPG key ID: 0942571C4B9966BE
2 changed files with 58 additions and 5 deletions

View file

@ -16,10 +16,42 @@ in
proxmox.enable = true; proxmox.enable = true;
download-pod = { download-pod = {
enable = true; enable = false;
proxy.enable = true; proxy.enable = false;
}; };
services.podmanPods = {
mywebapp = {
name = "mywebapp";
ports = [ "9090:80" "9443:443" ];
containers = {
webserver = {
enable = true;
image = "nginx";
volumes = [ "aaa:/config" "bbb:/data" ];
};
appserver = {
image = "my-custom-app:latest";
};
};
};
database = {
name = "database";
ports = [
"3333:4444"
"5432:5432"
];
containers = {
postgres = {
image = "postgres:13";
};
};
};
};
# Extra packages # Extra packages
# environment.systemPackages = with pkgs; [ ]; # environment.systemPackages = with pkgs; [ ];

View file

@ -48,21 +48,33 @@ in
}; };
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
# - 9117: Jackett
# - 7878: Radarr # - 7878: Radarr
# - 8080: Sabnzbd # - 8080: Sabnzbd
# - 8989: Sonarr # - 8989: Sonarr
ExecStart = "-${pkgs.podman}/bin/podman pod create -p 9117:9117 -p 7878:7878 -p 8080:8080 -p 8989:8989 download"; # - 9117: Jackett
# - 9696: Prowlarr
ExecStart = "-${pkgs.podman}/bin/podman pod create -p 9117:9117 -p 7878:7878 -p 8080:8080 -p 8989:8989 -p 9696:9696 download";
}; };
path = [ pkgs.podman ]; path = [ pkgs.podman ];
}; };
virtualisation.oci-containers.containers = { virtualisation.oci-containers.containers = {
my-pod = {
image = "k8s.gcr.io/pause:3.9";
extraOptions = [
"--pod=new:my-pod"
"--publish=8081:80" # Expose port 80 in the pod as 8080 on the host
"--publish=8082:82" # Expose port 82 in the pod as 8082 on the host
"--publish=83:9117" # Expose port 9117 in the pod as 83 on the host
];
};
jackett = { jackett = {
image = "linuxserver/jackett"; image = "linuxserver/jackett";
autoStart = true; autoStart = true;
extraOptions = [ extraOptions = [
"--pod=download" "--pod=my-pod"
]; ];
volumes = [ "jackett_config:/config" "jackett_data:/data" ]; volumes = [ "jackett_config:/config" "jackett_data:/data" ];
}; };
@ -94,6 +106,15 @@ in
volumes = [ "sonarr_config:/config" "sonarr_data:/data" ]; volumes = [ "sonarr_config:/config" "sonarr_data:/data" ];
}; };
prowlarr = {
image = "linuxserver/prowlarr";
autoStart = true;
extraOptions = [
"--pod=download"
];
volumes = [ "prowlarr_config:/config" ];
};
}; };
services.caddy = lib.mkIf cfg.proxy.enable { services.caddy = lib.mkIf cfg.proxy.enable {