| giolekva | 95340e8 | 2021-11-08 21:36:55 +0400 | [diff] [blame] | 1 | --- |
| 2 | apiVersion: v1 |
| 3 | kind: Service |
| 4 | metadata: |
| 5 | name: well-known |
| 6 | namespace: {{ .Release.Namespace }} |
| 7 | spec: |
| 8 | type: ClusterIP |
| 9 | selector: |
| 10 | app: well-known |
| 11 | ports: |
| 12 | - name: http |
| 13 | port: 80 |
| 14 | targetPort: http |
| 15 | protocol: TCP |
| 16 | --- |
| 17 | apiVersion: networking.k8s.io/v1 |
| 18 | kind: Ingress |
| 19 | metadata: |
| 20 | name: well-known |
| 21 | namespace: {{ .Release.Namespace }} |
| giolekva | 95340e8 | 2021-11-08 21:36:55 +0400 | [diff] [blame] | 22 | spec: |
| 23 | ingressClassName: {{ .Values.ingressClassName }} |
| 24 | tls: |
| 25 | - hosts: |
| 26 | - {{ .Values.domain }} |
| giolekva | 11881b5 | 2021-11-27 16:51:58 +0400 | [diff] [blame] | 27 | secretName: cert-www.{{ .Values.domain }} |
| giolekva | 95340e8 | 2021-11-08 21:36:55 +0400 | [diff] [blame] | 28 | - 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 | --- |
| 53 | apiVersion: v1 |
| 54 | kind: ConfigMap |
| 55 | metadata: |
| 56 | name: well-known |
| 57 | namespace: {{ .Release.Namespace }} |
| 58 | data: |
| 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 | --- |
| 84 | apiVersion: apps/v1 |
| 85 | kind: Deployment |
| 86 | metadata: |
| 87 | name: well-known |
| 88 | namespace: {{ .Release.Namespace }} |
| 89 | spec: |
| 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" |