use more sane k8s manifest management

This commit is contained in:
2026-04-08 10:40:16 -04:00
parent 33f0e30229
commit 8c5641e8eb
9 changed files with 141 additions and 180 deletions

View File

@@ -1,76 +1,8 @@
{
services.k3s.manifests = {
test-color-ns.content = {
apiVersion = "v1";
kind = "Namespace";
metadata = {
name = "test-color";
};
};
test-color-deploy.content = {
apiVersion = "apps/v1";
kind = "Deployment";
metadata = {
name = "test-color";
namespace = "test-color";
};
spec = {
selector = {
matchLabels = {
app = "test-color";
};
};
template = {
metadata = {
labels = {
app = "test-color";
};
};
spec = {
containers = [
{
name = "test-color";
image = "kodekloud/webapp-color:latest";
}
];
};
};
};
};
test-color-svc.content = {
apiVersion = "v1";
kind = "Service";
metadata = {
name = "test-color";
namespace = "test-color";
};
spec = {
selector.app = "test-color";
ports = [{port = 8080; targetPort = 8080;}];
};
};
test-color-ingress.content = {
apiVersion = "networking.k8s.io/v1";
kind = "Ingress";
metadata = {
name = "test-color-ingress";
namespace = "test-color";
};
spec = {
rules = [
{
host = "test-color.weyma-bs.infra.dubyatp.xyz";
http.paths = [{
pathType = "Prefix";
path = "/";
backend.service = {
name = "test-color";
port.number = 8080;
};
}];
}
];
};
};
};
}
services.k3s.manifests = {
"test-color-ns.yaml".source = ./test-color/ns.yaml;
"test-color-deploy.yaml".source = ./test-color/deploy.yaml;
"test-color-svc.yaml".source = ./test-color/svc.yaml;
"test-color-ingress.yaml".source = ./test-color/ingress.yaml;
};
}