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