Add helm chart
This commit is contained in:
12
helm/mautrix-whatsapp/templates/NOTES.txt
Normal file
12
helm/mautrix-whatsapp/templates/NOTES.txt
Normal file
@ -0,0 +1,12 @@
|
||||
Your registration file is below. Save it into a YAML file and give the path to that file to synapse:
|
||||
|
||||
id: {{ .Values.appservice.id }}
|
||||
as_token: {{ .Values.appservice.asToken }}
|
||||
hs_token: {{ .Values.appservice.hsToken }}
|
||||
namespaces:
|
||||
users:
|
||||
- exclusive: true
|
||||
regex: "@{{ .Values.bridge.username_template | replace "{{.}}" ".+"}}:{{ .Values.homeserver.domain }}"
|
||||
url: {{ .Values.appservice.address }}
|
||||
sender_localpart: {{ .Values.appservice.botUsername }}
|
||||
rate_limited: false
|
55
helm/mautrix-whatsapp/templates/_helpers.tpl
Normal file
55
helm/mautrix-whatsapp/templates/_helpers.tpl
Normal file
@ -0,0 +1,55 @@
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "mautrix-whatsapp.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 "mautrix-whatsapp.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 "mautrix-whatsapp.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "mautrix-whatsapp.labels" -}}
|
||||
app.kubernetes.io/name: {{ include "mautrix-whatsapp.name" . }}
|
||||
helm.sh/chart: {{ include "mautrix-whatsapp.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "mautrix-whatsapp.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
{{ default (include "mautrix-whatsapp.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.serviceAccount.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
45
helm/mautrix-whatsapp/templates/configmap.yaml
Normal file
45
helm/mautrix-whatsapp/templates/configmap.yaml
Normal file
@ -0,0 +1,45 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "mautrix-whatsapp.fullname" . }}
|
||||
labels:
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
|
||||
app.kubernetes.io/name: {{ template "mautrix-whatsapp.name" . }}
|
||||
data:
|
||||
config.yaml: |
|
||||
homeserver:
|
||||
address: {{ .Values.homeserver.address }}
|
||||
domain: {{ .Values.homeserver.domain }}
|
||||
|
||||
appservice:
|
||||
address: http://{{ include "mautrix-whatsapp.fullname" . }}:{{ .Values.service.port }}
|
||||
|
||||
hostname: 0.0.0.0
|
||||
port: {{ .Values.service.port }}
|
||||
|
||||
{{- if .Values.postgresql.enabled }}
|
||||
database:
|
||||
type: postgres
|
||||
uri: "postgres://postgres:{{ .Values.postgresql.postgresqlPassword }}@{{ .Release.Name }}-postgresql/{{ .Values.postgresql.postgresqlDatabase }}?sslmode=disable"
|
||||
{{- else }}
|
||||
database:
|
||||
{{- toYaml .Values.appservice.database | nindent 8 }}
|
||||
{{- end }}
|
||||
|
||||
id: {{ .Values.appservice.id }}
|
||||
bot:
|
||||
username: {{ .Values.appservice.botUsername }}
|
||||
displayname: {{ .Values.appservice.botDisplayname }}
|
||||
avatar: {{ .Values.appservice.botAvatar }}
|
||||
|
||||
as_token: {{ .Values.appservice.asToken }}
|
||||
hs_token: {{ .Values.appservice.hsToken }}
|
||||
|
||||
bridge:
|
||||
{{- toYaml .Values.bridge | nindent 6 }}
|
||||
|
||||
logging:
|
||||
{{- toYaml .Values.logging | nindent 6 }}
|
||||
registration.yaml: ""
|
69
helm/mautrix-whatsapp/templates/deployment.yaml
Normal file
69
helm/mautrix-whatsapp/templates/deployment.yaml
Normal file
@ -0,0 +1,69 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "mautrix-whatsapp.fullname" . }}
|
||||
labels:
|
||||
{{- include "mautrix-whatsapp.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: {{ include "mautrix-whatsapp.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
template:
|
||||
{{- if .Values.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml .Values.podAnnotations | nindent 6 }}
|
||||
{{- end }}
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "mautrix-whatsapp.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
spec:
|
||||
serviceAccountName: {{ template "mautrix-whatsapp.serviceAccountName" . }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
volumeMounts:
|
||||
- mountPath: /data
|
||||
name: config-volume
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: {{ .Values.service.port }}
|
||||
protocol: TCP
|
||||
# livenessProbe:
|
||||
# httpGet:
|
||||
# path: /_matrix/mau/live
|
||||
# port: http
|
||||
# initialDelaySeconds: 60
|
||||
# periodSeconds: 5
|
||||
# readinessProbe:
|
||||
# httpGet:
|
||||
# path: /_matrix/mau/ready
|
||||
# port: http
|
||||
# initialDelaySeconds: 60
|
||||
# periodSeconds: 5
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
volumes:
|
||||
- name: config-volume
|
||||
configMap:
|
||||
name: {{ template "mautrix-whatsapp.fullname" . }}
|
||||
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
16
helm/mautrix-whatsapp/templates/service.yaml
Normal file
16
helm/mautrix-whatsapp/templates/service.yaml
Normal file
@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "mautrix-whatsapp.fullname" . }}
|
||||
labels:
|
||||
{{ include "mautrix-whatsapp.labels" . | indent 4 }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
name: http
|
||||
selector:
|
||||
app.kubernetes.io/name: {{ include "mautrix-whatsapp.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
8
helm/mautrix-whatsapp/templates/serviceaccount.yaml
Normal file
8
helm/mautrix-whatsapp/templates/serviceaccount.yaml
Normal file
@ -0,0 +1,8 @@
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ template "mautrix-whatsapp.serviceAccountName" . }}
|
||||
labels:
|
||||
{{ include "mautrix-whatsapp.labels" . | indent 4 }}
|
||||
{{- end -}}
|
Reference in New Issue
Block a user