added webserverconfig
This commit is contained in:
parent
df30afe181
commit
c2e75c24e9
4 changed files with 65 additions and 10 deletions
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
.clj-kondo/
|
||||
.lsp/
|
||||
target/
|
|
@ -12,12 +12,11 @@
|
|||
#?(:cljs
|
||||
(defmethod yaml/load-resource :matomo [resource-name]
|
||||
(case resource-name
|
||||
;"matomo/certificate.yaml" (rc/inline "matomo/certificate.yaml")
|
||||
;"matomo/deployment.yaml" (rc/inline "matomo/deployment.yaml")
|
||||
;"matomo/ingress.yaml" (rc/inline "matomo/ingress.yaml")
|
||||
;"matomo/persistent-volume.yaml" (rc/inline "matomo/persistent-volume.yaml")
|
||||
;"matomo/pvc.yaml" (rc/inline "matomo/pvc.yaml")
|
||||
;"matomo/service.yaml" (rc/inline "matomo/service.yaml")
|
||||
"matomo/certificate.yaml" (rc/inline "matomo/certificate.yaml")
|
||||
"matomo/deployments.yaml" (rc/inline "matomo/deployments.yaml")
|
||||
"matomo/ingress.yaml" (rc/inline "matomo/ingress.yaml")
|
||||
"matomo/services.yaml" (rc/inline "matomo/services.yaml")
|
||||
"matomo/statefulset.yaml" (rc/inline "matomo/statefulset.yaml")
|
||||
(throw (js/Error. "Undefined Resource!")))))
|
||||
|
||||
(defn generate-certificate [config]
|
||||
|
@ -29,10 +28,11 @@
|
|||
(assoc-in [:spec :dnsNames] [fqdn])
|
||||
(assoc-in [:spec :issuerRef :name] letsencrypt-issuer))))
|
||||
|
||||
(defn generate-deployment [config]
|
||||
(let [{:keys [fqdn]} config]
|
||||
(-> (yaml/from-string (yaml/load-resource "matomo/deployment.yaml"))
|
||||
(cm/replace-named-value "FQDN" fqdn))))
|
||||
(defn generate-webserver-deployment []
|
||||
(let [shynet-application "shynet-webserver"]
|
||||
(-> (yaml/from-string (yaml/load-resource "matomo/deployments-template.yaml"))
|
||||
(cm/replace-named-value "shynet-application" shynet-application)
|
||||
(dissoc [:spec :template :spec :containers 0] :command))))
|
||||
|
||||
(defn generate-ingress [config]
|
||||
(let [{:keys [fqdn issuer]
|
||||
|
|
52
src/main/resources/matomo/deployments-template.yaml
Normal file
52
src/main/resources/matomo/deployments-template.yaml
Normal 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
|
Loading…
Reference in a new issue