| Giorgi Lekveishvili | e009a5d | 2024-01-05 14:10:11 +0400 | [diff] [blame] | 1 | input: { |
| 2 | network: #Network |
| 3 | subdomain: string |
| 4 | } |
| 5 | |
| 6 | _domain: "\(input.subdomain).\(input.network.domain)" |
| 7 | |
| 8 | readme: "matrix application will be installed on \(input.network.name) network and be accessible to any user on https://\(_domain)" |
| 9 | |
| 10 | images: { |
| 11 | matrix: { |
| 12 | repository: "matrixdotorg" |
| 13 | name: "synapse" |
| 14 | tag: "latest" |
| 15 | pullPolicy: "IfNotPresent" |
| 16 | } |
| 17 | postgres: { |
| 18 | repository: "library" |
| 19 | name: "postgres" |
| 20 | tag: "15.3" |
| 21 | pullPolicy: "IfNotPresent" |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | charts: { |
| 26 | matrix: { |
| 27 | chart: "charts/matrix" |
| 28 | sourceRef: { |
| 29 | kind: "GitRepository" |
| 30 | name: "pcloud" |
| 31 | namespace: global.id |
| 32 | } |
| 33 | } |
| 34 | postgres: { |
| 35 | chart: "charts/postgresql" |
| 36 | sourceRef: { |
| 37 | kind: "GitRepository" |
| 38 | name: "pcloud" |
| 39 | namespace: global.id |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | helm: { |
| 45 | matrix: { |
| 46 | dependsOn: [ |
| 47 | postgres |
| 48 | ] |
| 49 | chart: charts.matrix |
| 50 | values: { |
| 51 | domain: global.domain |
| 52 | subdomain: input.subdomain |
| 53 | oauth2: { |
| 54 | hydraAdmin: "http://hydra-admin.\(global.namespacePrefix)core-auth.svc.cluster.local" |
| 55 | hydraPublic: "https://hydra.\(global.domain)" |
| 56 | secretName: "oauth2-client" |
| 57 | } |
| 58 | postgresql: { |
| 59 | host: "postgres" |
| 60 | port: 5432 |
| 61 | database: "matrix" |
| 62 | user: "matrix" |
| 63 | password: "matrix" |
| 64 | } |
| 65 | certificateIssuer: _issuerPublic |
| 66 | ingressClassName: _ingressPublic |
| 67 | configMerge: { |
| 68 | configName: "config-to-merge" |
| 69 | fileName: "to-merge.yaml" |
| 70 | } |
| 71 | image: { |
| 72 | repository: images.matrix.fullName |
| 73 | tag: images.matrix.tag |
| 74 | pullPolicy: images.matrix.pullPolicy |
| 75 | } |
| 76 | } |
| 77 | } |
| 78 | postgres: { |
| 79 | chart: charts.postgres |
| 80 | values: { |
| 81 | fullnameOverride: "postgres" |
| 82 | image: { |
| 83 | registry: images.postgres.registry |
| 84 | repository: images.postgres.imageName |
| 85 | tag: images.postgres.tag |
| 86 | pullPolicy: images.postgres.pullPolicy |
| 87 | } |
| 88 | service: { |
| 89 | type: "ClusterIP" |
| 90 | port: 5432 |
| 91 | } |
| 92 | primary: { |
| 93 | initdb: { |
| 94 | scripts: { |
| 95 | "init.sql": """ |
| 96 | CREATE USER matrix WITH PASSWORD 'matrix'; |
| 97 | CREATE DATABASE matrix WITH OWNER = matrix ENCODING = UTF8 LOCALE = 'C' TEMPLATE = template0; |
| 98 | """ |
| 99 | } |
| 100 | } |
| 101 | persistence: { |
| 102 | size: "10Gi" |
| 103 | } |
| 104 | securityContext: { |
| 105 | enabled: true |
| 106 | fsGroup: 0 |
| 107 | } |
| 108 | containerSecurityContext: { |
| 109 | enabled: true |
| 110 | runAsUser: 0 |
| 111 | } |
| 112 | } |
| 113 | volumePermissions: { |
| 114 | securityContext: { |
| 115 | runAsUser: 0 |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | } |