diff --git a/apps/production/element-server-suite.yaml b/apps/production/element-server-suite.yaml index 54a8423..04793e4 100644 --- a/apps/production/element-server-suite.yaml +++ b/apps/production/element-server-suite.yaml @@ -61,37 +61,6 @@ spec: enabled: true ingress: host: axion1337.chat - podAnnotations: - # Force pod restart bei ConfigMap Änderungen - checksum/config: "element-web-docs" - additional: - initContainers: - - name: copy-docs - image: busybox:1.36 - command: - - sh - - -c - - | - mkdir -p /html/docs/setup - cp /config/README-Element-Setup.md /html/docs/setup/ - cp /config/element-setup-windows.cmd /html/docs/setup/ - cp /config/element-setup-macos.command /html/docs/setup/ - cp /config/element-setup-linux.sh /html/docs/setup/ - chmod 644 /html/docs/setup/* - volumeMounts: - - name: element-web-docs - mountPath: /config - - name: html-docs - mountPath: /html - volumes: - - name: element-web-docs - configMap: - name: ess-element-web-docs - - name: html-docs - emptyDir: {} - volumeMounts: - - name: html-docs - mountPath: /usr/share/nginx/html/docs # Element Admin elementAdmin: diff --git a/apps/production/element-web-docs-server.yaml b/apps/production/element-web-docs-server.yaml new file mode 100644 index 0000000..552867d --- /dev/null +++ b/apps/production/element-web-docs-server.yaml @@ -0,0 +1,108 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: element-web-docs + namespace: matrix +spec: + replicas: 1 + selector: + matchLabels: + app: element-web-docs + template: + metadata: + labels: + app: element-web-docs + spec: + containers: + - name: nginx + image: nginx:1.26-alpine + ports: + - containerPort: 8080 + volumeMounts: + - name: config + mountPath: /config + - name: nginx-conf + mountPath: /etc/nginx/conf.d/default.conf + subPath: nginx.conf + - name: html + mountPath: /usr/share/nginx/html + lifecycle: + postStart: + exec: + command: ["/bin/sh", "-c"] + args: + - | + mkdir -p /usr/share/nginx/html/docs/setup + cp /config/README-Element-Setup.md /usr/share/nginx/html/docs/setup/ + cp /config/element-setup-windows.cmd /usr/share/nginx/html/docs/setup/ + cp /config/element-setup-macos.command /usr/share/nginx/html/docs/setup/ + cp /config/element-setup-linux.sh /usr/share/nginx/html/docs/setup/ + chmod 644 /usr/share/nginx/html/docs/setup/* + volumes: + - name: config + configMap: + name: ess-element-web-docs + - name: nginx-conf + configMap: + name: element-web-docs-nginx + - name: html + emptyDir: {} + +--- +apiVersion: v1 +kind: Service +metadata: + name: element-web-docs + namespace: matrix +spec: + selector: + app: element-web-docs + ports: + - protocol: TCP + port: 80 + targetPort: 8080 + type: ClusterIP + +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: element-web-docs + namespace: matrix +spec: + ingressClassName: nginx + rules: + - host: axion1337.chat + http: + paths: + - path: /docs/setup + pathType: Prefix + backend: + service: + name: element-web-docs + port: + number: 80 + +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: element-web-docs-nginx + namespace: matrix +data: + nginx.conf: | + server { + listen 8080; + server_name _; + + root /usr/share/nginx/html; + + location /docs/setup/ { + autoindex on; + add_header Content-Type application/octet-stream; + } + + location / { + return 404; + } + } diff --git a/apps/production/kustomization.yaml b/apps/production/kustomization.yaml index 18ab60f..6affd67 100644 --- a/apps/production/kustomization.yaml +++ b/apps/production/kustomization.yaml @@ -8,6 +8,7 @@ resources: - custom-configs/element-values.yaml - custom-configs/mas-secret.yaml - element-web-docs-configmap.yaml + - element-web-docs-server.yaml # HelmRelease (muss ganz unten stehen, damit die ConfigMaps vorher da sind!) - element-server-suite.yaml # Custom Apex Ingress für Element Web + Well-Known auf axion1337.chat