Merge wellknown, use nginx conf.d, improvements
This commit is contained in:
parent
2b01eb74b4
commit
37eec10d2b
8 changed files with 33 additions and 155 deletions
|
@ -76,5 +76,14 @@ spec:
|
||||||
name: {{ include "conduit.fullname" . }}-wellknown
|
name: {{ include "conduit.fullname" . }}-wellknown
|
||||||
port:
|
port:
|
||||||
name: http
|
name: http
|
||||||
|
{{- if .Values.wellknown.rewriteRoot }}
|
||||||
|
- path: /
|
||||||
|
pathType: Exact
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: {{ include "conduit.fullname" . }}-wellknown
|
||||||
|
port:
|
||||||
|
name: http
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -2,10 +2,12 @@
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: ConfigMap
|
kind: ConfigMap
|
||||||
metadata:
|
metadata:
|
||||||
name: {{ include "conduit.fullname" . }}-wellknown
|
name: {{ include "conduit.fullname" . }}-nginx-wellknown
|
||||||
labels:
|
labels:
|
||||||
{{- include "conduit.labels" . | nindent 4 }}
|
{{- include "conduit.labels" . | nindent 4 }}
|
||||||
data:
|
data:
|
||||||
server: {{ toJson .Values.wellknown.server | quote }}
|
default.conf: |
|
||||||
client: {{ toJson .Values.wellknown.client | quote }}
|
{{- with .Values.wellknown}}
|
||||||
|
{{ tpl .nginxServerConf . | quote | indent 4 }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
|
@ -46,17 +46,19 @@ spec:
|
||||||
protocol: TCP
|
protocol: TCP
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /
|
path: /nginx_health
|
||||||
port: http
|
port: http
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /
|
path: /nginx_health
|
||||||
port: http
|
port: http
|
||||||
resources:
|
resources:
|
||||||
{{- toYaml .Values.wellknown.resources | nindent 12 }}
|
{{- toYaml .Values.wellknown.resources | nindent 12 }}
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: "data"
|
- name: "wellknown-nginx-conf"
|
||||||
mountPath: "/usr/share/nginx/html/.well-known/matrix/"
|
mountPath: "/etc/nginx/conf.d/default.conf"
|
||||||
|
subPath: default.conf
|
||||||
|
readOnly: true
|
||||||
{{- with .Values.wellknown.nodeSelector }}
|
{{- with .Values.wellknown.nodeSelector }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
|
@ -70,7 +72,7 @@ spec:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
volumes:
|
volumes:
|
||||||
- name: "data"
|
- name: "wellknown-nginx-conf"
|
||||||
configMap:
|
configMap:
|
||||||
name: {{ include "conduit.fullname" . }}-wellknown
|
name: {{ include "conduit.fullname" . }}-nginx-wellknown
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
{{- if .Values.wellknowncustom.enabled }}
|
|
||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: {{ include "conduit.fullname" . }}-nginx-wellknowncustom
|
|
||||||
labels:
|
|
||||||
{{- include "conduit.labels" . | nindent 4 }}
|
|
||||||
data:
|
|
||||||
nginx.conf: |
|
|
||||||
{{ .Values.wellknowncustom.nginx_conf | nindent 4 }}
|
|
||||||
{{- end }}
|
|
|
@ -1,79 +0,0 @@
|
||||||
{{- if .Values.wellknowncustom.enabled }}
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: {{ include "conduit.fullname" . }}-wellknowncustom
|
|
||||||
labels:
|
|
||||||
{{- include "conduit.labels" . | nindent 4 }}
|
|
||||||
app.kubernetes.io/component: wellknowncustom
|
|
||||||
spec:
|
|
||||||
replicas: {{ .Values.wellknowncustom.replicaCount }}
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
{{- include "conduit.selectorLabels" . | nindent 6 }}
|
|
||||||
app.kubernetes.io/component: wellknowncustom
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
{{- with .Values.wellknowncustom.podAnnotations }}
|
|
||||||
annotations:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
labels:
|
|
||||||
{{- include "conduit.selectorLabels" . | nindent 8 }}
|
|
||||||
app.kubernetes.io/component: wellknowncustom
|
|
||||||
{{- with .Values.wellknowncustom.podLabels }}
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
type: wellknowncustom
|
|
||||||
spec:
|
|
||||||
{{- with .Values.imagePullSecrets }}
|
|
||||||
imagePullSecrets:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
serviceAccountName: {{ include "conduit.serviceAccountName" . }}
|
|
||||||
securityContext:
|
|
||||||
{{- toYaml .Values.wellknowncustom.podSecurityContext | nindent 8 }}
|
|
||||||
containers:
|
|
||||||
- name: wellknowncustom
|
|
||||||
securityContext:
|
|
||||||
{{- toYaml .Values.wellknowncustom.securityContext | nindent 12 }}
|
|
||||||
{{- with .Values.wellknowncustom.image }}
|
|
||||||
image: "{{ .registry }}/{{ .repository }}:{{ .tag }}"
|
|
||||||
{{- end }}
|
|
||||||
imagePullPolicy: {{ .Values.wellknowncustom.image.pullPolicy }}
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
containerPort: {{ .Values.wellknowncustom.containerPort }}
|
|
||||||
protocol: TCP
|
|
||||||
livenessProbe:
|
|
||||||
httpGet:
|
|
||||||
path: /nginx_health
|
|
||||||
port: http
|
|
||||||
readinessProbe:
|
|
||||||
httpGet:
|
|
||||||
path: /nginx_health
|
|
||||||
port: http
|
|
||||||
resources:
|
|
||||||
{{- toYaml .Values.wellknowncustom.resources | nindent 12 }}
|
|
||||||
volumeMounts:
|
|
||||||
- name: "wellknowncustom-nginx-conf"
|
|
||||||
mountPath: "/etc/nginx/nginx.conf"
|
|
||||||
subPath: nginx.conf
|
|
||||||
readOnly: true
|
|
||||||
{{- with .Values.wellknowncustom.nodeSelector }}
|
|
||||||
nodeSelector:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.wellknowncustom.affinity }}
|
|
||||||
affinity:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.wellknowncustom.tolerations }}
|
|
||||||
tolerations:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
volumes:
|
|
||||||
- name: "wellknowncustom-nginx-conf"
|
|
||||||
configMap:
|
|
||||||
name: {{ include "conduit.fullname" . }}-nginx-wellknowncustom
|
|
||||||
{{- end }}
|
|
|
@ -1,18 +0,0 @@
|
||||||
{{- if .Values.wellknowncustom.enabled }}
|
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: {{ include "conduit.fullname" . }}-wellknowncustom
|
|
||||||
labels:
|
|
||||||
{{- include "conduit.labels" . | nindent 4 }}
|
|
||||||
spec:
|
|
||||||
type: {{ .Values.wellknowncustom.service.type }}
|
|
||||||
ports:
|
|
||||||
- port: {{ .Values.wellknowncustom.service.port }}
|
|
||||||
targetPort: http
|
|
||||||
protocol: TCP
|
|
||||||
name: http
|
|
||||||
selector:
|
|
||||||
{{- include "conduit.selectorLabels" . | nindent 4 }}
|
|
||||||
type: wellknowncustom
|
|
||||||
{{- end }}
|
|
|
@ -67,6 +67,9 @@ wellknown:
|
||||||
port: 8080
|
port: 8080
|
||||||
annotations: {}
|
annotations: {}
|
||||||
|
|
||||||
|
# if ingress is enabled: specifies whether ingress should redirect the `/`-Location to the wellknown server
|
||||||
|
rewriteRoot: true
|
||||||
|
|
||||||
# TO EDIT:
|
# TO EDIT:
|
||||||
server:
|
server:
|
||||||
"m.server": "your.server.name:443"
|
"m.server": "your.server.name:443"
|
||||||
|
@ -76,55 +79,26 @@ wellknown:
|
||||||
"org.matrix.msc3575.proxy":
|
"org.matrix.msc3575.proxy":
|
||||||
"url": "https://your.server.name/"
|
"url": "https://your.server.name/"
|
||||||
|
|
||||||
wellknowncustom:
|
# EDIT IF NEEDED
|
||||||
enabled: false
|
nginxServerConf: |-
|
||||||
image:
|
|
||||||
registry: docker.io
|
|
||||||
repository: library/nginx
|
|
||||||
pullPolicy: IfNotPresent
|
|
||||||
tag: "1.27.1"
|
|
||||||
|
|
||||||
replicaCount: 1
|
|
||||||
podLabels: {}
|
|
||||||
podAnnotations: []
|
|
||||||
podSecurityContext: {}
|
|
||||||
securityContext: {}
|
|
||||||
containerPort: 8080
|
|
||||||
env: []
|
|
||||||
resources: {}
|
|
||||||
nodeSelector: {}
|
|
||||||
tolerations: []
|
|
||||||
affinity: {}
|
|
||||||
|
|
||||||
service:
|
|
||||||
type: ClusterIP
|
|
||||||
port: 8080
|
|
||||||
annotations: {}
|
|
||||||
|
|
||||||
# TO EDIT:
|
|
||||||
nginx_conf: |
|
|
||||||
user nginx;
|
|
||||||
worker_processes 1;
|
|
||||||
events {
|
|
||||||
worker_connections 10240;
|
|
||||||
}
|
|
||||||
http {
|
|
||||||
server {
|
server {
|
||||||
listen 8080;
|
listen 8080;
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
|
|
||||||
location /.well-known/matrix/server {
|
location /.well-known/matrix/server {
|
||||||
return 200 '{"m.server": "your.server.name:443"}';
|
return 200 {{ toJson .server | quote }};
|
||||||
types { } default_type "application/json; charset=utf-8";
|
types { } default_type "application/json; charset=utf-8";
|
||||||
}
|
}
|
||||||
|
|
||||||
location /.well-known/matrix/client {
|
location /.well-known/matrix/client {
|
||||||
return 200 '{"m.homeserver": {"base_url": "https://your.server.name/"}, "org.matrix.msc3575.proxy": {"url": "https://your.server.name/"}}';
|
return 200 {{ toJson .client | quote }};
|
||||||
types { } default_type "application/json; charset=utf-8";
|
types { } default_type "application/json; charset=utf-8";
|
||||||
add_header "Access-Control-Allow-Origin" *;
|
add_header "Access-Control-Allow-Origin" *;
|
||||||
}
|
}
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
|
# return 200 'Welcome to the your.server.name conduit server!';
|
||||||
|
# types { } default_type "text/plain; charset=utf-8";
|
||||||
return 404;
|
return 404;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -133,7 +107,6 @@ wellknowncustom:
|
||||||
types { } default_type "text/plain; charset=utf-8";
|
types { } default_type "text/plain; charset=utf-8";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
podLabels: {}
|
podLabels: {}
|
||||||
podAnnotations: {}
|
podAnnotations: {}
|
||||||
|
|
Loading…
Add table
Reference in a new issue