From ab0e8f3ff3973834c39a63f242101d071d555c0a Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 21 May 2021 16:40:51 +0200 Subject: [PATCH] mob --- src/main/cljc/dda/k8s_keycloak/core.cljc | 5 ++++- src/main/resources/deployment.yaml | 15 --------------- src/main/resources/service.yaml | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 16 deletions(-) create mode 100644 src/main/resources/service.yaml diff --git a/src/main/cljc/dda/k8s_keycloak/core.cljc b/src/main/cljc/dda/k8s_keycloak/core.cljc index 63727f2..b3d6dce 100644 --- a/src/main/cljc/dda/k8s_keycloak/core.cljc +++ b/src/main/cljc/dda/k8s_keycloak/core.cljc @@ -25,7 +25,10 @@ :or {issuer :staging}} config letsencrypt-issuer (str "letsencrypt-" (name issuer) "-issuer")] (-> - (yaml/from-string (yaml/load-resource "certificate.yaml"))))) + (yaml/from-string (yaml/load-resource "certificate.yaml")) + (assoc-in [:spec :commonName] fqdn) + (assoc-in [:spec :dnsNames] [fqdn]) + (assoc-in [:spec :issuerRef :name] letsencrypt-issuer)))) (defn generate-ingress [config] (let [{:keys [fqdn issuer] diff --git a/src/main/resources/deployment.yaml b/src/main/resources/deployment.yaml index c803074..0517011 100644 --- a/src/main/resources/deployment.yaml +++ b/src/main/resources/deployment.yaml @@ -1,18 +1,3 @@ -apiVersion: v1 -kind: Service -metadata: - name: keycloak - labels: - app: keycloak -spec: - ports: - - name: http - port: 8080 - targetPort: 8080 - selector: - app: keycloak - type: LoadBalancer ---- apiVersion: apps/v1 kind: Deployment metadata: diff --git a/src/main/resources/service.yaml b/src/main/resources/service.yaml new file mode 100644 index 0000000..fe2b5d1 --- /dev/null +++ b/src/main/resources/service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: keycloak + labels: + app: keycloak +spec: + ports: + - name: http + port: 8080 + targetPort: 8080 + selector: + app: keycloak + type: LoadBalancer \ No newline at end of file