From 41ae9265318e598e417a8949bba1c2e77e274014 Mon Sep 17 00:00:00 2001 From: WrenIX Date: Thu, 27 Feb 2025 13:29:52 +0100 Subject: [PATCH] fix(conduit): add global (and improve docs) --- conduit/Chart.yaml | 2 +- conduit/README.md | 67 ++++++++++++--------- conduit/templates/deployment.yaml | 4 +- conduit/templates/wellknown/deployment.yaml | 4 +- conduit/values.yaml | 58 ++++++++++++++++-- 5 files changed, 97 insertions(+), 38 deletions(-) diff --git a/conduit/Chart.yaml b/conduit/Chart.yaml index 34465f6..61d7646 100644 --- a/conduit/Chart.yaml +++ b/conduit/Chart.yaml @@ -3,7 +3,7 @@ name: conduit description: Conduit is a simple, fast and reliable chat server powered by Matrix. icon: https://conduit.rs/conduit.svg type: application -version: "1.0.3" +version: "1.0.4" # renovate: image=docker.io/matrixconduit/matrix-conduit appVersion: "0.9.0" maintainers: diff --git a/conduit/README.md b/conduit/README.md index 75ded25..f88d6cd 100644 --- a/conduit/README.md +++ b/conduit/README.md @@ -7,7 +7,7 @@ description: "Conduit is a simple, fast and reliable chat server powered by Matr # conduit -![Version: 1.0.3](https://img.shields.io/badge/Version-1.0.3-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.9.0](https://img.shields.io/badge/AppVersion-0.9.0-informational?style=flat-square) +![Version: 1.0.4](https://img.shields.io/badge/Version-1.0.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.9.0](https://img.shields.io/badge/AppVersion-0.9.0-informational?style=flat-square) Conduit is a simple, fast and reliable chat server powered by Matrix. @@ -41,6 +41,36 @@ helm uninstall conduit-release ## Values +### well known + +| Key | Type | Default | Description | +|-----|------|---------|-------------| +| wellknown.affinity | object | `{}` | pod affinity | +| wellknown.client | object | `{"m.homeserver":{"base_url":"https://your.server.name/"},"org.matrix.msc3575.proxy":{"url":"https://your.server.name/"}}` | client entry in well-known | +| wellknown.containerPort | int | `80` | port webservice | +| wellknown.enabled | bool | `false` | enable/deploy add extra webservice for well-known urls | +| wellknown.env | list | `[]` | pod env | +| wellknown.image.pullPolicy | string | `"IfNotPresent"` | This sets the pull policy for images. (could be overwritten by global.image.pullPolicy) | +| wellknown.image.registry | string | `"docker.io"` | image registry (could be overwritten by global.image.registry) | +| wellknown.image.repository | string | `"library/nginx"` | image repository | +| wellknown.image.tag | string | `"1.27.4"` | image tag | +| wellknown.nginxServerConf | string | `"server {\n listen {{ .containerPort }};\n server_name localhost;\n\n location /.well-known/matrix/server {\n return 200 {{ toJson .server | quote }};\n types { } default_type \"application/json; charset=utf-8\";\n }\n\n location /.well-known/matrix/client {\n return 200 {{ toJson .client | quote }};\n types { } default_type \"application/json; charset=utf-8\";\n add_header \"Access-Control-Allow-Origin\" *;\n }\n\n location / {\n # return 200 'Welcome to the your.server.name conduit server!';\n # types { } default_type \"text/plain; charset=utf-8\";\n return 404;\n }\n\n location /nginx_health {\n return 200 'OK';\n types { } default_type \"text/plain; charset=utf-8\";\n }\n}"` | nginx config | +| wellknown.nodeSelector | object | `{}` | pod node selector | +| wellknown.podAnnotations | list | `[]` | pod annotations | +| wellknown.podLabels | object | `{}` | pod labels | +| wellknown.podSecurityContext | object | `{}` | securityContext of Pod | +| wellknown.replicaCount | int | `1` | replicas | +| wellknown.resources | object | `{}` | pod resources | +| wellknown.rewriteRoot | bool | `false` | if ingress is enabled: specifies whether ingress should redirect the `/`-Location to the wellknown server | +| wellknown.securityContext | object | `{}` | securityContext of container | +| wellknown.server | object | `{"m.server":"your.server.name:443"}` | server entry in well-known | +| wellknown.service.annotations | object | `{}` | annotations of service | +| wellknown.service.port | int | `8080` | port of service | +| wellknown.service.type | string | `"ClusterIP"` | service type | +| wellknown.tolerations | list | `[]` | pod tolerations | + +### Other Values + | Key | Type | Default | Description | |-----|------|---------|-------------| | affinity | object | `{}` | | @@ -62,10 +92,12 @@ helm uninstall conduit-release | conduit.wellKnown.client | string | `""` | client well-known configuration in conduit | | conduit.wellKnown.server | string | `"https://your.server.name"` | server well-known configuration in conduit | | fullnameOverride | string | `""` | | -| image.pullPolicy | string | `"IfNotPresent"` | | -| image.registry | string | `"docker.io"` | | -| image.repository | string | `"matrixconduit/matrix-conduit"` | | -| image.tag | string | `""` | | +| global.image.pullPolicy | string | `nil` | if set it will overwrite all pullPolicy | +| global.image.registry | string | `nil` | if set it will overwrite all registry entries | +| image.pullPolicy | string | `"IfNotPresent"` | This sets the pull policy for images. (could be overwritten by global.image.pullPolicy) | +| image.registry | string | `"docker.io"` | image registry (could be overwritten by global.image.registry) | +| image.repository | string | `"matrixconduit/matrix-conduit"` | image repository | +| image.tag | string | `""` | image tag - Overrides the image tag whose default is the chart appVersion. | | imagePullSecrets | list | `[]` | | | ingress.annotations | object | `{}` | | | ingress.className | string | `""` | | @@ -86,7 +118,7 @@ helm uninstall conduit-release | podAnnotations | object | `{}` | | | podLabels | object | `{}` | | | podSecurityContext | object | `{}` | | -| replicaCount | int | `1` | | +| replicaCount | int | `1` | replicas | | resources | object | `{}` | | | securityContext | object | `{}` | | | service.port | int | `6167` | | @@ -95,28 +127,5 @@ helm uninstall conduit-release | serviceAccount.create | bool | `true` | | | serviceAccount.name | string | `""` | | | tolerations | list | `[]` | | -| wellknown.affinity | object | `{}` | | -| wellknown.client | object | `{"m.homeserver":{"base_url":"https://your.server.name/"},"org.matrix.msc3575.proxy":{"url":"https://your.server.name/"}}` | client entry in well-known | -| wellknown.containerPort | int | `80` | | -| wellknown.enabled | bool | `false` | | -| wellknown.env | list | `[]` | | -| wellknown.image.pullPolicy | string | `"IfNotPresent"` | | -| wellknown.image.registry | string | `"docker.io"` | | -| wellknown.image.repository | string | `"library/nginx"` | | -| wellknown.image.tag | string | `"1.27.4"` | | -| wellknown.nginxServerConf | string | `"server {\n listen {{ .containerPort }};\n server_name localhost;\n\n location /.well-known/matrix/server {\n return 200 {{ toJson .server | quote }};\n types { } default_type \"application/json; charset=utf-8\";\n }\n\n location /.well-known/matrix/client {\n return 200 {{ toJson .client | quote }};\n types { } default_type \"application/json; charset=utf-8\";\n add_header \"Access-Control-Allow-Origin\" *;\n }\n\n location / {\n # return 200 'Welcome to the your.server.name conduit server!';\n # types { } default_type \"text/plain; charset=utf-8\";\n return 404;\n }\n\n location /nginx_health {\n return 200 'OK';\n types { } default_type \"text/plain; charset=utf-8\";\n }\n}"` | nginx config | -| wellknown.nodeSelector | object | `{}` | | -| wellknown.podAnnotations | list | `[]` | | -| wellknown.podLabels | object | `{}` | | -| wellknown.podSecurityContext | object | `{}` | | -| wellknown.replicaCount | int | `1` | | -| wellknown.resources | object | `{}` | | -| wellknown.rewriteRoot | bool | `false` | if ingress is enabled: specifies whether ingress should redirect the `/`-Location to the wellknown server | -| wellknown.securityContext | object | `{}` | | -| wellknown.server | object | `{"m.server":"your.server.name:443"}` | server entry in well-known | -| wellknown.service.annotations | object | `{}` | | -| wellknown.service.port | int | `8080` | | -| wellknown.service.type | string | `"ClusterIP"` | | -| wellknown.tolerations | list | `[]` | | Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs) diff --git a/conduit/templates/deployment.yaml b/conduit/templates/deployment.yaml index 8c10770..552472c 100644 --- a/conduit/templates/deployment.yaml +++ b/conduit/templates/deployment.yaml @@ -39,9 +39,9 @@ spec: securityContext: {{- toYaml .Values.securityContext | nindent 12 }} {{- with .Values.image }} - image: "{{ .registry }}/{{ .repository }}:{{ .tag | default (printf "v%s" $.Chart.AppVersion) }}" + image: "{{ coalesce $.Values.global.image.registry .registry }}/{{ .repository }}:{{ .tag | default $.Chart.AppVersion }}" + imagePullPolicy: {{ coalesce $.Values.global.image.pullPolicy .pullPolicy }} {{- end }} - imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http containerPort: {{ .Values.service.port }} diff --git a/conduit/templates/wellknown/deployment.yaml b/conduit/templates/wellknown/deployment.yaml index 9ccd0c7..19c6b47 100644 --- a/conduit/templates/wellknown/deployment.yaml +++ b/conduit/templates/wellknown/deployment.yaml @@ -38,9 +38,9 @@ spec: securityContext: {{- toYaml .Values.wellknown.securityContext | nindent 12 }} {{- with .Values.wellknown.image }} - image: "{{ .registry }}/{{ .repository }}:{{ .tag }}" + image: "{{ coalesce $.Values.global.image.registry .registry }}/{{ .repository }}:{{ .tag | default $.Chart.AppVersion }}" + imagePullPolicy: {{ coalesce $.Values.global.image.pullPolicy .pullPolicy }} {{- end }} - imagePullPolicy: {{ .Values.wellknown.image.pullPolicy }} ports: - name: http containerPort: {{ .Values.wellknown.containerPort }} diff --git a/conduit/values.yaml b/conduit/values.yaml index cf73adb..28a721f 100644 --- a/conduit/values.yaml +++ b/conduit/values.yaml @@ -1,14 +1,22 @@ -# Default values for conduit. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. +global: + image: + # -- if set it will overwrite all registry entries + registry: + # -- if set it will overwrite all pullPolicy + pullPolicy: + +# -- replicas replicaCount: 1 image: + # -- image registry (could be overwritten by global.image.registry) registry: docker.io + # -- image repository repository: matrixconduit/matrix-conduit + # -- This sets the pull policy for images. (could be overwritten by global.image.pullPolicy) pullPolicy: IfNotPresent - # Overrides the image tag whose default is the chart appVersion. + # -- image tag - Overrides the image tag whose default is the chart appVersion. tag: "" imagePullSecrets: [] @@ -47,37 +55,78 @@ conduit: server: "https://your.server.name" wellknown: + # -- enable/deploy add extra webservice for well-known urls + # @section -- well known enabled: false image: + # -- image registry (could be overwritten by global.image.registry) + # @section -- well known registry: docker.io + # -- image repository + # @section -- well known repository: library/nginx + # -- This sets the pull policy for images. (could be overwritten by global.image.pullPolicy) + # @section -- well known pullPolicy: IfNotPresent + # -- image tag + # @section -- well known tag: "1.27.4" + # -- replicas + # @section -- well known replicaCount: 1 + # -- pod labels + # @section -- well known podLabels: {} + # -- pod annotations + # @section -- well known podAnnotations: [] + # -- securityContext of Pod + # @section -- well known podSecurityContext: {} + # -- securityContext of container + # @section -- well known securityContext: {} + # -- port webservice + # @section -- well known containerPort: 80 + # -- pod env + # @section -- well known env: [] + # -- pod resources + # @section -- well known resources: {} + # -- pod node selector + # @section -- well known nodeSelector: {} + # -- pod tolerations + # @section -- well known tolerations: [] + # -- pod affinity + # @section -- well known affinity: {} service: + # -- service type + # @section -- well known type: ClusterIP + # -- port of service + # @section -- well known port: 8080 + # -- annotations of service + # @section -- well known annotations: {} # -- if ingress is enabled: specifies whether ingress should redirect the `/`-Location to the wellknown server + # @section -- well known rewriteRoot: false # -- server entry in well-known + # @section -- well known server: "m.server": "your.server.name:443" # -- client entry in well-known + # @section -- well known client: "m.homeserver": "base_url": "https://your.server.name/" @@ -85,6 +134,7 @@ wellknown: "url": "https://your.server.name/" # -- nginx config + # @section -- well known nginxServerConf: |- server { listen {{ .containerPort }};