diff --git a/README.md b/README.md index 821a40a..2ecf825 100644 --- a/README.md +++ b/README.md @@ -39,12 +39,12 @@ nginx-config -> wie serviceType: LoadBalancer PVC + volume-mount zeigt auf website-data-vol +**Terraform:** +FQDNs für verschiedene Websites hinzufügen? +Verbindung mit c4k? +c4k-Modulname als Teil des FQDNs wird später noch problematisch. -_Frage_ kann pyb apply nur einen FQDN? - -Falls ja, wie könnte das Ausschauen? -Will ich einen Cluster haben, auf dem mit Deployments neue Pods/Webserver installiert werden, die sich dann aus festgelegten pfaden ihren content holen? ### Reading: diff --git a/src/main/clj/dda/c4k_gitea/uberjar.clj b/src/main/clj/dda/c4k_website/uberjar.clj similarity index 100% rename from src/main/clj/dda/c4k_gitea/uberjar.clj rename to src/main/clj/dda/c4k_website/uberjar.clj diff --git a/src/main/cljc/dda/c4k_gitea/core.cljc b/src/main/cljc/dda/c4k_website/core.cljc similarity index 100% rename from src/main/cljc/dda/c4k_gitea/core.cljc rename to src/main/cljc/dda/c4k_website/core.cljc diff --git a/src/main/cljc/dda/c4k_gitea/gitea.cljc b/src/main/cljc/dda/c4k_website/gitea.cljc similarity index 100% rename from src/main/cljc/dda/c4k_gitea/gitea.cljc rename to src/main/cljc/dda/c4k_website/gitea.cljc diff --git a/src/main/cljs/dda/c4k_gitea/browser.cljs b/src/main/cljs/dda/c4k_website/browser.cljs similarity index 100% rename from src/main/cljs/dda/c4k_gitea/browser.cljs rename to src/main/cljs/dda/c4k_website/browser.cljs diff --git a/src/main/resources/gitea/nginx-deployment.yaml b/src/main/resources/gitea/nginx-deployment.yaml deleted file mode 100644 index 29db5ce..0000000 --- a/src/main/resources/gitea/nginx-deployment.yaml +++ /dev/null @@ -1,36 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: nginx - namespace: default - labels: - app: nginx -spec: - replicas: 1 - selector: - matchLabels: - app: nginx - template: - metadata: - name: nginx - labels: - app: nginx - spec: - containers: - - name: nginx - image: nginx:latest - imagePullPolicy: IfNotPresent - ports: - - containerPort: 80 - protocol: TCP - envFrom: - - configMapRef: - name: nginx-env - volumeMounts: - - name: website-data-volume - mountPath: "/data" - volumes: - - name: website-data-volume - persistentVolumeClaim: - claimName: website-data-pvc - diff --git a/src/main/resources/gitea/certificate.yaml b/src/main/resources/website/certificate.yaml similarity index 100% rename from src/main/resources/gitea/certificate.yaml rename to src/main/resources/website/certificate.yaml diff --git a/src/main/resources/gitea/datavolume.yaml b/src/main/resources/website/datavolume.yaml similarity index 89% rename from src/main/resources/gitea/datavolume.yaml rename to src/main/resources/website/datavolume.yaml index 7be576e..ba7749f 100644 --- a/src/main/resources/gitea/datavolume.yaml +++ b/src/main/resources/website/datavolume.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: website-data-pvc + name: website-content-pvc namespace: default labels: app: website diff --git a/src/main/resources/gitea/ingress.yaml b/src/main/resources/website/ingress.yaml similarity index 100% rename from src/main/resources/gitea/ingress.yaml rename to src/main/resources/website/ingress.yaml diff --git a/src/main/resources/gitea/nginx-configmap.yaml b/src/main/resources/website/nginx-configmap.yaml similarity index 79% rename from src/main/resources/gitea/nginx-configmap.yaml rename to src/main/resources/website/nginx-configmap.yaml index 49c58ab..8564491 100644 --- a/src/main/resources/gitea/nginx-configmap.yaml +++ b/src/main/resources/website/nginx-configmap.yaml @@ -1,6 +1,7 @@ # ToDo: # content-pfad für nginx server definieren # sinnvolle security policies konfigurieren +# link nginx.conv und virtualhost.conv verstehen apiVersion: v1 kind: ConfigMap @@ -40,17 +41,20 @@ data: include /etc/nginx/virtualhost/virtualhost.conf; } virtualhost.conf: | - upstream app { - server localhost:8080; + upstream NAME { + server FQDN; keepalive 1024; } + server { listen 80 default_server; - root /usr/local/app; - access_log /var/log/nginx/app.access_log main; - error_log /var/log/nginx/app.error_log; + root WEBSITECONTENTPATH; + + access_log /var/log/nginx/NAME.access_log main; #ToDo: change this + error_log /var/log/nginx/NAME.error_log; + location / { - proxy_pass http://app/; + proxy_pass http://NAME/; #ToDo: change this, how does proxy_pass work? proxy_http_version 1.1; } } diff --git a/src/main/resources/website/nginx-deployment.yaml b/src/main/resources/website/nginx-deployment.yaml new file mode 100644 index 0000000..7d5e3ba --- /dev/null +++ b/src/main/resources/website/nginx-deployment.yaml @@ -0,0 +1,39 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx +spec: + replicas: 1 + template: + metadata: + labels: + app: nginx + spec: + containers: + - name: nginx + image: nginx + ports: + - containerPort: 80 + volumeMounts: + - mountPath: /etc/nginx # mount nginx-conf volumn to /etc/nginx + readOnly: true + name: nginx-conf + - mountPath: /var/log/nginx + name: log + - mountPath: WEBSITECONTENTPATH + name: website-content-volume + volumes: + - name: nginx-conf + configMap: + name: nginx-conf # place ConfigMap `nginx-conf` on /etc/nginx + items: + - key: nginx.conf + path: nginx.conf + - key: virtualhost.conf + path: virtualhost/virtualhost.conf # dig directory + - name: log + emptyDir: {} + - name: website-content-volume + persistentVolumeClaim: + claimName: website-content-pvc + diff --git a/src/main/resources/gitea/website-server-service.yaml b/src/main/resources/website/website-server-service.yaml similarity index 100% rename from src/main/resources/gitea/website-server-service.yaml rename to src/main/resources/website/website-server-service.yaml diff --git a/src/test/cljc/dda/c4k_gitea/website_test.cljc b/src/test/cljc/dda/c4k_website/website_test.cljc similarity index 100% rename from src/test/cljc/dda/c4k_gitea/website_test.cljc rename to src/test/cljc/dda/c4k_website/website_test.cljc