blob: b9d21bc92ddffd3e71690ad49f82a02ad19546a1 [file] [log] [blame]
Giorgi Lekveishvili7c427602024-01-04 00:13:55 +04001#Input: {
2 network: #Network
3 subdomain: string
4}
5
6input: #Input
7
8_domain: "\(input.subdomain).\(input.network.domain)"
9
10readme: "rpuppy application will be installed on \(input.network.name) network and be accessible to any user on https://\(_domain)"
11
12images: {
13 rpuppy: {
14 repository: "giolekva"
15 name: "rpuppy"
16 tag: "latest"
17 pullPolicy: "Always"
18 }
19}
20
21charts: {
22 rpuppy: {
Giorgi Lekveishvili9b52ab92024-01-05 13:12:48 +040023 chart: "charts/rpuppy"
24 sourceRef: {
Giorgi Lekveishvili7c427602024-01-04 00:13:55 +040025 kind: "GitRepository"
Giorgi Lekveishvili9b52ab92024-01-05 13:12:48 +040026 name: "pcloud"
27 namespace: global.id
Giorgi Lekveishvili7c427602024-01-04 00:13:55 +040028 }
Giorgi Lekveishvili7c427602024-01-04 00:13:55 +040029 }
30}
31
32helm: {
33 rpuppy: {
34 chart: charts.rpuppy
35 values: {
36 ingressClassName: input.network.ingressClass
37 certificateIssuer: input.network.certificateIssuer
38 domain: _domain
39 image: {
40 repository: images.rpuppy.fullName
41 tag: images.rpuppy.tag
42 pullPolicy: images.rpuppy.pullPolicy
43 }
44 }
45 }
46}
47
48// TODO(gio): import
49
50#Network: {
51 name: string
52 ingressClass: string
53 certificateIssuer: string
54 domain: string
55}
56
57#Image: {
58 registry: string | *"docker.io"
59 repository: string
60 name: string
61 tag: string
62 pullPolicy: string // TODO(gio): remove?
63 fullName: "\(registry)/\(repository)/\(name)"
64 fullNameWithTag: "\(fullName):\(tag)"
65}
66
Giorgi Lekveishvili9b52ab92024-01-05 13:12:48 +040067#Chart: {
68 chart: string
69 sourceRef: #SourceRef
70}
71
72#SourceRef: {
73 kind: "GitRepository" | "HelmRepository"
74 name: string
75 namespace: string // TODO(gio): default global.id
76}
77
Giorgi Lekveishvili7c427602024-01-04 00:13:55 +040078#Global: {
79 id: string
Giorgi Lekveishvili9b52ab92024-01-05 13:12:48 +040080 ...
81}
82
83#Release: {
84 namespace: string
Giorgi Lekveishvili7c427602024-01-04 00:13:55 +040085}
86
87global: #Global
Giorgi Lekveishvili9b52ab92024-01-05 13:12:48 +040088release: #Release
Giorgi Lekveishvili7c427602024-01-04 00:13:55 +040089
90images: {
91 for key, value in images {
92 "\(key)": #Image & value
93 }
94}
95
Giorgi Lekveishvili9b52ab92024-01-05 13:12:48 +040096charts: {
97 for key, value in charts {
98 "\(key)": #Chart & value
99 }
100}
101
Giorgi Lekveishvili7c427602024-01-04 00:13:55 +0400102#HelmRelease: {
103 _name: string
Giorgi Lekveishvili9b52ab92024-01-05 13:12:48 +0400104 _chart: #Chart
Giorgi Lekveishvili7c427602024-01-04 00:13:55 +0400105 _values: _
106
107 apiVersion: "helm.toolkit.fluxcd.io/v2beta1"
108 kind: "HelmRelease"
109 metadata: {
110 name: _name
Giorgi Lekveishvili9b52ab92024-01-05 13:12:48 +0400111 namespace: release.namespace
Giorgi Lekveishvili7c427602024-01-04 00:13:55 +0400112 }
113 spec: {
114 interval: "1m0s"
115 chart: {
Giorgi Lekveishvili9b52ab92024-01-05 13:12:48 +0400116 spec: _chart
Giorgi Lekveishvili7c427602024-01-04 00:13:55 +0400117 }
118 values: _values
119 }
120}
121
Giorgi Lekveishvili9b52ab92024-01-05 13:12:48 +0400122output: {
Giorgi Lekveishvili7c427602024-01-04 00:13:55 +0400123 for name, r in helm {
Giorgi Lekveishvili9b52ab92024-01-05 13:12:48 +0400124 "\(name)": #HelmRelease & {
Giorgi Lekveishvili7c427602024-01-04 00:13:55 +0400125 _name: name
Giorgi Lekveishvili9b52ab92024-01-05 13:12:48 +0400126 _chart: r.chart
Giorgi Lekveishvili7c427602024-01-04 00:13:55 +0400127 _values: r.values
128 }
129 }
Giorgi Lekveishvili9b52ab92024-01-05 13:12:48 +0400130}