added webserverconfig

This commit is contained in:
see 2022-01-21 13:54:54 +01:00
parent df30afe181
commit c2e75c24e9
4 changed files with 65 additions and 10 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
.clj-kondo/
.lsp/
target/

View file

@ -12,12 +12,11 @@
#?(:cljs #?(:cljs
(defmethod yaml/load-resource :matomo [resource-name] (defmethod yaml/load-resource :matomo [resource-name]
(case resource-name (case resource-name
;"matomo/certificate.yaml" (rc/inline "matomo/certificate.yaml") "matomo/certificate.yaml" (rc/inline "matomo/certificate.yaml")
;"matomo/deployment.yaml" (rc/inline "matomo/deployment.yaml") "matomo/deployments.yaml" (rc/inline "matomo/deployments.yaml")
;"matomo/ingress.yaml" (rc/inline "matomo/ingress.yaml") "matomo/ingress.yaml" (rc/inline "matomo/ingress.yaml")
;"matomo/persistent-volume.yaml" (rc/inline "matomo/persistent-volume.yaml") "matomo/services.yaml" (rc/inline "matomo/services.yaml")
;"matomo/pvc.yaml" (rc/inline "matomo/pvc.yaml") "matomo/statefulset.yaml" (rc/inline "matomo/statefulset.yaml")
;"matomo/service.yaml" (rc/inline "matomo/service.yaml")
(throw (js/Error. "Undefined Resource!"))))) (throw (js/Error. "Undefined Resource!")))))
(defn generate-certificate [config] (defn generate-certificate [config]
@ -29,10 +28,11 @@
(assoc-in [:spec :dnsNames] [fqdn]) (assoc-in [:spec :dnsNames] [fqdn])
(assoc-in [:spec :issuerRef :name] letsencrypt-issuer)))) (assoc-in [:spec :issuerRef :name] letsencrypt-issuer))))
(defn generate-deployment [config] (defn generate-webserver-deployment []
(let [{:keys [fqdn]} config] (let [shynet-application "shynet-webserver"]
(-> (yaml/from-string (yaml/load-resource "matomo/deployment.yaml")) (-> (yaml/from-string (yaml/load-resource "matomo/deployments-template.yaml"))
(cm/replace-named-value "FQDN" fqdn)))) (cm/replace-named-value "shynet-application" shynet-application)
(dissoc [:spec :template :spec :containers 0] :command))))
(defn generate-ingress [config] (defn generate-ingress [config]
(let [{:keys [fqdn issuer] (let [{:keys [fqdn issuer]

View file

@ -0,0 +1,52 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: shynet-webserver
namespace: default
labels:
app: shynet-webserver
spec:
selector:
matchLabels:
app: shynet-webserver
strategy:
type: Recreate
replicas: 1
template:
metadata:
labels:
app: shynet-webserver
spec:
containers:
- name: shynet-webserver
image: milesmcc/shynet:edge
imagePullPolicy: IfNotPresent
envFrom:
- secretRef:
name: shynet-settings
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: shynet-celeryworker
namespace: default
labels:
app: shynet-celeryworker
spec:
selector:
matchLabels:
app: shynet-celeryworker
replicas: 1
template:
metadata:
labels:
app: shynet-celeryworker
spec:
containers:
- name: shynet-celeryworker
image: milesmcc/shynet:edge
command: ["./celeryworker.sh"]
imagePullPolicy: IfNotPresent
envFrom:
- secretRef:
name: shynet-settings