review
This commit is contained in:
parent
bd40461bb3
commit
0fc7bc5f2e
6 changed files with 12 additions and 7 deletions
|
@ -18,6 +18,7 @@
|
||||||
(s/def ::service-port pos-int?)
|
(s/def ::service-port pos-int?)
|
||||||
(s/def ::fqdns (s/coll-of pred/fqdn-string?))
|
(s/def ::fqdns (s/coll-of pred/fqdn-string?))
|
||||||
|
|
||||||
|
; TODO: Review jem 2022/10/26: Namespace is called ingress but we do more: Ingress & cert -> rename ore mv. certificate to own ns
|
||||||
(def ingress? (s/keys :req-un [::fqdns ::ingress-name ::service-name ::service-port]
|
(def ingress? (s/keys :req-un [::fqdns ::ingress-name ::service-name ::service-port]
|
||||||
:opt-un [::issuer ::cert-name]))
|
:opt-un [::issuer ::cert-name]))
|
||||||
|
|
||||||
|
@ -33,6 +34,7 @@
|
||||||
"ingress/https-ingress.yaml" (rc/inline "ingress/https-ingress.yaml")
|
"ingress/https-ingress.yaml" (rc/inline "ingress/https-ingress.yaml")
|
||||||
(throw (js/Error. "Undefined Resource!")))))
|
(throw (js/Error. "Undefined Resource!")))))
|
||||||
|
|
||||||
|
; TODO: Review jem 2022/10/26: generalize!
|
||||||
#?(:cljs
|
#?(:cljs
|
||||||
(defmethod yaml/load-as-edn :ingress [resource-name]
|
(defmethod yaml/load-as-edn :ingress [resource-name]
|
||||||
(yaml/from-string (yaml/load-resource resource-name))))
|
(yaml/from-string (yaml/load-resource resource-name))))
|
||||||
|
|
|
@ -40,8 +40,10 @@
|
||||||
(def config? (s/keys :req-un [::websites]
|
(def config? (s/keys :req-un [::websites]
|
||||||
:opt-un [::issuer]))
|
:opt-un [::issuer]))
|
||||||
|
|
||||||
|
; TODO: Review jem 2022/10/26: move default to core/default
|
||||||
(def volume-size 3)
|
(def volume-size 3)
|
||||||
|
|
||||||
|
; TODO: Review jem 2022/10/26: spec the following funktions?
|
||||||
(defn replace-dots-by-minus
|
(defn replace-dots-by-minus
|
||||||
[fqdn]
|
[fqdn]
|
||||||
(str/replace fqdn #"\." "-"))
|
(str/replace fqdn #"\." "-"))
|
||||||
|
@ -79,16 +81,17 @@
|
||||||
|
|
||||||
#?(:cljs
|
#?(:cljs
|
||||||
(defmethod yaml/load-resource :website [resource-name]
|
(defmethod yaml/load-resource :website [resource-name]
|
||||||
(case resource-name
|
(case resource-name
|
||||||
"website/nginx-configmap.yaml" (rc/inline "website/nginx-configmap.yaml")
|
"website/nginx-configmap.yaml" (rc/inline "website/nginx-configmap.yaml")
|
||||||
"website/nginx-deployment.yaml" (rc/inline "website/nginx-deployment.yaml")
|
"website/nginx-deployment.yaml" (rc/inline "website/nginx-deployment.yaml")
|
||||||
"website/nginx-service.yaml" (rc/inline "website/nginx-service.yaml")
|
"website/nginx-service.yaml" (rc/inline "website/nginx-service.yaml")
|
||||||
"website/website-content-volume.yaml" (rc/inline "website/website-content-volume.yaml")
|
|
||||||
"website/website-build-cron.yaml" (rc/inline "website/website-build-cron.yaml")
|
"website/website-build-cron.yaml" (rc/inline "website/website-build-cron.yaml")
|
||||||
"website/website-build-deployment.yaml" (rc/inline "website/website-build-deployment.yaml")
|
"website/website-build-deployment.yaml" (rc/inline "website/website-build-deployment.yaml")
|
||||||
"website/website-build-secret.yaml" (rc/inline "website/website-build-secret.yaml")
|
"website/website-build-secret.yaml" (rc/inline "website/website-build-secret.yaml")
|
||||||
|
"website/website-content-volume.yaml" (rc/inline "website/website-content-volume.yaml")
|
||||||
(throw (js/Error. "Undefined Resource!")))))
|
(throw (js/Error. "Undefined Resource!")))))
|
||||||
|
|
||||||
|
; TODO: Review jem 2022/10/26: move this fkt. to a more general place
|
||||||
#?(:cljs
|
#?(:cljs
|
||||||
(defmethod yaml/load-as-edn :website [resource-name]
|
(defmethod yaml/load-as-edn :website [resource-name]
|
||||||
(yaml/from-string (yaml/load-resource resource-name))))
|
(yaml/from-string (yaml/load-resource resource-name))))
|
||||||
|
|
|
@ -13,7 +13,7 @@ spec:
|
||||||
paths:
|
paths:
|
||||||
- pathType: Prefix
|
- pathType: Prefix
|
||||||
path: "/"
|
path: "/"
|
||||||
backend:
|
backend: # TODO: Review jem 2022/10/26: wo backend as we should only do a redirect here ... ?
|
||||||
service:
|
service:
|
||||||
name: SERVIC_ENAME
|
name: SERVIC_ENAME
|
||||||
port:
|
port:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: NAME-deployment
|
name: NAME-deployment #TODO: Review jem 2022/10/26: why mixed case? either calculate the whole name in cljc or use UPPERCASE
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
|
|
|
@ -11,6 +11,6 @@ spec:
|
||||||
ports:
|
ports:
|
||||||
- name: nginx-http
|
- name: nginx-http
|
||||||
port: 80
|
port: 80
|
||||||
- name: nginx-https
|
- name: nginx-https # TODO: Review jem 2022/10/26: we terminate ssl in ingress, do not pass thru
|
||||||
port: 443
|
port: 443
|
||||||
|
|
|
@ -3,9 +3,9 @@ kind: CronJob
|
||||||
metadata:
|
metadata:
|
||||||
name: NAME-build-cron
|
name: NAME-build-cron
|
||||||
labels:
|
labels:
|
||||||
app.kubernetes.part-of: website # correct name?
|
app.kubernetes.part-of: website # TODO: Review jem 2022/10/26: adjust name, add part of to all
|
||||||
spec:
|
spec:
|
||||||
schedule: "1,7,14,21,28,35,42,49,54,59 * * * *"
|
schedule: "1,7,14,21,28,35,42,49,54,59 * * * *" # TODO: Review jem 2022/10/26: */7 ?
|
||||||
successfulJobsHistoryLimit: 1
|
successfulJobsHistoryLimit: 1
|
||||||
failedJobsHistoryLimit: 1
|
failedJobsHistoryLimit: 1
|
||||||
jobTemplate:
|
jobTemplate:
|
||||||
|
|
Loading…
Reference in a new issue