From 54706c382e7c5769da882e11135c512fba498462 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Tue, 21 Dec 2021 13:00:48 +0100 Subject: [PATCH] [apps/matrix] further cleanup --- apps/matrix/README.md | 2 + apps/matrix/templates/element-web.yaml | 50 +++++++++++++++++++ .../{deployment.yaml => matrix-synapse.yaml} | 43 ---------------- .../templates/tests/test-connection.yaml | 13 ----- 4 files changed, 52 insertions(+), 56 deletions(-) create mode 100644 apps/matrix/templates/element-web.yaml rename apps/matrix/templates/{deployment.yaml => matrix-synapse.yaml} (84%) delete mode 100644 apps/matrix/templates/tests/test-connection.yaml diff --git a/apps/matrix/README.md b/apps/matrix/README.md index 1599f6c..fded2a5 100644 --- a/apps/matrix/README.md +++ b/apps/matrix/README.md @@ -18,6 +18,8 @@ * Needs config: /app/config.json * Needs FQDN for HTTPS / nginx * Maybe limit the builtin webserver to localhost? + * Configmap to /etc/nginx/conf.d/default.conf + * Entrypoint `nginx -g daemon off`D To add: diff --git a/apps/matrix/templates/element-web.yaml b/apps/matrix/templates/element-web.yaml new file mode 100644 index 0000000..ead5154 --- /dev/null +++ b/apps/matrix/templates/element-web.yaml @@ -0,0 +1,50 @@ +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-matrix-element-web +spec: + selector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: matrix-element-web + replicas: 1 + template: + metadata: + labels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: matrix-element-web + spec: + containers: + - name: element-web + image: vectorim/element-web:{{ .Values.elementWebVersion }} + ports: + - containerPort: 80 +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-element-web + labels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: matrix-element-web +spec: + type: ClusterIP + ports: + # Required for letsencrypt + - port: 80 + name: http + selector: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: matrix-element-web + +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-element-web + labels: + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/component: matrix-element-web +data: +{{ tpl (.Files.Get "element-web/nginx-default.conf") . | indent 8 }} diff --git a/apps/matrix/templates/deployment.yaml b/apps/matrix/templates/matrix-synapse.yaml similarity index 84% rename from apps/matrix/templates/deployment.yaml rename to apps/matrix/templates/matrix-synapse.yaml index 1a8c13c..36e0913 100644 --- a/apps/matrix/templates/deployment.yaml +++ b/apps/matrix/templates/matrix-synapse.yaml @@ -1,42 +1,3 @@ ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ .Release.Name }}-matrix-element-web -spec: - selector: - matchLabels: - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/component: matrix-element-web - replicas: 1 - template: - metadata: - labels: - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/component: matrix-element-web - spec: - containers: - - name: element-web - image: vectorim/element-web:{{ .Values.elementWebVersion }} - ports: - - containerPort: 80 ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ .Release.Name }}-element-web - labels: - app: {{ .Release.Name }}-element-web -spec: - type: ClusterIP - ports: - # Required for letsencrypt - - port: 80 - name: http - selector: - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/component: matrix-element-web ---- apiVersion: apps/v1 kind: Deployment metadata: @@ -72,10 +33,6 @@ spec: mountPath: "/baseconfig" containers: - name: matrix - # SYNAPSE_CONFIG_DIR: where additional configs are placed -> postgres-db.yaml - # SYNAPSE_CONFIG_PATH: the initial config - # log.yaml -> same dir as postgres-db.yaml - # /data = persistent storage image: ungleich/ungleich-matrix-synapse:{{ .Values.synapseVersion }} imagePullPolicy: Always ports: diff --git a/apps/matrix/templates/tests/test-connection.yaml b/apps/matrix/templates/tests/test-connection.yaml deleted file mode 100644 index 85cbdda..0000000 --- a/apps/matrix/templates/tests/test-connection.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Pod -metadata: - name: "{{ tpl .Values.identifier . }}-test-connection" - annotations: - "helm.sh/hook": test -spec: - containers: - - name: wget - image: busybox - command: ['wget'] - args: ['https://{{ tpl .Values.fqdn . }}'] - restartPolicy: Never