From 3c3862f351ad087b567c4ae38c8c5d271cb65340 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Wed, 11 May 2022 20:21:35 +0200 Subject: [PATCH] Add Element --- deploy/base/deploy-element.yaml | 46 +++++++++++++++++++++++++++ deploy/base/ingress.yaml | 10 ++++++ deploy/base/kustomization.yaml | 3 ++ deploy/base/svc-element.yaml | 17 ++++++++++ deploy/dev/element-config.json | 54 ++++++++++++++++++++++++++++++++ deploy/dev/ingress.yaml | 5 +++ deploy/dev/kustomization.yaml | 3 ++ deploy/prod/element-config.json | 55 +++++++++++++++++++++++++++++++++ deploy/prod/ingress.yaml | 4 +++ deploy/prod/kustomization.yaml | 3 ++ 10 files changed, 200 insertions(+) create mode 100644 deploy/base/deploy-element.yaml create mode 100644 deploy/base/svc-element.yaml create mode 100644 deploy/dev/element-config.json create mode 100644 deploy/prod/element-config.json diff --git a/deploy/base/deploy-element.yaml b/deploy/base/deploy-element.yaml new file mode 100644 index 0000000..3ff9d80 --- /dev/null +++ b/deploy/base/deploy-element.yaml @@ -0,0 +1,46 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: element + labels: + app.kubernetes.io/name: element + app.kubernetes.io/instance: element +spec: + selector: + matchLabels: + app.kubernetes.io/name: element + app.kubernetes.io/instance: element + template: + metadata: + labels: + app.kubernetes.io/name: element + app.kubernetes.io/instance: element + spec: + containers: + - name: element + image: vectorim/element-web:latest + volumeMounts: + - name: config + mountPath: /app/config.json + subPath: config.json + ports: + - containerPort: 80 + name: http + protocol: TCP + livenessProbe: + httpGet: + path: / + port: http + initialDelaySeconds: 10 + periodSeconds: 10 + resources: + requests: + memory: "32Mi" + cpu: "50m" + limits: + memory: "64Mi" + cpu: "500m" + volumes: + - name: config + configMap: + name: element-config diff --git a/deploy/base/ingress.yaml b/deploy/base/ingress.yaml index dd05fd6..81fb5d0 100644 --- a/deploy/base/ingress.yaml +++ b/deploy/base/ingress.yaml @@ -26,3 +26,13 @@ spec: name: invidious port: name: http + - host: element + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: element + port: + name: http diff --git a/deploy/base/kustomization.yaml b/deploy/base/kustomization.yaml index d843fcf..4a4657e 100644 --- a/deploy/base/kustomization.yaml +++ b/deploy/base/kustomization.yaml @@ -74,3 +74,6 @@ resources: - deploy-invidious.yaml - svc-invidious.yaml + +- deploy-element.yaml +- svc-element.yaml diff --git a/deploy/base/svc-element.yaml b/deploy/base/svc-element.yaml new file mode 100644 index 0000000..894577d --- /dev/null +++ b/deploy/base/svc-element.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/instance: element + app.kubernetes.io/name: element + name: element +spec: + ports: + - name: http + port: 80 + protocol: TCP + targetPort: 80 + selector: + app.kubernetes.io/instance: element + app.kubernetes.io/name: element + type: ClusterIP diff --git a/deploy/dev/element-config.json b/deploy/dev/element-config.json new file mode 100644 index 0000000..f8fe989 --- /dev/null +++ b/deploy/dev/element-config.json @@ -0,0 +1,54 @@ +{ + "default_server_config": { + "m.homeserver": { + "base_url": "https://matrix-client.matrix.org", + "server_name": "matrix.org" + }, + "m.identity_server": { + "base_url": "https://vector.im" + } + }, + "disable_custom_urls": false, + "disable_guests": false, + "disable_login_language_selector": false, + "disable_3pid_login": false, + "brand": "Element", + "integrations_ui_url": "https://scalar.vector.im/", + "integrations_rest_url": "https://scalar.vector.im/api", + "integrations_widgets_urls": [ + "https://scalar.vector.im/_matrix/integrations/v1", + "https://scalar.vector.im/api", + "https://scalar-staging.vector.im/_matrix/integrations/v1", + "https://scalar-staging.vector.im/api", + "https://scalar-staging.riot.im/scalar/api" + ], + "bug_report_endpoint_url": "https://element.io/bugreports/submit", + "uisi_autorageshake_app": "element-auto-uisi", + "default_country_code": "GB", + "show_labs_settings": false, + "features": { }, + "default_federate": true, + "default_theme": "light", + "room_directory": { + "servers": [ + "matrix.org" + ] + }, + "piwik": { + "url": "https://piwik.riot.im/", + "whitelisted_hs_urls": ["https://matrix.org"], + "whitelisted_is_urls": ["https://vector.im", "https://matrix.org"], + "siteId": 1 + }, + "enable_presence_by_hs_url": { + "https://matrix.org": false, + "https://matrix-client.matrix.org": false + }, + "setting_defaults": { + "breadcrumbs": true + }, + "jitsi": { + "preferred_domain": "meet.element.io" + }, + "map_style_url": "https://api.maptiler.com/maps/streets/style.json?key=fU3vlMsMn4Jb6dnEIFsx" +} diff --git a/deploy/dev/ingress.yaml b/deploy/dev/ingress.yaml index 62ce7ea..61dde4e 100644 --- a/deploy/dev/ingress.yaml +++ b/deploy/dev/ingress.yaml @@ -10,9 +10,14 @@ value: - hosts: - grafana.local + - invidious.local + - element.local - op: replace path: /spec/rules/0/host value: grafana.local - op: replace path: /spec/rules/1/host value: invidious.local +- op: replace + path: /spec/rules/2/host + value: element.local diff --git a/deploy/dev/kustomization.yaml b/deploy/dev/kustomization.yaml index d055bd2..d25cd8a 100644 --- a/deploy/dev/kustomization.yaml +++ b/deploy/dev/kustomization.yaml @@ -29,6 +29,9 @@ configMapGenerator: - name: invidious-config files: - config.yml=invidious-config.yaml +- name: element-config + files: + - config.json=element-config.json secretGenerator: - name: grafana-credentials diff --git a/deploy/prod/element-config.json b/deploy/prod/element-config.json new file mode 100644 index 0000000..2de527a --- /dev/null +++ b/deploy/prod/element-config.json @@ -0,0 +1,55 @@ +{ + "default_server_config": { + "m.homeserver": { + "base_url": "https://synapse.netflux.io" + }, + "m.identity_server": { + "base_url": "https://vector.im" + } + }, + "disable_custom_urls": false, + "disable_guests": false, + "disable_login_language_selector": false, + "disable_3pid_login": false, + "brand": "Element", + "integrations_ui_url": "https://scalar.vector.im/", + "integrations_rest_url": "https://scalar.vector.im/api", + "integrations_widgets_urls": [ + "https://scalar.vector.im/_matrix/integrations/v1", + "https://scalar.vector.im/api", + "https://scalar-staging.vector.im/_matrix/integrations/v1", + "https://scalar-staging.vector.im/api", + "https://scalar-staging.riot.im/scalar/api" + ], + "bug_report_endpoint_url": "https://element.io/bugreports/submit", + "uisi_autorageshake_app": "element-auto-uisi", + "default_country_code": "GB", + "show_labs_settings": false, + "features": { }, + "default_federate": true, + "default_theme": "light", + "room_directory": { + "servers": [ + "matrix.org", + "gitter.im", + "privacytools.io" + ] + }, + "piwik": { + "url": "https://piwik.riot.im/", + "whitelisted_hs_urls": ["https://matrix.org"], + "whitelisted_is_urls": ["https://vector.im", "https://matrix.org"], + "siteId": 1 + }, + "enable_presence_by_hs_url": { + "https://matrix.org": false, + "https://matrix-client.matrix.org": false + }, + "setting_defaults": { + "breadcrumbs": true + }, + "jitsi": { + "preferred_domain": "meet.element.io" + }, + "map_style_url": "https://api.maptiler.com/maps/streets/style.json?key=fU3vlMsMn4Jb6dnEIFsx" +} diff --git a/deploy/prod/ingress.yaml b/deploy/prod/ingress.yaml index 8fae950..1d9e206 100644 --- a/deploy/prod/ingress.yaml +++ b/deploy/prod/ingress.yaml @@ -11,6 +11,7 @@ - hosts: - grafana.netflux.io - tube.netflux.io + - element.netflux.io secretName: prod-ingress-tls - op: replace path: /spec/rules/0/host @@ -18,3 +19,6 @@ - op: replace path: /spec/rules/1/host value: tube.netflux.io +- op: replace + path: /spec/rules/2/host + value: element.netflux.io diff --git a/deploy/prod/kustomization.yaml b/deploy/prod/kustomization.yaml index b94573b..5de27ff 100644 --- a/deploy/prod/kustomization.yaml +++ b/deploy/prod/kustomization.yaml @@ -17,6 +17,9 @@ configMapGenerator: - name: invidious-config files: - config.yml=invidious-config.yaml +- name: element-config + files: + - config.json=element-config.json secretGenerator: - name: prometheus-credentials