From 2bd13d61fd894ea162871d439f54d63c3daccb59 Mon Sep 17 00:00:00 2001 From: bom Date: Thu, 24 Aug 2023 11:26:26 +0200 Subject: [PATCH] Remove website resources --- .../resources/website/hashfile-volume.yaml | 16 --- .../resources/website/nginx-configmap.yaml | 97 ------------------- .../resources/website/nginx-deployment.yaml | 76 --------------- src/main/resources/website/nginx-service.yaml | 15 --- .../resources/website/website-build-cron.yaml | 48 --------- .../website/website-build-secret.yaml | 10 -- .../website/website-content-volume.yaml | 16 --- 7 files changed, 278 deletions(-) delete mode 100644 src/main/resources/website/hashfile-volume.yaml delete mode 100644 src/main/resources/website/nginx-configmap.yaml delete mode 100644 src/main/resources/website/nginx-deployment.yaml delete mode 100644 src/main/resources/website/nginx-service.yaml delete mode 100644 src/main/resources/website/website-build-cron.yaml delete mode 100644 src/main/resources/website/website-build-secret.yaml delete mode 100644 src/main/resources/website/website-content-volume.yaml diff --git a/src/main/resources/website/hashfile-volume.yaml b/src/main/resources/website/hashfile-volume.yaml deleted file mode 100644 index 99f35db..0000000 --- a/src/main/resources/website/hashfile-volume.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: NAME-hashfile-volume - namespace: default - labels: - app: NAME-nginx - app.kubernetes.part-of: NAME-website -spec: - storageClassName: local-path - accessModes: - - ReadWriteOnce - 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 deleted file mode 100644 index cd9a1dc..0000000 --- a/src/main/resources/website/nginx-configmap.yaml +++ /dev/null @@ -1,97 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: NAME-configmap - namespace: default - labels: - app.kubernetes.part-of: NAME-website -data: - nginx.conf: | - user nginx; - worker_processes 3; - error_log /var/log/nginx/error.log; - pid /var/log/nginx/nginx.pid; - worker_rlimit_nofile 8192; - events { - worker_connections 4096; - } - http { - include /etc/nginx/mime.types; - default_type application/octet-stream; - log_format main '$remote_addr - $remote_user [$time_local] $status' - '"$request" $body_bytes_sent "$http_referer"' - '"$http_user_agent" "$http_x_forwarded_for"'; - access_log /var/log/nginx/access.log main; - sendfile on; - tcp_nopush on; - keepalive_timeout 65; - server_names_hash_bucket_size 128; - include /etc/nginx/conf.d/website.conf; - } - mime.types: | - types { - text/html html htm shtml; - text/css css; - text/xml xml rss; - image/gif gif; - image/jpeg jpeg jpg; - application/x-javascript js; - text/plain txt; - text/x-component htc; - text/mathml mml; - image/svg+xml svg svgz; - image/png png; - image/x-icon ico; - image/x-jng jng; - image/vnd.wap.wbmp wbmp; - application/java-archive jar war ear; - application/mac-binhex40 hqx; - application/pdf pdf; - application/x-cocoa cco; - application/x-java-archive-diff jardiff; - application/x-java-jnlp-file jnlp; - application/x-makeself run; - application/x-perl pl pm; - application/x-pilot prc pdb; - application/x-rar-compressed rar; - application/x-redhat-package-manager rpm; - application/x-sea sea; - application/x-shockwave-flash swf; - application/x-stuffit sit; - application/x-tcl tcl tk; - application/x-x509-ca-cert der pem crt; - application/x-xpinstall xpi; - application/zip zip; - application/octet-stream deb; - application/octet-stream bin exe dll; - application/octet-stream dmg; - application/octet-stream eot; - application/octet-stream iso img; - application/octet-stream msi msp msm; - audio/mpeg mp3; - audio/x-realaudio ra; - video/mpeg mpeg mpg; - video/quicktime mov; - video/x-flv flv; - video/x-msvideo avi; - video/x-ms-wmv wmv; - video/x-ms-asf asx asf; - video/x-mng mng; - } - website.conf: | - server { - listen 80 default_server; - listen [::]:80 default_server; - server_name FQDN - add_header Strict-Transport-Security 'max-age=31536000; includeSubDomains; preload'; - add_header X-Frame-Options "SAMEORIGIN"; - add_header X-Content-Type-Options nosniff; - add_header Referrer-Policy "strict-origin"; - # add_header Permissions-Policy "permissions here"; - root /var/www/html/website/; - index index.html; - location / { - try_files $uri $uri/ /index.html =404; - } - } - \ No newline at end of file diff --git a/src/main/resources/website/nginx-deployment.yaml b/src/main/resources/website/nginx-deployment.yaml deleted file mode 100644 index 9133cd2..0000000 --- a/src/main/resources/website/nginx-deployment.yaml +++ /dev/null @@ -1,76 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: NAME-deployment - labels: - app.kubernetes.part-of: NAME-website -spec: - replicas: 1 - selector: - matchLabels: - app: NAME-nginx - template: - metadata: - labels: - app: NAME-nginx - spec: - containers: - - name: NAME-nginx - image: nginx:latest - imagePullPolicy: IfNotPresent - ports: - - containerPort: 80 - volumeMounts: - - mountPath: /etc/nginx - readOnly: true - name: nginx-config-volume - - mountPath: /var/log/nginx - name: log - - mountPath: /var/www/html/website - name: content-volume - readOnly: true - initContainers: - - image: domaindrivenarchitecture/c4k-website-build - name: 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: NAME-secret - env: - - name: SHA256SUM - value: CHECK_SUM - - name: SCRIPTFILE - value: SCRIPT_FILE - volumeMounts: - - name: content-volume - mountPath: /var/www/html/website - - name: hashfile-volume - mountPath: /var/hashfile.d - volumes: - - name: nginx-config-volume - configMap: - name: NAME-configmap - items: - - key: nginx.conf - path: nginx.conf - - key: website.conf - path: conf.d/website.conf - - key: mime.types - path: mime.types - - name: log - emptyDir: {} - - name: content-volume - persistentVolumeClaim: - claimName: NAME-content-volume - - name: hashfile-volume - persistentVolumeClaim: - claimName: NAME-hashfile-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 deleted file mode 100644 index 36ab954..0000000 --- a/src/main/resources/website/nginx-service.yaml +++ /dev/null @@ -1,15 +0,0 @@ -kind: Service -apiVersion: v1 -metadata: - name: NAME-service - labels: - app: NAME-nginx - app.kubernetes.part-of: NAME-website - namespace: default -spec: - selector: - app: NAME-nginx - ports: - - name: nginx-http - port: 80 - \ No newline at end of file diff --git a/src/main/resources/website/website-build-cron.yaml b/src/main/resources/website/website-build-cron.yaml deleted file mode 100644 index 1c79d09..0000000 --- a/src/main/resources/website/website-build-cron.yaml +++ /dev/null @@ -1,48 +0,0 @@ -apiVersion: batch/v1 -kind: CronJob -metadata: - name: NAME-build-cron - labels: - app.kubernetes.part-of: NAME-website -spec: - schedule: "0/7 * * * *" - successfulJobsHistoryLimit: 1 - failedJobsHistoryLimit: 1 - jobTemplate: - spec: - template: - spec: - containers: - - image: domaindrivenarchitecture/c4k-website-build - name: NAME-build-app - 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: NAME-secret - env: - - name: SHA256SUM - value: CHECK_SUM - - name: SCRIPTFILE - value: SCRIPT_FILE - volumeMounts: - - name: content-volume - mountPath: /var/www/html/website - - name: hashfile-volume - mountPath: /var/hashfile.d - volumes: - - name: content-volume - persistentVolumeClaim: - claimName: NAME-content-volume - - name: hashfile-volume - persistentVolumeClaim: - claimName: NAME-hashfile-volume - restartPolicy: OnFailure - \ No newline at end of file diff --git a/src/main/resources/website/website-build-secret.yaml b/src/main/resources/website/website-build-secret.yaml deleted file mode 100644 index f173d46..0000000 --- a/src/main/resources/website/website-build-secret.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - name: NAME-secret - labels: - app.kubernetes.part-of: NAME-website -data: - AUTHTOKEN: TOKEN - GITREPOURL: REPOURL - GITCOMMITURL: COMMITURL diff --git a/src/main/resources/website/website-content-volume.yaml b/src/main/resources/website/website-content-volume.yaml deleted file mode 100644 index 4e6f130..0000000 --- a/src/main/resources/website/website-content-volume.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: NAME-content-volume - namespace: default - labels: - app: NAME-nginx - app.kubernetes.part-of: NAME-website -spec: - storageClassName: local-path - accessModes: - - ReadWriteOnce - resources: - requests: - storage: WEBSITESTORAGESIZE - \ No newline at end of file