| Giorgi Lekveishvili | 7c42760 | 2024-01-04 00:13:55 +0400 | [diff] [blame^] | 1 | #Input: { |
| 2 | network: #Network |
| 3 | subdomain: string |
| 4 | } |
| 5 | |
| 6 | input: #Input |
| 7 | |
| 8 | _domain: "\(input.subdomain).\(input.network.domain)" |
| 9 | |
| 10 | readme: "rpuppy application will be installed on \(input.network.name) network and be accessible to any user on https://\(_domain)" |
| 11 | |
| 12 | images: { |
| 13 | rpuppy: { |
| 14 | repository: "giolekva" |
| 15 | name: "rpuppy" |
| 16 | tag: "latest" |
| 17 | pullPolicy: "Always" |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | charts: { |
| 22 | rpuppy: { |
| 23 | source: { |
| 24 | kind: "GitRepository" |
| 25 | address: "pcloud" |
| 26 | } |
| 27 | chart: "./charts/rpuppy" |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | helm: { |
| 32 | rpuppy: { |
| 33 | chart: charts.rpuppy |
| 34 | values: { |
| 35 | ingressClassName: input.network.ingressClass |
| 36 | certificateIssuer: input.network.certificateIssuer |
| 37 | domain: _domain |
| 38 | image: { |
| 39 | repository: images.rpuppy.fullName |
| 40 | tag: images.rpuppy.tag |
| 41 | pullPolicy: images.rpuppy.pullPolicy |
| 42 | } |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | // TODO(gio): import |
| 48 | |
| 49 | #Network: { |
| 50 | name: string |
| 51 | ingressClass: string |
| 52 | certificateIssuer: string |
| 53 | domain: string |
| 54 | } |
| 55 | |
| 56 | #Image: { |
| 57 | registry: string | *"docker.io" |
| 58 | repository: string |
| 59 | name: string |
| 60 | tag: string |
| 61 | pullPolicy: string // TODO(gio): remove? |
| 62 | fullName: "\(registry)/\(repository)/\(name)" |
| 63 | fullNameWithTag: "\(fullName):\(tag)" |
| 64 | } |
| 65 | |
| 66 | #Global: { |
| 67 | id: string |
| 68 | } |
| 69 | |
| 70 | global: #Global |
| 71 | |
| 72 | images: { |
| 73 | for key, value in images { |
| 74 | "\(key)": #Image & value |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | #HelmRelease: { |
| 79 | _name: string |
| 80 | _chart: string |
| 81 | _values: _ |
| 82 | |
| 83 | apiVersion: "helm.toolkit.fluxcd.io/v2beta1" |
| 84 | kind: "HelmRelease" |
| 85 | metadata: { |
| 86 | name: _name |
| 87 | namespace: "{{ .Release.Namespace }}" |
| 88 | } |
| 89 | spec: { |
| 90 | interval: "1m0s" |
| 91 | chart: { |
| 92 | spec: { |
| 93 | chart: _chart |
| 94 | sourceRef: { |
| 95 | kind: "HelmRepository" |
| 96 | name: "pcloud" |
| 97 | namespace: global.id |
| 98 | } |
| 99 | } |
| 100 | } |
| 101 | values: _values |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | output: [ |
| 106 | for name, r in helm { |
| 107 | #HelmRelease & { |
| 108 | _name: name |
| 109 | _chart: "rpuppy" |
| 110 | _values: r.values |
| 111 | } |
| 112 | } |
| 113 | ] |