| giolekva | 13c3ffc | 2021-09-25 17:25:26 +0400 | [diff] [blame^] | 1 | # --- |
| 2 | # apiVersion: v1 |
| 3 | # kind: Namespace |
| 4 | # metadata: |
| 5 | # name: app-matrix |
| 6 | --- |
| 7 | apiVersion: v1 |
| 8 | kind: Service |
| 9 | metadata: |
| 10 | name: matrix |
| 11 | namespace: app-matrix |
| 12 | spec: |
| 13 | type: ClusterIP |
| 14 | selector: |
| 15 | app: matrix |
| 16 | ports: |
| 17 | - name: http |
| 18 | port: 80 |
| 19 | targetPort: http |
| 20 | protocol: TCP |
| 21 | --- |
| 22 | apiVersion: networking.k8s.io/v1 |
| 23 | kind: Ingress |
| 24 | metadata: |
| 25 | name: ingress |
| 26 | namespace: app-matrix |
| 27 | # annotations: |
| 28 | # cert-manager.io/cluster-issuer: "letsencrypt-prod" |
| 29 | # acme.cert-manager.io/http01-edit-in-place: "true" |
| 30 | spec: |
| 31 | ingressClassName: nginx |
| 32 | tls: |
| 33 | - hosts: |
| 34 | - matrix.lekva.me |
| 35 | # secretName: cert-matrix.lekva.me |
| 36 | secretName: cert-wildcard.lekva.me |
| 37 | rules: |
| 38 | - host: matrix.lekva.me |
| 39 | http: |
| 40 | paths: |
| 41 | - path: / |
| 42 | pathType: Prefix |
| 43 | backend: |
| 44 | service: |
| 45 | name: matrix |
| 46 | port: |
| 47 | name: http |
| 48 | --- |
| 49 | apiVersion: apps/v1 |
| 50 | kind: Deployment |
| 51 | metadata: |
| 52 | name: matrix |
| 53 | namespace: app-matrix |
| 54 | spec: |
| 55 | selector: |
| 56 | matchLabels: |
| 57 | app: matrix |
| 58 | replicas: 1 |
| 59 | template: |
| 60 | metadata: |
| 61 | labels: |
| 62 | app: matrix |
| 63 | spec: |
| 64 | volumes: |
| 65 | - name: data |
| 66 | persistentVolumeClaim: |
| 67 | claimName: matrix-data |
| 68 | containers: |
| 69 | - name: matrix |
| 70 | image: matrixdotorg/synapse:v1.43.0 |
| 71 | imagePullPolicy: IfNotPresent |
| 72 | ports: |
| 73 | - name: http |
| 74 | containerPort: 8008 |
| 75 | protocol: TCP |
| 76 | env: |
| 77 | - name: SYNAPSE_SERVER_NAME |
| 78 | value: "lekva.me" |
| 79 | - name: SYNAPSE_REPORT_STATS |
| 80 | value: "no" |
| 81 | - name: SYNAPSE_CONFIG_DIR |
| 82 | value: "/data" |
| 83 | - name: SYNAPSE_DATA_DIR |
| 84 | value: "/data" |
| 85 | # - name: SYNAPSE_CONFIG_PATH |
| 86 | # value: "/etc/matrix/homeserver.yaml" |
| 87 | command: ["/start.py"] |
| 88 | # args: ["generate"] |
| 89 | volumeMounts: |
| 90 | - name: data |
| 91 | mountPath: /data |
| 92 | --- |
| 93 | apiVersion: v1 |
| 94 | kind: PersistentVolumeClaim |
| 95 | metadata: |
| 96 | name: matrix-data |
| 97 | namespace: app-matrix |
| 98 | spec: |
| 99 | accessModes: |
| 100 | - ReadWriteOnce |
| 101 | resources: |
| 102 | requests: |
| 103 | storage: 100Gi |