Add middleware support to service levant template

This commit is contained in:
IamTheFij 2022-11-03 15:10:51 -07:00
parent 5bbb6c494c
commit 779db10abc

View File

@ -7,6 +7,7 @@
# args = json(list[str])
# resources = dict(cpu = int, mem = int)
# env = json(dict(str: any))
# ingress_middlewares = json(list(str))
# templates = json(list(dict(
# data = str,
# dest = str,
@ -125,6 +126,9 @@ job "[[.name]]" {
[[ if not (empty .ingress_rule) -]]
"traefik.http.routers.[[.name]].rule=[[.ingress_rule]]",
[[ end -]]
[[ with .ingress_middlewares -]][[ range $m := . | parseJSON -]]
"traefik.http.routers.[[$.name]].middlewares=[[ $m ]]",
[[ end -]][[ end -]]
[[ end -]]
]
}