blob: cd235cdadf6efac90f6fe887470796166fe68452 [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 }}
giolekva95340e82021-11-08 21:36:55 +040022spec:
23 ingressClassName: {{ .Values.ingressClassName }}
24 tls:
25 - hosts:
26 - {{ .Values.domain }}
giolekva11881b52021-11-27 16:51:58 +040027 secretName: cert-www.{{ .Values.domain }}
giolekva95340e82021-11-08 21:36:55 +040028 - hosts:
29 - www.{{ .Values.domain }}
30 secretName: cert-www.{{ .Values.domain }}
31 rules:
32 - host: {{ .Values.domain }}
33 http:
34 paths:
35 - path: /
36 pathType: Prefix
37 backend:
38 service:
39 name: well-known
40 port:
41 name: http
42 - host: www.{{ .Values.domain }}
43 http:
44 paths:
45 - path: /
46 pathType: Prefix
47 backend:
48 service:
49 name: well-known
50 port:
51 name: http
52---
53apiVersion: v1
54kind: ConfigMap
55metadata:
56 name: well-known
57 namespace: {{ .Release.Namespace }}
58data:
59 nginx.conf: |
60 # user www www;
61 worker_processes 1;
62 error_log /dev/null crit;
63 # pid logs/nginx.pid;
64 worker_rlimit_nofile 8192;
65 events {
66 worker_connections 1024;
67 }
68 http {
69 server {
70 listen 8080;
71 location /.well-known/matrix/client {
72 return 200 '{"m.homeserver": {"base_url": "https://matrix.{{ .Values.domain }}:443"}}';
73 default_type application/json;
74 add_header Access-Control-Allow-Origin *;
75 }
76 location /.well-known/matrix/server {
77 return 200 '{"m.server": "matrix.{{ .Values.domain }}:443"}';
78 default_type application/json;
79 add_header Access-Control-Allow-Origin *;
80 }
81 }
82 }
83---
84apiVersion: apps/v1
85kind: Deployment
86metadata:
87 name: well-known
88 namespace: {{ .Release.Namespace }}
89spec:
90 selector:
91 matchLabels:
92 app: well-known
93 replicas: 1
94 template:
95 metadata:
96 labels:
97 app: well-known
98 spec:
99 volumes:
100 - name: config
101 configMap:
102 name: well-known
103 containers:
104 - name: nginx
105 image: nginx:1.21.3-alpine
106 imagePullPolicy: IfNotPresent
107 ports:
108 - name: http
109 containerPort: 8080
110 protocol: TCP
111 volumeMounts:
112 - name: config
113 mountPath: /etc/nginx
114 readOnly: true
115 resources:
116 requests:
117 memory: "10Mi"
118 cpu: "10m"
119 limits:
120 memory: "20Mi"
121 cpu: "100m"
122 tolerations:
123 - key: "pcloud"
124 operator: "Equal"
125 value: "role"
126 effect: "NoSchedule"