63 lines
1.5 KiB
Nix
63 lines
1.5 KiB
Nix
|
{ self, flake-utils, kubenix, ... }: flake-utils.lib.eachDefaultSystem
|
||
|
(system: {
|
||
|
kubenix = kubenix.packages.${system}.default.override {
|
||
|
specialArgs.flake = self;
|
||
|
|
||
|
module = { kubenix, ... }: {
|
||
|
imports = [ kubenix.modules.k8s ];
|
||
|
kubernetes.kubeconfig = "~/.kube/config";
|
||
|
kubenix.project = "home";
|
||
|
|
||
|
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;
|
||
|
};
|
||
|
}];
|
||
|
}];
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
})
|