Format repo
This commit is contained in:
parent
3169149045
commit
8160b9da0b
37 changed files with 643 additions and 392 deletions
|
@ -1,6 +1,9 @@
|
|||
{ lib, config, ... }:
|
||||
let
|
||||
ingressOpts = { name, ... }: {
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
ingressOpts = {name, ...}: {
|
||||
options = {
|
||||
host = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
|
@ -22,17 +25,17 @@ let
|
|||
};
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
in {
|
||||
options = {
|
||||
lab.ingresses = lib.mkOption {
|
||||
type = with lib.types; attrsOf (submodule ingressOpts);
|
||||
default = { };
|
||||
default = {};
|
||||
};
|
||||
};
|
||||
|
||||
config = {
|
||||
kubernetes.resources.ingresses = builtins.mapAttrs
|
||||
kubernetes.resources.ingresses =
|
||||
builtins.mapAttrs
|
||||
(name: ingress: {
|
||||
metadata.annotations = {
|
||||
"cert-manager.io/cluster-issuer" = "letsencrypt";
|
||||
|
@ -42,24 +45,30 @@ in
|
|||
spec = {
|
||||
ingressClassName = "traefik";
|
||||
|
||||
rules = [{
|
||||
host = ingress.host;
|
||||
rules = [
|
||||
{
|
||||
host = ingress.host;
|
||||
|
||||
http.paths = [{
|
||||
path = "/";
|
||||
pathType = "Prefix";
|
||||
http.paths = [
|
||||
{
|
||||
path = "/";
|
||||
pathType = "Prefix";
|
||||
|
||||
backend.service = {
|
||||
name = ingress.service.name;
|
||||
port.name = ingress.service.portName;
|
||||
};
|
||||
}];
|
||||
}];
|
||||
backend.service = {
|
||||
name = ingress.service.name;
|
||||
port.name = ingress.service.portName;
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
||||
];
|
||||
|
||||
tls = [{
|
||||
secretName = "${name}-tls";
|
||||
hosts = [ ingress.host ];
|
||||
}];
|
||||
tls = [
|
||||
{
|
||||
secretName = "${name}-tls";
|
||||
hosts = [ingress.host];
|
||||
}
|
||||
];
|
||||
};
|
||||
})
|
||||
config.lab.ingresses;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue