From 0d5d10d64c9902a2ab22aa600afeb611dc022baf Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 28 Feb 2024 15:03:04 +0100 Subject: [PATCH] use port 8080 instead of 80 --- src/main/resources/website/build-secret.yaml | 6 +- src/main/resources/website/content-pvc.yaml | 1 - .../resources/website/hash-state-pvc.yaml | 1 - .../resources/website/nginx-configmap.yaml | 5 +- .../resources/website/nginx-deployment.yaml | 69 +++++++++---------- src/main/resources/website/nginx-service.yaml | 5 +- 6 files changed, 41 insertions(+), 46 deletions(-) diff --git a/src/main/resources/website/build-secret.yaml b/src/main/resources/website/build-secret.yaml index 6bf7946..4151d5c 100644 --- a/src/main/resources/website/build-secret.yaml +++ b/src/main/resources/website/build-secret.yaml @@ -6,6 +6,6 @@ metadata: labels: app.kubernetes.part-of: NAME-website data: - AUTHTOKEN: TOKEN - GITREPOURL: REPOURL - GITCOMMITURL: COMMITURL + AUTHTOKEN: TOKEN + GITREPOURL: REPOURL + GITCOMMITURL: COMMITURL diff --git a/src/main/resources/website/content-pvc.yaml b/src/main/resources/website/content-pvc.yaml index a524974..1c7cb02 100644 --- a/src/main/resources/website/content-pvc.yaml +++ b/src/main/resources/website/content-pvc.yaml @@ -12,4 +12,3 @@ spec: resources: requests: storage: WEBSITESTORAGESIZE - \ No newline at end of file diff --git a/src/main/resources/website/hash-state-pvc.yaml b/src/main/resources/website/hash-state-pvc.yaml index b0d3ecd..864a106 100644 --- a/src/main/resources/website/hash-state-pvc.yaml +++ b/src/main/resources/website/hash-state-pvc.yaml @@ -12,4 +12,3 @@ spec: resources: requests: storage: 16Mi - \ No newline at end of file diff --git a/src/main/resources/website/nginx-configmap.yaml b/src/main/resources/website/nginx-configmap.yaml index 3193813..47aa4df 100644 --- a/src/main/resources/website/nginx-configmap.yaml +++ b/src/main/resources/website/nginx-configmap.yaml @@ -80,8 +80,8 @@ data: } website.conf: | server { - listen 80 default_server; - listen [::]:80 default_server; + listen 8080 default_server; + listen [::]:8080 default_server; server_name FQDN add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload'; add_header X-Frame-Options "SAMEORIGIN"; @@ -96,4 +96,3 @@ data: # redirects REDIRECTS } - \ No newline at end of file diff --git a/src/main/resources/website/nginx-deployment.yaml b/src/main/resources/website/nginx-deployment.yaml index f4a73ad..4da29a0 100644 --- a/src/main/resources/website/nginx-deployment.yaml +++ b/src/main/resources/website/nginx-deployment.yaml @@ -18,40 +18,40 @@ spec: app.kubernetes.part-of: NAME-website spec: containers: - - name: nginx - image: nginx:latest - imagePullPolicy: IfNotPresent - ports: - - containerPort: 80 - volumeMounts: - - mountPath: /etc/nginx - readOnly: true - name: etc-nginx - - mountPath: /var/log/nginx - name: log - - mountPath: /var/www/html/website - name: content-volume - readOnly: true + - name: nginx + image: nginx:latest + imagePullPolicy: IfNotPresent + ports: + - containerPort: 8080 + volumeMounts: + - mountPath: /etc/nginx + readOnly: true + name: etc-nginx + - mountPath: /var/log/nginx + name: log + - mountPath: /var/www/html/website + name: content-volume + readOnly: true initContainers: - - image: domaindrivenarchitecture/c4k-website-build - name: init-build-container - imagePullPolicy: IfNotPresent - resources: - requests: - cpu: BUILD_CPU_REQUEST - memory: BUILD_MEMORY_REQUEST - limits: - cpu: BUILD_CPU_LIMIT - memory: BUILD_MEMORY_LIMIT - command: ["/entrypoint.sh"] - envFrom: - - secretRef: - name: build-secret - volumeMounts: - - name: content-volume - mountPath: /var/www/html/website - - name: hash-state-volume - mountPath: /var/hashfile.d + - image: domaindrivenarchitecture/c4k-website-build + name: init-build-container + imagePullPolicy: IfNotPresent + resources: + requests: + cpu: BUILD_CPU_REQUEST + memory: BUILD_MEMORY_REQUEST + limits: + cpu: BUILD_CPU_LIMIT + memory: BUILD_MEMORY_LIMIT + command: ["/entrypoint.sh"] + envFrom: + - secretRef: + name: build-secret + volumeMounts: + - name: content-volume + mountPath: /var/www/html/website + - name: hash-state-volume + mountPath: /var/hashfile.d volumes: - name: etc-nginx configMap: @@ -62,7 +62,7 @@ spec: - key: website.conf path: conf.d/website.conf - key: mime.types - path: mime.types + path: mime.types - name: log emptyDir: {} - name: content-volume @@ -71,4 +71,3 @@ spec: - name: hash-state-volume persistentVolumeClaim: claimName: hash-state-volume - \ No newline at end of file diff --git a/src/main/resources/website/nginx-service.yaml b/src/main/resources/website/nginx-service.yaml index e72704d..0d39a26 100644 --- a/src/main/resources/website/nginx-service.yaml +++ b/src/main/resources/website/nginx-service.yaml @@ -6,10 +6,9 @@ metadata: labels: app: NAME app.kubernetes.part-of: NAME-website -spec: +spec: selector: app: nginx ports: - name: nginx-http - port: 80 - \ No newline at end of file + port: 8080