2020-08-07 21:23:34 +00:00
|
|
|
{{- if .Values.wellknown.enabled }}
|
2020-08-09 09:16:36 +00:00
|
|
|
{{- $wkName := include "matrix-synapse.externalname" (dict "global" . "external" "wellknown-lighttpd") -}}
|
2020-08-07 21:23:34 +00:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ConfigMap
|
|
|
|
metadata:
|
|
|
|
name: {{ $wkName }}
|
|
|
|
labels:
|
|
|
|
{{- include "matrix-synapse.labels" . | nindent 4 }}
|
|
|
|
component: well-known
|
|
|
|
data:
|
|
|
|
lighttpd.conf: |
|
|
|
|
server.modules = (
|
|
|
|
"mod_rewrite",
|
|
|
|
"mod_status",
|
|
|
|
"mod_accesslog"
|
|
|
|
)
|
|
|
|
include "mime-types.conf"
|
|
|
|
server.username = "lighttpd"
|
|
|
|
server.groupname = "lighttpd"
|
2020-08-09 09:16:36 +00:00
|
|
|
server.document-root = {{ .Values.wellknown.htdocsPath | quote }}
|
2020-08-07 21:23:34 +00:00
|
|
|
server.pid-file = "/run/lighttpd.pid"
|
|
|
|
server.errorlog = "/dev/stderr"
|
|
|
|
url.rewrite-once = (
|
|
|
|
"^/\.well-known/matrix/server" => "/server.json"
|
|
|
|
)
|
2020-08-09 09:16:36 +00:00
|
|
|
status.status-url = "/server-status"
|
2020-08-07 21:23:34 +00:00
|
|
|
accesslog.filename = "/dev/stderr"
|
|
|
|
|
|
|
|
server.json: |-
|
|
|
|
{{ dict "m.server" (printf "%s:%d" (default .Values.wellknown.host .Values.config.serverName) (default .Values.wellknown.port 443)) | toJson | indent 4 }}
|
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: Service
|
|
|
|
metadata:
|
|
|
|
name: {{ $wkName }}
|
|
|
|
labels:
|
|
|
|
{{- include "matrix-synapse.labels" . | nindent 4 }}
|
|
|
|
component: well-known
|
|
|
|
spec:
|
|
|
|
type: ClusterIP
|
|
|
|
ports:
|
|
|
|
- port: 80
|
|
|
|
targetPort: http
|
|
|
|
protocol: TCP
|
|
|
|
name: http
|
|
|
|
selector:
|
|
|
|
{{- include "matrix-synapse.selectorLabels" . | nindent 4 }}
|
|
|
|
component: well-known
|
|
|
|
---
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: {{ $wkName }}
|
|
|
|
labels:
|
|
|
|
{{- include "matrix-synapse.labels" . | nindent 4 }}
|
|
|
|
component: well-known
|
|
|
|
spec:
|
2020-08-09 09:16:36 +00:00
|
|
|
replicas: {{ .Values.wellknown.replicaCount | default 1 }}
|
2020-08-07 21:23:34 +00:00
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
{{- include "matrix-synapse.selectorLabels" . | nindent 6 }}
|
|
|
|
component: well-known
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
annotations:
|
|
|
|
checksum/server-addr: {{ sha256sum (printf "%s:%d" (default .Values.wellknown.host .Values.config.serverName) (default .Values.wellknown.port 443)) }}
|
|
|
|
labels:
|
|
|
|
{{- include "matrix-synapse.selectorLabels" . | nindent 8 }}
|
|
|
|
component: well-known
|
|
|
|
spec:
|
2020-08-09 09:16:36 +00:00
|
|
|
{{- include "matrix-synapse.imagePullSecrets" . | nindent 6 }}
|
|
|
|
securityContext:
|
|
|
|
{{- toYaml .Values.wellknown.podSecurityContext | nindent 8 }}
|
2020-08-07 21:23:34 +00:00
|
|
|
containers:
|
|
|
|
- name: lighttpd
|
2020-08-09 09:16:36 +00:00
|
|
|
image: "{{ .Values.wellknown.image.repository }}:{{ .Values.wellknown.image.tag }}"
|
|
|
|
imagePullPolicy: {{ .Values.wellknown.image.pullPolicy }}
|
|
|
|
securityContext:
|
|
|
|
{{- toYaml .Values.wellknown.securityContext | nindent 12 }}
|
2020-08-07 21:23:34 +00:00
|
|
|
ports:
|
|
|
|
- containerPort: 80
|
|
|
|
name: http
|
|
|
|
protocol: TCP
|
|
|
|
readinessProbe:
|
|
|
|
tcpSocket:
|
|
|
|
port: http
|
|
|
|
livenessProbe:
|
|
|
|
httpGet:
|
|
|
|
path: /server-status
|
|
|
|
port: http
|
|
|
|
volumeMounts:
|
|
|
|
- mountPath: /etc/lighttpd/lighttpd.conf
|
|
|
|
name: files
|
|
|
|
subPath: lighttpd.conf
|
2020-08-09 09:16:36 +00:00
|
|
|
- mountPath: {{ .Values.wellknown.htdocsPath }}/server.json
|
2020-08-07 21:23:34 +00:00
|
|
|
name: files
|
|
|
|
subPath: server.json
|
2020-08-09 09:16:36 +00:00
|
|
|
resources:
|
|
|
|
{{- toYaml .Values.wellknown.resources | nindent 12 }}
|
2020-08-07 21:23:34 +00:00
|
|
|
volumes:
|
|
|
|
- name: files
|
|
|
|
configMap:
|
|
|
|
name: {{ $wkName }}
|
2020-08-09 09:16:36 +00:00
|
|
|
{{- with .Values.nodeSelector }}
|
|
|
|
nodeSelector:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.affinity }}
|
|
|
|
affinity:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
|
|
|
{{- with .Values.tolerations }}
|
|
|
|
tolerations:
|
|
|
|
{{- toYaml . | nindent 8 }}
|
|
|
|
{{- end }}
|
2020-08-07 21:23:34 +00:00
|
|
|
{{- end }}
|