use pure nix for manifests, yaml is too buggy
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
imports = [
|
imports = [
|
||||||
./charts
|
./charts
|
||||||
|
./manifests
|
||||||
];
|
];
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [6443];
|
networking.firewall.allowedTCPPorts = [6443];
|
||||||
@@ -8,8 +9,5 @@
|
|||||||
services.k3s = {
|
services.k3s = {
|
||||||
enable = true;
|
enable = true;
|
||||||
role = "server";
|
role = "server";
|
||||||
manifests = {
|
|
||||||
test-color.source = ./manifests/test;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
5
kubernetes/manifests/default.nix
Normal file
5
kubernetes/manifests/default.nix
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
imports = [
|
||||||
|
./test.nix
|
||||||
|
];
|
||||||
|
}
|
||||||
76
kubernetes/manifests/test.nix
Normal file
76
kubernetes/manifests/test.nix
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
{
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
}];
|
||||||
|
}
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
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
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
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
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Namespace
|
|
||||||
metadata:
|
|
||||||
name: test-color
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: test-color
|
|
||||||
namespace: test-color
|
|
||||||
spec:
|
|
||||||
selector:
|
|
||||||
app: test-color
|
|
||||||
ports:
|
|
||||||
- port: 8080
|
|
||||||
targetPort: 8080
|
|
||||||
Reference in New Issue
Block a user