move cyberchef to nix module

advertise .30 addresses instead of .40
This commit is contained in:
Pim Kunis 2024-03-27 20:43:59 +01:00
parent 89a9561fc2
commit fcb6e2ca37
3 changed files with 54 additions and 50 deletions

View file

@ -5,7 +5,7 @@ http:
servers: servers:
# TODO: This WILL break when the cluster is reprovisioned and another IP addrss is chosen. # TODO: This WILL break when the cluster is reprovisioned and another IP addrss is chosen.
# The load balancer service for Traefik is automatically provisioned by k3s, unsure how to statically assign the IP address. # The load balancer service for Traefik is automatically provisioned by k3s, unsure how to statically assign the IP address.
- url: http://192.168.40.101 - url: http://192.168.30.128
esrom: esrom:
loadBalancer: loadBalancer:
servers: servers:

View file

@ -0,0 +1,51 @@
{
kubernetes.resources = {
deployments.cyberchef.spec = {
replicas = 3;
selector.matchLabels.app = "cyberchef";
template = {
metadata.labels.app = "cyberchef";
spec = {
containers.cyberchef = {
image = "mpepping/cyberchef";
ports = [{
containerPort = 8000;
protocol = "TCP";
}];
};
};
};
};
services.cyberchef.spec = {
selector.app = "cyberchef";
ports = [{
protocol = "TCP";
port = 80;
targetPort = 8000;
}];
};
ingresses.cyberchef.spec = {
ingressClassName = "traefik";
rules = [{
host = "cyberchef.kun.is";
http.paths = [{
path = "/";
pathType = "Prefix";
backend.service = {
name = "cyberchef";
port.number = 80;
};
}];
}];
};
};
}

View file

@ -8,6 +8,7 @@
kubenix.modules.k8s kubenix.modules.k8s
kubenix.modules.helm kubenix.modules.helm
# ./freshrss.nix # ./freshrss.nix
./cyberchef.nix
]; ];
kubernetes.kubeconfig = "~/.kube/config"; kubernetes.kubeconfig = "~/.kube/config";
kubenix.project = "home"; kubenix.project = "home";
@ -46,57 +47,9 @@
# }; # };
# }; # };
deployments.cyberchef.spec = {
replicas = 3;
selector.matchLabels.app = "cyberchef";
template = {
metadata.labels.app = "cyberchef";
spec = {
containers.cyberchef = {
image = "mpepping/cyberchef";
ports = [{
containerPort = 8000;
protocol = "TCP";
}];
};
};
};
};
services.cyberchef.spec = {
selector.app = "cyberchef";
ports = [{
protocol = "TCP";
port = 80;
targetPort = 8000;
}];
};
ingresses.cyberchef.spec = {
ingressClassName = "traefik";
rules = [{
host = "cyberchef.kun.is";
http.paths = [{
path = "/";
pathType = "Prefix";
backend.service = {
name = "cyberchef";
port.number = 80;
};
}];
}];
};
ipAddressPools.main = { ipAddressPools.main = {
# metadata.namespace = "metallb-system"; # metadata.namespace = "metallb-system";
spec.addresses = [ "192.168.40.100-192.168.40.254" ]; spec.addresses = [ "192.168.30.128-192.168.30.200" ];
}; };
# l2Advertisements.main.metadata.namespace = "metallb-system"; # l2Advertisements.main.metadata.namespace = "metallb-system";