fix new k3s issuer convention

This commit is contained in:
jerger 2022-05-21 13:11:33 +02:00
parent 261303b08e
commit 50bcf23ee6
3 changed files with 5 additions and 5 deletions

View file

@ -30,7 +30,7 @@
(defn generate-certificate [config] (defn generate-certificate [config]
(let [{:keys [fqdn issuer]} config (let [{:keys [fqdn issuer]} config
letsencrypt-issuer (str "letsencrypt-" (name issuer) "-issuer")] letsencrypt-issuer (name issuer)]
(-> (->
(yaml/from-string (yaml/load-resource "jira/certificate.yaml")) (yaml/from-string (yaml/load-resource "jira/certificate.yaml"))
(assoc-in [:spec :commonName] fqdn) (assoc-in [:spec :commonName] fqdn)
@ -45,7 +45,7 @@
(defn generate-ingress [config] (defn generate-ingress [config]
(let [{:keys [fqdn issuer] (let [{:keys [fqdn issuer]
:or {issuer :staging}} config :or {issuer :staging}} config
letsencrypt-issuer (str "letsencrypt-" (name issuer) "-issuer")] letsencrypt-issuer (name issuer)]
(-> (->
(yaml/from-string (yaml/load-resource "jira/ingress.yaml")) (yaml/from-string (yaml/load-resource "jira/ingress.yaml"))
(assoc-in [:metadata :annotations :cert-manager.io/cluster-issuer] letsencrypt-issuer) (assoc-in [:metadata :annotations :cert-manager.io/cluster-issuer] letsencrypt-issuer)

View file

@ -9,5 +9,5 @@ spec:
dnsNames: dnsNames:
- fqdn - fqdn
issuerRef: issuerRef:
name: letsencrypt-staging-issuer name: staging
kind: ClusterIssuer kind: ClusterIssuer

View file

@ -13,7 +13,7 @@
:commonName "xx" :commonName "xx"
:dnsNames ["xx"] :dnsNames ["xx"]
:issuerRef :issuerRef
{:name "letsencrypt-prod-issuer", :kind "ClusterIssuer"}}} {:name "prod", :kind "ClusterIssuer"}}}
(cut/generate-certificate {:fqdn "xx" :issuer :prod})))) (cut/generate-certificate {:fqdn "xx" :issuer :prod}))))
(deftest should-generate-pvc (deftest should-generate-pvc
@ -33,7 +33,7 @@
{:name "ingress-jira" {:name "ingress-jira"
:annotations :annotations
{:cert-manager.io/cluster-issuer {:cert-manager.io/cluster-issuer
"letsencrypt-staging-issuer" "staging"
:nginx.ingress.kubernetes.io/proxy-body-size "256m" :nginx.ingress.kubernetes.io/proxy-body-size "256m"
:nginx.ingress.kubernetes.io/ssl-redirect "true" :nginx.ingress.kubernetes.io/ssl-redirect "true"
:nginx.ingress.kubernetes.io/rewrite-target "/" :nginx.ingress.kubernetes.io/rewrite-target "/"