From 45b47689106ef2c14cd2d814c6d29fb0f3444f51 Mon Sep 17 00:00:00 2001 From: YuruC3 Date: Mon, 22 Dec 2025 10:45:12 +0100 Subject: [PATCH] Element-web manifests --- MatrixLanding/autoScale.yaml | 21 ++++++++++++ MatrixLanding/copyFilesToPVCDeploy.yaml | 19 +++++++++++ MatrixLanding/deployment.yaml | 44 +++++++++++++++++++++++++ MatrixLanding/netPolicy.yaml | 37 +++++++++++++++++++++ MatrixLanding/pvc.yaml | 16 +++++++++ MatrixLanding/service.yaml | 18 ++++++++++ 6 files changed, 155 insertions(+) create mode 100644 MatrixLanding/autoScale.yaml create mode 100644 MatrixLanding/copyFilesToPVCDeploy.yaml create mode 100644 MatrixLanding/deployment.yaml create mode 100644 MatrixLanding/netPolicy.yaml create mode 100644 MatrixLanding/pvc.yaml create mode 100644 MatrixLanding/service.yaml diff --git a/MatrixLanding/autoScale.yaml b/MatrixLanding/autoScale.yaml new file mode 100644 index 0000000..7bf0a3f --- /dev/null +++ b/MatrixLanding/autoScale.yaml @@ -0,0 +1,21 @@ +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: matrix-landing-page-autoscaler + labels: + matrix-service: webclient + scaleThing: matrix-webpage +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: matrix-landing-page-deployment + minReplicas: 1 + maxReplicas: 4 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 50 diff --git a/MatrixLanding/copyFilesToPVCDeploy.yaml b/MatrixLanding/copyFilesToPVCDeploy.yaml new file mode 100644 index 0000000..c7dec66 --- /dev/null +++ b/MatrixLanding/copyFilesToPVCDeploy.yaml @@ -0,0 +1,19 @@ +apiVersion: v1 +kind: Pod +metadata: + name: config-uploader-matrix-landing-page +spec: + containers: + - name: uploader-matrix-landing-page + image: alpine:latest + command: [ "sleep", "6000" ] + stdin: true + tty: true + volumeMounts: + - mountPath: /data + name: config-volume + + volumes: + - name: config-volume + persistentVolumeClaim: + claimName: matrix-landing-page-pvc diff --git a/MatrixLanding/deployment.yaml b/MatrixLanding/deployment.yaml new file mode 100644 index 0000000..9092849 --- /dev/null +++ b/MatrixLanding/deployment.yaml @@ -0,0 +1,44 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: matrix-landing-page-deployment + + labels: + matrix-service: webclient + + +spec: + replicas: 1 + selector: + matchLabels: + matrix-service: webclient + template: + metadata: + labels: + matrix-service: webclient + spec: + containers: + - name: matrix-landing-page + image: nginx:stable + ports: + - containerPort: 80 + name: http + protocol: TCP + # imagePullPolicy: IfNotPresent + volumeMounts: + - name: nginx-root + mountPath: /usr/share/nginx/html + resources: + requests: + memory: "64Mi" + cpu: "25m" + limits: + memory: "96Mi" + cpu: "75m" + + + volumes: + - name: nginx-root + persistentVolumeClaim: + claimName: matrix-landing-page-pvc + readOnly: true diff --git a/MatrixLanding/netPolicy.yaml b/MatrixLanding/netPolicy.yaml new file mode 100644 index 0000000..cea4600 --- /dev/null +++ b/MatrixLanding/netPolicy.yaml @@ -0,0 +1,37 @@ +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: matrix-landing-page-networkpolicy +spec: + podSelector: + matchLabels: + matrix-service: webclient + egress: + # Allow all egress + # - {} + + # Allow egress only to public networks + # - to: + # - ipBlock: + # cidr: 0.0.0.0/0 + # except: + # - 10.0.0.0/8 + # - 172.16.0.0/12 + # - 192.168.0.0/16 + + ingress: + + # - from: + # - namespaceSelector: + # matchLabels: + # ns-name: + # podSelector: + # matchLabels: + # podDomain: + # ports: + # - protocol: TCP + # port: 80 + + policyTypes: + - Ingress + - Egress diff --git a/MatrixLanding/pvc.yaml b/MatrixLanding/pvc.yaml new file mode 100644 index 0000000..fff58bd --- /dev/null +++ b/MatrixLanding/pvc.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: matrix-landing-page-pvc + labels: + matrix-page: landing-page + matrix-page-domain: your.domain.example +spec: + # https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes-1 + accessModes: + # - ReadOnlyMany + # - ReadWriteOnce + - ReadWriteMany + resources: + requests: + storage: 356Mi diff --git a/MatrixLanding/service.yaml b/MatrixLanding/service.yaml new file mode 100644 index 0000000..1fddfc4 --- /dev/null +++ b/MatrixLanding/service.yaml @@ -0,0 +1,18 @@ +apiVersion: v1 +kind: Service +metadata: + name: matrix-landing-page-service + labels: + matrix-service: webclient + +spec: + selector: + matrix-service: webclient + # This isn't used as Ingress is doing TLS termination + # type: LoadBalancer + type: ClusterIP + ports: + - name: matrix-landing-page-http + appProtocol: TCP + port: 80 # <- port that will be exposed +