68 lines
No EOL
1.5 KiB
Nix
68 lines
No EOL
1.5 KiB
Nix
{ ... }:
|
|
{
|
|
ubuntu-test.content = [
|
|
{
|
|
apiVersion = "apps/v1";
|
|
kind = "Deployment";
|
|
metadata = {
|
|
name = "ubuntu-test";
|
|
labels.app = "ubuntu-test";
|
|
};
|
|
spec = {
|
|
selector.matchLabels.app = "ubuntu-test";
|
|
template = {
|
|
metadata = {
|
|
labels.app = "ubuntu-test";
|
|
};
|
|
spec = {
|
|
containers = [
|
|
{
|
|
name = "ubuntu-test";
|
|
image = "ubuntu:26.04";
|
|
command = [ "tail" "-f" "/dev/null" ];
|
|
ports = [
|
|
{
|
|
name = "test-port";
|
|
containerPort = 80;
|
|
}
|
|
];
|
|
volumeMounts = [
|
|
{
|
|
mountPath = "/test";
|
|
name = "test";
|
|
subPath = "ubuntu-test";
|
|
}
|
|
];
|
|
}
|
|
];
|
|
volumes = [
|
|
{
|
|
name = "test";
|
|
persistentVolumeClaim = {
|
|
claimName = "nfs-main-pvc";
|
|
};
|
|
}
|
|
];
|
|
};
|
|
};
|
|
};
|
|
}
|
|
{
|
|
apiVersion = "v1";
|
|
kind = "Service";
|
|
metadata.name = "test-service";
|
|
spec = {
|
|
type = "NodePort";
|
|
selector.app = "ubuntu-test";
|
|
ports = [
|
|
{
|
|
name = "test-port";
|
|
protocol = "TCP";
|
|
port = 80;
|
|
nodePort = 32767;
|
|
}
|
|
];
|
|
};
|
|
}
|
|
];
|
|
} |