Add config-file and gateway-class

This commit is contained in:
2025-11-26 19:00:53 -06:00
parent 2e286fa8db
commit fcdc377d02

View File

@@ -35,19 +35,25 @@
{:apiVersion "gateway.networking.k8s.io/v1" {:apiVersion "gateway.networking.k8s.io/v1"
:kind "Gateway" :kind "Gateway"
:metadata {:name "main-gateway" :metadata {:name "main-gateway"
:namespace "traefik"} :namespace app-name}
:spec {:gatewayClassName "traefik" :spec {:gatewayClassName app-name
:listeners :listeners
[{:name "http" [#_{:name "http"
:protocol "HTTP" :protocol "HTTP"
:port 80} :port 8000}
{:name "https" #_{:name "https"
:protocol "HTTPS" :protocol "HTTPS"
:port 443 :port 8443
:tls {:certificateRefs :tls {:certificateRefs
[{:name (str app-name "-cert") [{:name (str app-name "-cert")
:kind "Secret"}]}}]}}) :kind "Secret"}]}}]}})
(defn gateway-class [{:keys [app-name]}]
{:apiVersion "gateway.networking.k8s.io/v1"
:kind "GatewayClass"
:metadata {:name app-name}
:spec {:controllerName "io.traefik/gateway"}})
(defn httproute [{:keys [app-name app-namespace host]}] (defn httproute [{:keys [app-name app-namespace host]}]
{:apiVersion "gateway.networking.k8s.io/v1" {:apiVersion "gateway.networking.k8s.io/v1"
@@ -110,14 +116,21 @@
(defn storage-class [{:keys [app-name]}] (defn storage-class [{:keys [app-name]}]
{:metadata {:name app-name}}) {:metadata {:name app-name}})
(defn config-file
[{:keys [app-name file]}]
{:name app-name
:properties {:file file}})
(def defaults (def defaults
{:ingress ingress {:ingress ingress
:gateway gateway :gateway gateway
:gateway-class gateway-class
:httproute httproute :httproute httproute
:certificate certificate :certificate certificate
:cluster-issuer cluster-issuer :cluster-issuer cluster-issuer
:chart chart :chart chart
:config-map config-map :config-map config-map
:config-file config-file
:service service :service service
:deployment deployment :deployment deployment
:namespace nspace :namespace nspace