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