added ingress and service for management-interface

This commit is contained in:
Clemens 2024-08-29 12:14:19 +02:00
parent 9206d9f8ad
commit 4ac839e015
3 changed files with 35 additions and 0 deletions

View file

@ -42,8 +42,10 @@
(postgres/generate-config config) (postgres/generate-config config)
[(kc/generate-configmap config) [(kc/generate-configmap config)
(kc/generate-service config) (kc/generate-service config)
(kc/generate-service-management-interface config)
(kc/generate-deployment config)] (kc/generate-deployment config)]
(kc/generate-ratelimit-ingress config) (kc/generate-ratelimit-ingress config)
(kc/generate-ratelimit-ingress-management-interface config)
(when (contains? config :mon-cfg) (when (contains? config :mon-cfg)
(mon/generate-config)))))) (mon/generate-config))))))

View file

@ -43,6 +43,18 @@
:namespace namespace} :namespace namespace}
config)))) config))))
(defn-spec generate-ratelimit-ingress-management-interface seq?
[config config?]
(let [{:keys [fqdn max-rate max-concurrent-requests namespace]} config]
(ing/generate-simple-ingress (merge
{:service-name "keycloak-management-interface"
:service-port 80
:fqdns [(str "control." fqdn)]
:average-rate max-rate
:burst-rate max-concurrent-requests
:namespace namespace}
config))))
(defn-spec generate-secret cp/map-or-seq? (defn-spec generate-secret cp/map-or-seq?
[config config? [config config?
auth auth?] auth auth?]
@ -72,6 +84,13 @@
(yaml/load-as-edn "keycloak/service.yaml") (yaml/load-as-edn "keycloak/service.yaml")
(cm/replace-all-matching "NAMESPACE" namespace)))) (cm/replace-all-matching "NAMESPACE" namespace))))
(defn-spec generate-service-management-interface cp/map-or-seq?
[config config?]
(let [{:keys [namespace]} config]
(->
(yaml/load-as-edn "keycloak/service-management-interface.yaml")
(cm/replace-all-matching "NAMESPACE" namespace))))
(defn-spec generate-deployment cp/map-or-seq? (defn-spec generate-deployment cp/map-or-seq?
[config config?] [config config?]
(let [{:keys [fqdn namespace]} config] (let [{:keys [fqdn namespace]} config]

View file

@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: keycloak-management-interface
labels:
service: keycloak-management-interface
namespace: NAMESPACE
spec:
ports:
- name: "http"
port: 80
targetPort: 9000
selector:
app: keycloak