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