mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-20 04:23:09 -06:00
Labels, ingress and probes
This commit is contained in:
parent
7ad831fe62
commit
41a02c02bb
|
|
@ -88,8 +88,11 @@ Create a folder `appservices` and place your configurations in there. The confi
|
||||||
| federationapi.send_max_retries | int | `16` | |
|
| federationapi.send_max_retries | int | `16` | |
|
||||||
| image.name | string | `"ghcr.io/matrix-org/dendrite-monolith:v0.10.8"` | Docker repository/image to use |
|
| image.name | string | `"ghcr.io/matrix-org/dendrite-monolith:v0.10.8"` | Docker repository/image to use |
|
||||||
| image.pullPolicy | string | `"IfNotPresent"` | Kubernetes pullPolicy |
|
| image.pullPolicy | string | `"IfNotPresent"` | Kubernetes pullPolicy |
|
||||||
| ingress.annotations | object | `{}` | |
|
| ingress.annotateFor | string | `""` | |
|
||||||
|
| ingress.annotations | object | `{}` | Extra, custom annotations |
|
||||||
|
| ingress.className | string | `""` | |
|
||||||
| ingress.enabled | bool | `false` | Create an ingress for a monolith deployment |
|
| ingress.enabled | bool | `false` | Create an ingress for a monolith deployment |
|
||||||
|
| ingress.hostName | string | `""` | |
|
||||||
| ingress.hosts | list | `[]` | |
|
| ingress.hosts | list | `[]` | |
|
||||||
| ingress.tls | list | `[]` | |
|
| ingress.tls | list | `[]` | |
|
||||||
| mediaapi.dynamic_thumbnails | bool | `false` | |
|
| mediaapi.dynamic_thumbnails | bool | `false` | |
|
||||||
|
|
@ -102,7 +105,7 @@ Create a folder `appservices` and place your configurations in there. The confi
|
||||||
| persistence.media.existingClaim | string | `""` | Use an existing volume claim for media files |
|
| persistence.media.existingClaim | string | `""` | Use an existing volume claim for media files |
|
||||||
| persistence.search.capacity | string | `"1Gi"` | |
|
| persistence.search.capacity | string | `"1Gi"` | |
|
||||||
| persistence.search.existingClaim | string | `""` | Use an existing volume claim for the fulltext search index |
|
| persistence.search.existingClaim | string | `""` | Use an existing volume claim for the fulltext search index |
|
||||||
| persistence.storageClass | string | `"local-path"` | |
|
| persistence.storageClass | string | `""` | |
|
||||||
| postgresql.auth.database | string | `"dendrite"` | |
|
| postgresql.auth.database | string | `"dendrite"` | |
|
||||||
| postgresql.auth.password | string | `"changeme"` | |
|
| postgresql.auth.password | string | `"changeme"` | |
|
||||||
| postgresql.auth.username | string | `"dendrite"` | |
|
| postgresql.auth.username | string | `"dendrite"` | |
|
||||||
|
|
@ -111,6 +114,8 @@ Create a folder `appservices` and place your configurations in there. The confi
|
||||||
| postgresql.image.tag | string | `"14.4.0"` | |
|
| postgresql.image.tag | string | `"14.4.0"` | |
|
||||||
| postgresql.persistence.enabled | bool | `false` | |
|
| postgresql.persistence.enabled | bool | `false` | |
|
||||||
| resources | object | sets some sane default values | Default resource requests/limits. |
|
| resources | object | sets some sane default values | Default resource requests/limits. |
|
||||||
|
| service.port | int | `80` | |
|
||||||
|
| service.type | string | `"ClusterIP"` | |
|
||||||
| syncapi.real_ip_header | string | `"X-Real-IP"` | This option controls which HTTP header to inspect to find the real remote IP address of the client. This is likely required if Dendrite is running behind a reverse proxy server. |
|
| syncapi.real_ip_header | string | `"X-Real-IP"` | This option controls which HTTP header to inspect to find the real remote IP address of the client. This is likely required if Dendrite is running behind a reverse proxy server. |
|
||||||
| syncapi.search | object | `{"enabled":false,"language":"en"}` | Configuration for the full-text search engine. |
|
| syncapi.search | object | `{"enabled":false,"language":"en"}` | Configuration for the full-text search engine. |
|
||||||
| syncapi.search.enabled | bool | `false` | Whether or not search is enabled. |
|
| syncapi.search.enabled | bool | `false` | Whether or not search is enabled. |
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,60 @@
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
|
||||||
{{- define "image.name" -}}
|
{{- define "image.name" -}}
|
||||||
image: {{ .name }}
|
image: {{ .name }}
|
||||||
imagePullPolicy: {{ .pullPolicy }}
|
imagePullPolicy: {{ .pullPolicy }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Expand the name of the chart.
|
||||||
|
*/}}
|
||||||
|
{{- define "dendrite.name" -}}
|
||||||
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create a default fully qualified app name.
|
||||||
|
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||||
|
If release name contains chart name it will be used as a full name.
|
||||||
|
*/}}
|
||||||
|
{{- define "dendrite.fullname" -}}
|
||||||
|
{{- if .Values.fullnameOverride }}
|
||||||
|
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- else }}
|
||||||
|
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||||
|
{{- if contains $name .Release.Name }}
|
||||||
|
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- else }}
|
||||||
|
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Create chart name and version as used by the chart label.
|
||||||
|
*/}}
|
||||||
|
{{- define "dendrite.chart" -}}
|
||||||
|
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Common labels
|
||||||
|
*/}}
|
||||||
|
{{- define "dendrite.labels" -}}
|
||||||
|
helm.sh/chart: {{ include "dendrite.chart" . }}
|
||||||
|
{{ include "dendrite.selectorLabels" . }}
|
||||||
|
{{- if .Chart.AppVersion }}
|
||||||
|
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||||
|
{{- end }}
|
||||||
|
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Selector labels
|
||||||
|
*/}}
|
||||||
|
{{- define "dendrite.selectorLabels" -}}
|
||||||
|
app.kubernetes.io/name: {{ include "dendrite.name" . }}
|
||||||
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
|
{{- end }}
|
||||||
|
|
@ -10,12 +10,12 @@ metadata:
|
||||||
spec:
|
spec:
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: {{ $.Chart.Name }}
|
{{- include "dendrite.selectorLabels" . | nindent 6 }}
|
||||||
replicas: 1
|
replicas: 1
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: {{ $.Chart.Name }}
|
{{- include "dendrite.selectorLabels" . | nindent 8 }}
|
||||||
spec:
|
spec:
|
||||||
volumes:
|
volumes:
|
||||||
- name: {{ .Release.Name }}-conf-vol
|
- name: {{ .Release.Name }}-conf-vol
|
||||||
|
|
@ -44,6 +44,10 @@ spec:
|
||||||
args:
|
args:
|
||||||
- '--config'
|
- '--config'
|
||||||
- '/etc/dendrite/dendrite.yaml'
|
- '/etc/dendrite/dendrite.yaml'
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 8008
|
||||||
|
protocol: TCP
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml $.Values.resources | nindent 10 }}
|
{{- toYaml $.Values.resources | nindent 10 }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
|
|
@ -61,4 +65,28 @@ spec:
|
||||||
- mountPath: /data/jetstream
|
- mountPath: /data/jetstream
|
||||||
name: {{ .Release.Name }}-jetstream
|
name: {{ .Release.Name }}-jetstream
|
||||||
- mountPath: /data/search
|
- mountPath: /data/search
|
||||||
name: {{ .Release.Name }}-search
|
name: {{ .Release.Name }}-search
|
||||||
|
livenessProbe:
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 10
|
||||||
|
httpGet:
|
||||||
|
path: /_dendrite/monitor/health
|
||||||
|
port: http
|
||||||
|
readinessProbe:
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 10
|
||||||
|
httpGet:
|
||||||
|
path: /_dendrite/monitor/health
|
||||||
|
port: http
|
||||||
|
startupProbe:
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 10
|
||||||
|
httpGet:
|
||||||
|
path: /_dendrite/monitor/up
|
||||||
|
port: http
|
||||||
|
|
@ -1,28 +1,36 @@
|
||||||
{{- if .Values.ingress.enabled -}}
|
{{- if .Values.ingress.enabled -}}
|
||||||
{{ $component := "monolith" }}
|
{{- $fullName := include "dendrite.fullname" . -}}
|
||||||
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
|
{{- $svcPort := .Values.service.port -}}
|
||||||
|
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
|
||||||
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
|
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
|
||||||
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
|
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||||
apiVersion: networking.k8s.io/v1
|
apiVersion: networking.k8s.io/v1
|
||||||
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||||
apiVersion: networking.k8s.io/v1beta1
|
apiVersion: networking.k8s.io/v1beta1
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
apiVersion: extensions/v1beta1
|
apiVersion: extensions/v1beta1
|
||||||
{{- end }}
|
{{- end }}
|
||||||
kind: Ingress
|
kind: Ingress
|
||||||
metadata:
|
metadata:
|
||||||
namespace: {{ $.Release.Namespace }}
|
name: {{ $fullName }}
|
||||||
name: {{ $component }}
|
|
||||||
labels:
|
labels:
|
||||||
app: {{ $.Chart.Name }}
|
{{- include "dendrite.labels" . | nindent 4 }}
|
||||||
component: {{ $component }}
|
|
||||||
{{- with .Values.ingress.annotations }}
|
|
||||||
annotations:
|
annotations:
|
||||||
|
{{- if eq .Values.ingress.annotateFor "nginx" }}
|
||||||
|
nginx.ingress.kubernetes.io/upstream-hash-by: "$http_authorization"
|
||||||
|
nginx.org/proxy-connect-timeout: 60s
|
||||||
|
nginx.org/proxy-read-timeout: 60s
|
||||||
|
{{- else if eq .Values.ingress.annotateFor "openshift" }}
|
||||||
|
route.openshift.io/termination: edge
|
||||||
|
haproxy.router.openshift.io/balance: source
|
||||||
|
haproxy.router.openshift.io/timeout: 60000ms
|
||||||
|
{{- end}}
|
||||||
|
{{- with .Values.ingress.annotations }}
|
||||||
{{- toYaml . | nindent 4 }}
|
{{- toYaml . | nindent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
spec:
|
spec:
|
||||||
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
|
||||||
ingressClassName: {{ .Values.ingress.className }}
|
ingressClassName: {{ .Values.ingress.className }}
|
||||||
|
|
@ -38,25 +46,19 @@ spec:
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
rules:
|
rules:
|
||||||
{{- range .Values.ingress.hosts }}
|
- host: {{ .Values.ingress.hostName | quote }}
|
||||||
- host: {{ .host | quote }}
|
|
||||||
http:
|
http:
|
||||||
paths:
|
paths:
|
||||||
{{- range .paths }}
|
- path: /
|
||||||
- path: {{ .path }}
|
pathType: ImplementationSpecific
|
||||||
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
|
|
||||||
pathType: {{ .pathType }}
|
|
||||||
{{- end }}
|
|
||||||
backend:
|
backend:
|
||||||
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
|
||||||
service:
|
service:
|
||||||
name: {{ $component }}
|
name: {{ $fullName }}
|
||||||
port:
|
port:
|
||||||
number: 8008
|
number: {{ $svcPort }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
serviceName: {{ $component }}
|
serviceName: {{ $fullName }}
|
||||||
servicePort: 8008
|
servicePort: {{ $svcPort }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
|
|
@ -145,7 +145,7 @@ resources:
|
||||||
memory: "4096Mi"
|
memory: "4096Mi"
|
||||||
|
|
||||||
persistence:
|
persistence:
|
||||||
storageClass: local-path
|
storageClass: ""
|
||||||
jetstream:
|
jetstream:
|
||||||
# -- Use an existing volume claim for jetstream
|
# -- Use an existing volume claim for jetstream
|
||||||
existingClaim: ""
|
existingClaim: ""
|
||||||
|
|
@ -237,7 +237,15 @@ postgresql:
|
||||||
ingress:
|
ingress:
|
||||||
# -- Create an ingress for a monolith deployment
|
# -- Create an ingress for a monolith deployment
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
||||||
annotations: {}
|
|
||||||
hosts: []
|
hosts: []
|
||||||
|
className: ""
|
||||||
|
hostName: ""
|
||||||
|
annotateFor: "" # one of 'openshift' or 'nginx'
|
||||||
|
# -- Extra, custom annotations
|
||||||
|
annotations: {}
|
||||||
|
|
||||||
tls: []
|
tls: []
|
||||||
|
|
||||||
|
service:
|
||||||
|
type: ClusterIP
|
||||||
|
port: 80
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue