|
1 |
| -#namespace defaults |
2 |
| -{{ $_ := set .Values "_defaults" ( `{"flavor":"mainnet","mainnet":{"targetNamespace":"arbitrum-one-mainnet","scaling":{"deployments":1},"features":["proxyd","arbitrum_classic","arbitrum_nitro"]},"common":{"scaling":{"deployments":1}},"sepolia":{"targetNamespace":"arbitrum-one-sepolia","scaling":{"deployments":1},"features":["proxyd","arbitrum_nitro"]}}` | fromJson ) }} |
3 |
| -#set default flavor when missing |
4 |
| -{{ if not ( hasKey .Values "flavor" ) }} |
5 |
| -{{ $_ := set .Values "flavor" "mainnet" }} |
6 |
| -{{ end }} |
7 |
| - |
8 |
| -environments: |
9 |
| - {{ .Environment.Name }}: |
10 |
| - values: |
11 |
| - - flavor: {{ .Values.flavor }} |
12 |
| - - _defaults: {{ .Values._defaults | toYaml | nindent 10 }} |
13 |
| - |
14 |
| ---- |
15 |
| -# Define default features when undefined |
16 |
| -{{ if not (hasKey .Values "features") }} |
17 |
| -{{ $_ := set .Values "features" ( .Values._defaults | get .Values.flavor | get "features" ) }} |
18 |
| -{{ end }} |
19 |
| - |
20 |
| -#set default number of deployments when missing |
21 |
| -{{ if not ( hasKey .Values "scaling" ) }} |
22 |
| -{{ $_ := set .Values "scaling" dict }} |
23 |
| -{{ end }} |
24 |
| -{{ if not ( hasKey ( .Values | get "scaling" dict ) "deployments" ) }} |
25 |
| -{{ $_ := set .Values.scaling "deployments" ( .Values._defaults | get .Values.flavor | get "scaling" | get "deployments" ) }} |
26 |
| -{{ end }} |
27 |
| - |
28 |
| -environments: |
29 |
| - {{ .Environment.Name }}: |
30 |
| - values: |
31 |
| - - features: {{ .Values.features | toYaml | nindent 10 }} |
32 |
| - - scaling: |
33 |
| - deployments: {{ .Values.scaling.deployments }} |
34 |
| - |
35 |
| ---- |
36 |
| -{{- $_tplTransforms := (print ` |
37 |
| -{{- $_TemplatedResources := list "Deployment" "StatefulSet" "DaemonSet" -}} |
38 |
| -{{- $_labels := .resourceLabels }} |
39 |
| -{{- $_annotations := merge ( .Values | get .release dict | get "annotations" dict ) ( .Values | get .canonicalRelease dict | get "annotations" dict ) ( .Values | get "annotations" dict ) }} |
40 |
| -transformers: |
41 |
| -- apiVersion: builtin |
42 |
| - kind: AnnotationsTransformer |
43 |
| - metadata: |
44 |
| - name: AddAnnotations |
45 |
| - annotations: |
46 |
| -{{- $_annotations | toYaml | nindent 4 }} |
47 |
| - fieldSpecs: |
48 |
| - - path: metadata/annotations |
49 |
| - create: true |
50 |
| -{{- range $kind := $_TemplatedResources }} |
51 |
| - - kind: {{ $kind }} |
52 |
| - path: spec/template/metadata/annotations |
53 |
| - create: true |
54 |
| -{{- end }} |
55 |
| -- apiVersion: builtin |
56 |
| - kind: LabelTransformer |
57 |
| - metadata: |
58 |
| - name: AddLabels |
59 |
| - labels: |
60 |
| -{{- $_labels | toYaml | nindent 4 }} |
61 |
| - fieldSpecs: |
62 |
| - - path: metadata/labels |
63 |
| - create: true |
64 |
| -{{- range $kind := $_TemplatedResources }} |
65 |
| - - kind: {{ $kind }} |
66 |
| - path: spec/template/metadata/labels |
67 |
| - create: true |
68 |
| -{{- end }} |
69 |
| -`) -}} |
70 |
| -{{- $_tplReleaseValues := (print ` |
71 |
| -{{- if ( .Values | get .release dict | get "mergeValues" true ) -}} |
72 |
| -{{- if ( hasKey .Values "flavor" ) }} |
73 |
| -- ./values/_common/{{ .canonicalRelease }}.yaml |
74 |
| -- ./values/_common/{{ .canonicalRelease }}.yaml.gotmpl |
75 |
| -- ./values/{{ .Values.flavor }}/{{ .canonicalRelease }}.yaml |
76 |
| -- ./values/{{ .Values.flavor }}/{{ .canonicalRelease }}.yaml.gotmpl |
77 |
| -{{- else }} |
78 |
| -- ./values/{{ .canonicalRelease }}.yaml |
79 |
| -- ./values/{{ .canonicalRelease }}.yaml.gotmpl |
80 |
| -{{- end -}} |
81 |
| -{{- if typeIs ( typeOf list ) ( .Values | get .canonicalRelease dict | get "values" dict ) -}} |
82 |
| - {{- range $element := ( .Values | get .canonicalRelease dict | get "values" dict ) }} |
83 |
| -- {{- $element | toYaml | nindent 2 }} |
84 |
| - {{- end -}} |
85 |
| -{{- else }} |
86 |
| -- {{- .Values | get .canonicalRelease dict | get "values" dict | toYaml | nindent 2 }} |
87 |
| -{{- end -}} |
88 |
| -{{- end -}} |
89 |
| -{{- if typeIs ( typeOf list ) ( .Values | get .release dict | get "values" dict ) -}} |
90 |
| - {{- range $element := ( .Values | get .release dict | get "values" dict ) }} |
91 |
| -- {{- $element | toYaml | nindent 2 }} |
92 |
| - {{- end -}} |
93 |
| -{{- else }} |
94 |
| -- {{- .Values | get .release dict | get "values" dict | toYaml | nindent 2 }} |
95 |
| -{{- end -}} |
96 |
| -`) -}} |
97 |
| -{{ $__helmDefaults := `{"recreatePods":true}` | fromJson }} |
98 |
| - |
99 |
| -{{ with ( .Values | get "helmDefaults" dict ) }} |
100 |
| -{{ $_ := (deepCopy . | mergeOverwrite $__helmDefaults) }} |
101 |
| -{{ end }} |
102 |
| - |
103 |
| -helmDefaults: |
104 |
| -{{ $__helmDefaults | toYaml | indent 2 }} |
105 |
| - |
106 |
| -{{ if ( hasKey .Values "kubeVersion" ) }} |
107 |
| -kubeVersion: {{ .Values.kubeVersion }} |
108 |
| -{{ end }} |
109 |
| - |
110 |
| -#set default namespace |
111 |
| -{{ $_defaultNamespace := .Values._defaults | get .Values.flavor | get "targetNamespace" }} |
112 |
| - |
113 |
| -{{- $_templatedValue_0 := .Values.flavor }} |
114 |
| -{{- $_commonLabels := dict |
115 |
| -`launchpad.graphops.xyz/namespace` `arbitrum-one` |
116 |
| -`app.launchpad.graphops.xyz/type` `blockchain` |
117 |
| -`app.launchpad.graphops.xyz/chain` `arbitrum-one` |
118 |
| -`app.launchpad.graphops.xyz/network` $_templatedValue_0 |
119 |
| -}} |
120 |
| - |
121 |
| -{{- $_commonResourceLabels := dict |
122 |
| - |
123 |
| -}} |
124 |
| -{{ $_ := mergeOverwrite $_commonResourceLabels $_commonLabels }} |
125 |
| -{{- if hasKey .Values "labels" }} |
126 |
| -{{- range $key, $value := $.Values.labels }} |
127 |
| -{{- $_ := set $_commonLabels $key $value }} |
128 |
| -{{- $_ := set $_commonResourceLabels $key $value }} |
129 |
| -{{- end }} |
130 |
| -{{- end }} |
131 |
| -{{- if hasKey .Values "resourceLabels" }} |
132 |
| -{{- range $key, $value := $.Values.resourceLabels }} |
133 |
| -{{- $_ := set $_commonResourceLabels $key $value }} |
134 |
| -{{- end }} |
135 |
| -{{- end }} |
136 |
| -commonLabels: |
137 |
| -{{- range $key, $value := $_commonLabels }} |
138 |
| - {{ $key }}: {{ $value }} |
139 |
| -{{- end }} |
140 |
| -repositories: |
141 |
| - - name: graphops |
142 |
| - url: https://graphops.github.io/launchpad-charts/canary |
143 |
| - |
144 |
| -templates: |
145 |
| - defaults: |
146 |
| - namespace: '{{ .Values | get "targetNamespace" $_defaultNamespace }}' |
147 |
| - missingFileHandler: Warn |
148 |
| - |
149 |
| - arbitrum-nitro: |
150 |
| - {{- if ( .Values | get "arbitrum-nitro" dict | get "chartUrl" false ) }} |
151 |
| - chart: {{ .Values | get "arbitrum-nitro" | get "chartUrl" }} |
152 |
| - {{- else }} |
153 |
| - chart: "graphops/arbitrum-nitro" |
154 |
| - {{- end }} |
155 |
| - inherit: |
156 |
| - - template: "defaults" |
157 |
| - {{- if ( .Values | get "arbitrum-nitro" dict | get "chartVersion" false ) }} |
158 |
| - version: {{ .Values | get "arbitrum-nitro" | get "chartVersion" }} |
159 |
| - {{- end }} |
160 |
| - {{- if (not (or ( .Values | get "arbitrum-nitro" dict | get "chartVersion" false ) ( .Values | get "arbitrum-nitro" dict | get "chartUrl" false ) )) }} |
161 |
| - version: "0.2.5-canary.2" |
162 |
| - {{- end }} |
163 |
| - |
164 |
| - arbitrum-classic: |
165 |
| - {{- if ( .Values | get "arbitrum-classic" dict | get "chartUrl" false ) }} |
166 |
| - chart: {{ .Values | get "arbitrum-classic" | get "chartUrl" }} |
167 |
| - {{- else }} |
168 |
| - chart: "graphops/arbitrum-classic" |
169 |
| - {{- end }} |
170 |
| - inherit: |
171 |
| - - template: "defaults" |
172 |
| - {{- if ( .Values | get "arbitrum-classic" dict | get "chartVersion" false ) }} |
173 |
| - version: {{ .Values | get "arbitrum-classic" | get "chartVersion" }} |
174 |
| - {{- end }} |
175 |
| - {{- if (not (or ( .Values | get "arbitrum-classic" dict | get "chartVersion" false ) ( .Values | get "arbitrum-classic" dict | get "chartUrl" false ) )) }} |
176 |
| - version: "0.2.0" |
177 |
| - {{- end }} |
178 |
| - |
179 |
| - proxyd: |
180 |
| - {{- if ( .Values | get "proxyd" dict | get "chartUrl" false ) }} |
181 |
| - chart: {{ .Values | get "proxyd" | get "chartUrl" }} |
182 |
| - {{- else }} |
183 |
| - chart: "graphops/proxyd" |
184 |
| - {{- end }} |
185 |
| - inherit: |
186 |
| - - template: "defaults" |
187 |
| - {{- if ( .Values | get "proxyd" dict | get "chartVersion" false ) }} |
188 |
| - version: {{ .Values | get "proxyd" | get "chartVersion" }} |
189 |
| - {{- end }} |
190 |
| - {{- if (not (or ( .Values | get "proxyd" dict | get "chartVersion" false ) ( .Values | get "proxyd" dict | get "chartUrl" false ) )) }} |
191 |
| - version: "0.5.1-canary.2" |
192 |
| - {{- end }} |
193 |
| - |
194 |
| -releases: |
195 |
| - {{ if has "arbitrum_nitro" ( .Values | get "features" list ) }} |
196 |
| - {{- $canonicalRelease := "arbitrum-nitro" }} |
197 |
| - {{- range $index := until .Values.scaling.deployments }} |
198 |
| - {{- $deploymentIndex := (add . 1) }} |
199 |
| - {{- $release := (printf "%s%v" "arbitrum-nitro-" $deploymentIndex) }} |
200 |
| - {{- $_templatedValue_0 := $canonicalRelease }} |
201 |
| - {{- $_templatedValue_1 := $release }} |
202 |
| - {{- $_templatedValue_2 := $deploymentIndex }} |
203 |
| - {{- $_releaseResourceLabels := dict |
204 |
| - `app.launchpad.graphops.xyz/layer` `execution` |
205 |
| - `app.launchpad.graphops.xyz/component` $_templatedValue_0 |
206 |
| - `app.launchpad.graphops.xyz/release` $_templatedValue_1 |
207 |
| - `app.launchpad.graphops.xyz/scalingIndex` $_templatedValue_2 |
208 |
| - }} |
209 |
| - {{- $_releaseResourceLabels = mergeOverwrite $_commonLabels $_commonResourceLabels $_releaseResourceLabels }} |
210 |
| - - name: "{{ $release }}" |
211 |
| - inherit: |
212 |
| - - template: "{{ $canonicalRelease }}" |
213 |
| - labels: |
214 |
| - app.launchpad.graphops.xyz/layer: execution |
215 |
| - app.launchpad.graphops.xyz/release: '{{ $release }}' |
216 |
| - app.launchpad.graphops.xyz/component: '{{ $canonicalRelease }}' |
217 |
| - app.launchpad.graphops.xyz/scalingIndex: '{{ $deploymentIndex }}' |
218 |
| - |
219 |
| - {{- range $key,$value := ( $.Values | get $canonicalRelease dict | get "labels" dict ) }} |
220 |
| - {{ $key }}: {{ $value }} |
221 |
| - {{- $_ := set $_releaseResourceLabels $key $value }} |
222 |
| - {{- end }} |
223 |
| - {{- if (ne $release $canonicalRelease) }} |
224 |
| - {{- range $key,$value := ( $.Values | get $release dict | get "labels" dict ) }} |
225 |
| - {{ $key }}: {{ $value }} |
226 |
| - {{- $_ := set $_releaseResourceLabels $key $value }} |
227 |
| - {{- end }} |
228 |
| - {{- end }} |
229 |
| - {{- range $key,$value := ( $.Values | get $canonicalRelease dict | get "resourceLabels" dict ) }} |
230 |
| - {{- $_ := set $_releaseResourceLabels $key $value }} |
231 |
| - {{- end }} |
232 |
| - {{- if (ne $release $canonicalRelease) }} |
233 |
| - {{- range $key,$value := ( $.Values | get $release dict | get "resourceLabels" dict ) }} |
234 |
| - {{- $_ := set $_releaseResourceLabels $key $value }} |
235 |
| - {{- end }} |
236 |
| - {{- end }} |
237 |
| - {{- tpl $_tplTransforms (dict "Values" $.Values "release" $release "canonicalRelease" $canonicalRelease "resourceLabels" $_releaseResourceLabels ) | indent 4 -}} |
238 |
| - values: |
239 |
| - {{- tpl $_tplReleaseValues (dict "Values" $.Values "canonicalRelease" $canonicalRelease "release" $release) | indent 4 -}} |
240 |
| - {{- end -}} |
241 |
| - {{- end -}} |
242 |
| - {{ if has "arbitrum_classic" ( .Values | get "features" list ) }} |
243 |
| - {{- $canonicalRelease := "arbitrum-classic" }} |
244 |
| - {{- range $index := until .Values.scaling.deployments }} |
245 |
| - {{- $deploymentIndex := (add . 1) }} |
246 |
| - {{- $release := (printf "%s%v" "arbitrum-classic-" $deploymentIndex) }} |
247 |
| - {{- $_templatedValue_0 := $canonicalRelease }} |
248 |
| - {{- $_templatedValue_1 := $release }} |
249 |
| - {{- $_templatedValue_2 := $deploymentIndex }} |
250 |
| - {{- $_releaseResourceLabels := dict |
251 |
| - `app.launchpad.graphops.xyz/layer` `execution` |
252 |
| - `app.launchpad.graphops.xyz/component` $_templatedValue_0 |
253 |
| - `app.launchpad.graphops.xyz/release` $_templatedValue_1 |
254 |
| - `app.launchpad.graphops.xyz/scalingIndex` $_templatedValue_2 |
255 |
| - }} |
256 |
| - {{- $_releaseResourceLabels = mergeOverwrite $_commonLabels $_commonResourceLabels $_releaseResourceLabels }} |
257 |
| - - name: "{{ $release }}" |
258 |
| - inherit: |
259 |
| - - template: "{{ $canonicalRelease }}" |
260 |
| - labels: |
261 |
| - app.launchpad.graphops.xyz/layer: execution |
262 |
| - app.launchpad.graphops.xyz/release: '{{ $release }}' |
263 |
| - app.launchpad.graphops.xyz/component: '{{ $canonicalRelease }}' |
264 |
| - app.launchpad.graphops.xyz/scalingIndex: '{{ $deploymentIndex }}' |
265 |
| - |
266 |
| - {{- range $key,$value := ( $.Values | get $canonicalRelease dict | get "labels" dict ) }} |
267 |
| - {{ $key }}: {{ $value }} |
268 |
| - {{- $_ := set $_releaseResourceLabels $key $value }} |
269 |
| - {{- end }} |
270 |
| - {{- if (ne $release $canonicalRelease) }} |
271 |
| - {{- range $key,$value := ( $.Values | get $release dict | get "labels" dict ) }} |
272 |
| - {{ $key }}: {{ $value }} |
273 |
| - {{- $_ := set $_releaseResourceLabels $key $value }} |
274 |
| - {{- end }} |
275 |
| - {{- end }} |
276 |
| - {{- range $key,$value := ( $.Values | get $canonicalRelease dict | get "resourceLabels" dict ) }} |
277 |
| - {{- $_ := set $_releaseResourceLabels $key $value }} |
278 |
| - {{- end }} |
279 |
| - {{- if (ne $release $canonicalRelease) }} |
280 |
| - {{- range $key,$value := ( $.Values | get $release dict | get "resourceLabels" dict ) }} |
281 |
| - {{- $_ := set $_releaseResourceLabels $key $value }} |
282 |
| - {{- end }} |
283 |
| - {{- end }} |
284 |
| - {{- tpl $_tplTransforms (dict "Values" $.Values "release" $release "canonicalRelease" $canonicalRelease "resourceLabels" $_releaseResourceLabels ) | indent 4 -}} |
285 |
| - values: |
286 |
| - {{- tpl $_tplReleaseValues (dict "Values" $.Values "canonicalRelease" $canonicalRelease "release" $release) | indent 4 -}} |
287 |
| - {{- end -}} |
288 |
| - {{- end -}} |
289 |
| - {{ if has "proxyd" ( .Values | get "features" list ) }} |
290 |
| - {{- $canonicalRelease := "proxyd" }} |
291 |
| - {{- $release := "proxyd" }} |
292 |
| - {{- $_templatedValue_0 := $canonicalRelease }} |
293 |
| - {{- $_templatedValue_1 := $release }} |
294 |
| - {{- $_releaseResourceLabels := dict |
295 |
| - `app.launchpad.graphops.xyz/layer` `proxy` |
296 |
| - `app.launchpad.graphops.xyz/component` $_templatedValue_0 |
297 |
| - `app.launchpad.graphops.xyz/release` $_templatedValue_1 |
298 |
| - }} |
299 |
| - {{- $_releaseResourceLabels = mergeOverwrite $_commonLabels $_commonResourceLabels $_releaseResourceLabels }} |
300 |
| - - name: "{{ $release }}" |
301 |
| - inherit: |
302 |
| - - template: "{{ $canonicalRelease }}" |
303 |
| - labels: |
304 |
| - app.launchpad.graphops.xyz/layer: proxy |
305 |
| - app.launchpad.graphops.xyz/component: '{{ $canonicalRelease }}' |
306 |
| - app.launchpad.graphops.xyz/release: '{{ $release }}' |
307 |
| - |
308 |
| - {{- range $key,$value := ( $.Values | get $canonicalRelease dict | get "labels" dict ) }} |
309 |
| - {{ $key }}: {{ $value }} |
310 |
| - {{- $_ := set $_releaseResourceLabels $key $value }} |
311 |
| - {{- end }} |
312 |
| - {{- if (ne $release $canonicalRelease) }} |
313 |
| - {{- range $key,$value := ( $.Values | get $release dict | get "labels" dict ) }} |
314 |
| - {{ $key }}: {{ $value }} |
315 |
| - {{- $_ := set $_releaseResourceLabels $key $value }} |
316 |
| - {{- end }} |
317 |
| - {{- end }} |
318 |
| - {{- range $key,$value := ( $.Values | get $canonicalRelease dict | get "resourceLabels" dict ) }} |
319 |
| - {{- $_ := set $_releaseResourceLabels $key $value }} |
320 |
| - {{- end }} |
321 |
| - {{- if (ne $release $canonicalRelease) }} |
322 |
| - {{- range $key,$value := ( $.Values | get $release dict | get "resourceLabels" dict ) }} |
323 |
| - {{- $_ := set $_releaseResourceLabels $key $value }} |
324 |
| - {{- end }} |
325 |
| - {{- end }} |
326 |
| - {{- tpl $_tplTransforms (dict "Values" $.Values "release" $release "canonicalRelease" $canonicalRelease "resourceLabels" $_releaseResourceLabels ) | indent 4 -}} |
327 |
| - values: |
328 |
| - {{- tpl $_tplReleaseValues (dict "Values" $.Values "canonicalRelease" $canonicalRelease "release" $release) | indent 4 -}} |
329 |
| - |
330 |
| - {{- end -}} |
0 commit comments