blob: 33e4b940115e09559dde2be9aa3e0f585b5cc2b0 [file] [log] [blame]
giolekva95340e82021-11-08 21:36:55 +04001---
2apiVersion: v1
3kind: Service
4metadata:
5 name: well-known
6 namespace: {{ .Release.Namespace }}
7spec:
8 type: ClusterIP
9 selector:
10 app: well-known
11 ports:
12 - name: http
13 port: 80
14 targetPort: http
15 protocol: TCP
16---
17apiVersion: networking.k8s.io/v1
18kind: Ingress
19metadata:
20 name: well-known
21 namespace: {{ .Release.Namespace }}
Giorgi Lekveishvili6d7dcb82023-12-20 14:44:42 +040022 {{- if .Values.certificateIssuer }}
23 annotations:
24 acme.cert-manager.io/http01-edit-in-place: "true"
25 cert-manager.io/cluster-issuer: {{ .Values.certificateIssuer }}
26 {{- end }}
giolekva95340e82021-11-08 21:36:55 +040027spec:
28 ingressClassName: {{ .Values.ingressClassName }}
29 tls:
30 - hosts:
31 - {{ .Values.domain }}
Giorgi Lekveishvilibae31352023-12-21 07:48:05 +040032 secretName: cert-{{ .Values.domain }}
giolekva95340e82021-11-08 21:36:55 +040033 rules:
34 - host: {{ .Values.domain }}
35 http:
36 paths:
Giorgi Lekveishvilibae31352023-12-21 07:48:05 +040037 - path: /.well-known/matrix
38 pathType: ImplementationSpecific
giolekva95340e82021-11-08 21:36:55 +040039 backend:
40 service:
41 name: well-known
42 port:
43 name: http
44---
45apiVersion: v1
46kind: ConfigMap
47metadata:
48 name: well-known
49 namespace: {{ .Release.Namespace }}
50data:
51 nginx.conf: |
52 # user www www;
53 worker_processes 1;
54 error_log /dev/null crit;
55 # pid logs/nginx.pid;
56 worker_rlimit_nofile 8192;
57 events {
58 worker_connections 1024;
59 }
60 http {
61 server {
62 listen 8080;
63 location /.well-known/matrix/client {
Giorgi Lekveishvilibae31352023-12-21 07:48:05 +040064 return 200 '{"m.homeserver": {"base_url": "https://{{ .Values.subdomain }}.{{ .Values.domain }}"}}';
giolekva95340e82021-11-08 21:36:55 +040065 default_type application/json;
66 add_header Access-Control-Allow-Origin *;
67 }
68 location /.well-known/matrix/server {
gioeabb4a22024-04-13 09:16:52 +040069 return 200 '{"m.server": "{{ .Values.subdomain }}.{{ .Values.domain }}:443"}';
giolekva95340e82021-11-08 21:36:55 +040070 default_type application/json;
71 add_header Access-Control-Allow-Origin *;
72 }
73 }
74 }
75---
76apiVersion: apps/v1
77kind: Deployment
78metadata:
79 name: well-known
80 namespace: {{ .Release.Namespace }}
81spec:
82 selector:
83 matchLabels:
84 app: well-known
85 replicas: 1
86 template:
87 metadata:
88 labels:
89 app: well-known
90 spec:
91 volumes:
92 - name: config
93 configMap:
94 name: well-known
95 containers:
96 - name: nginx
97 image: nginx:1.21.3-alpine
98 imagePullPolicy: IfNotPresent
99 ports:
100 - name: http
101 containerPort: 8080
102 protocol: TCP
103 volumeMounts:
104 - name: config
105 mountPath: /etc/nginx
106 readOnly: true
107 resources:
108 requests:
109 memory: "10Mi"
110 cpu: "10m"
111 limits:
112 memory: "20Mi"
113 cpu: "100m"
114 tolerations:
115 - key: "pcloud"
116 operator: "Equal"
117 value: "role"
118 effect: "NoSchedule"