1 #######################################################################################
2 # Copyright ETSI Contributors and Others.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #######################################################################################
18 apiVersion: argoproj.io/v1alpha1
19 kind: WorkflowTemplate
21 name: cluster-management-wft
22 namespace: osm-workflows
26 # Create a PaaS cluster using CrossPlane (any cloud)
27 - name: create-crossplane-cluster
30 # Volumes with cloned repos
31 - name: fleet_volume_name
32 - name: fleet_mount_path
34 - name: sw_catalogs_volume_name
35 - name: sw_catalogs_mount_path
39 - name: cluster_kustomization_name
41 ## As of today, one among `aks`, `eks` or `gke`:
43 - name: providerconfig_name
46 - name: cluster_location
48 - name: public_key_mgmt
49 - name: public_key_new_cluster
50 - name: secret_name_private_age_key_for_new_cluster
51 - name: key_name_in_secret
53 - name: fleet_repo_url
54 - name: sw_catalogs_repo_url
55 - name: mgmt_project_name
57 ## Do we want to skip OSM's bootstrap?
58 - name: skip_bootstrap
60 ## AKS only (otherwise, empty)
63 ## GKE only (otherwise, empty)
64 - name: preemptible_nodes
66 # Other parameters - Recommended to keep defaults
67 - name: mgmt_cluster_name
69 - name: base_templates_path
70 value: "cloud-resources"
71 - name: cloned_fleet_folder_name
73 - name: cloned_sw_catalogs_folder_name
74 value: "sw-catalogs-osm"
80 image: ttl.sh/osm-krm-functions:24h
81 # imagePullPolicy: Always
83 - name: PRIVATE_KEY_NEW_CLUSTER
86 name: "{{inputs.parameters.secret_name_private_age_key_for_new_cluster}}"
87 key: "{{inputs.parameters.key_name_in_secret}}"
89 value: "{{inputs.parameters.debug}}"
90 command: ["/app/scripts/entrypoint.sh"]
92 - create_crossplane_cluster
93 - "{{inputs.parameters.cluster_kustomization_name}}"
94 - "{{inputs.parameters.cluster_name}}"
95 - "{{inputs.parameters.cluster_type}}"
96 - "{{inputs.parameters.providerconfig_name}}"
97 - "{{inputs.parameters.vm_size}}"
98 - "{{inputs.parameters.node_count}}"
99 - "{{inputs.parameters.cluster_location}}"
100 - "{{inputs.parameters.k8s_version}}"
101 - "{{inputs.parameters.public_key_mgmt}}"
102 - "{{inputs.parameters.public_key_new_cluster}}"
104 - "{{inputs.parameters.rg_name}}"
105 - "{{inputs.parameters.preemptible_nodes}}"
106 - "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
107 - "{{inputs.parameters.fleet_repo_url}}"
108 - "{{inputs.parameters.sw_catalogs_mount_path}}/{{inputs.parameters.cloned_sw_catalogs_folder_name}}"
109 - "{{inputs.parameters.sw_catalogs_repo_url}}"
110 - "{{inputs.parameters.skip_bootstrap}}"
111 - "{{inputs.parameters.mgmt_project_name}}"
112 - "{{inputs.parameters.mgmt_cluster_name}}"
113 - "{{inputs.parameters.base_templates_path}}"
116 - name: fleet-repo-volume
117 mountPath: '{{inputs.parameters.fleet_mount_path}}'
118 - name: sw-catalogs-repo-volume
119 mountPath: '{{inputs.parameters.sw_catalogs_mount_path}}'
121 - name: fleet-repo-volume
122 persistentVolumeClaim:
123 claimName: '{{inputs.parameters.fleet_volume_name}}'
124 - name: sw-catalogs-repo-volume
125 persistentVolumeClaim:
126 claimName: '{{inputs.parameters.sw_catalogs_volume_name}}'
133 # Update a PaaS cluster created using CrossPlane (any cloud)
134 - name: update-crossplane-cluster
137 # Volumes with cloned repos
138 - name: fleet_volume_name
139 - name: fleet_mount_path
141 - name: sw_catalogs_volume_name
142 - name: sw_catalogs_mount_path
143 value: "/sw-catalogs"
145 # Specific parameters
146 - name: cluster_kustomization_name
148 ## As of today, one among `aks`, `eks` or `gke`:
150 - name: providerconfig_name
153 - name: cluster_location
155 - name: public_key_mgmt
156 - name: public_key_new_cluster
157 - name: secret_name_private_age_key_for_new_cluster
158 - name: key_name_in_secret
160 - name: fleet_repo_url
161 - name: sw_catalogs_repo_url
162 - name: mgmt_project_name
164 ## AKS only (otherwise, empty)
167 ## GKE only (otherwise, empty)
168 - name: preemptible_nodes
170 # Other parameters - Recommended to keep defaults
171 - name: mgmt_cluster_name
173 - name: base_templates_path
174 value: "cloud-resources"
175 - name: cloned_fleet_folder_name
177 - name: cloned_sw_catalogs_folder_name
178 value: "sw-catalogs-osm"
184 image: ttl.sh/osm-krm-functions:24h
185 # imagePullPolicy: Always
187 - name: PRIVATE_KEY_NEW_CLUSTER
190 name: "{{inputs.parameters.secret_name_private_age_key_for_new_cluster}}"
191 key: "{{inputs.parameters.key_name_in_secret}}"
193 value: "{{inputs.parameters.debug}}"
194 command: ["/app/scripts/entrypoint.sh"]
196 - update_crossplane_cluster
197 - "{{inputs.parameters.cluster_kustomization_name}}"
198 - "{{inputs.parameters.cluster_name}}"
199 - "{{inputs.parameters.cluster_type}}"
200 - "{{inputs.parameters.providerconfig_name}}"
201 - "{{inputs.parameters.vm_size}}"
202 - "{{inputs.parameters.node_count}}"
203 - "{{inputs.parameters.cluster_location}}"
204 - "{{inputs.parameters.k8s_version}}"
205 - "{{inputs.parameters.public_key_mgmt}}"
206 - "{{inputs.parameters.public_key_new_cluster}}"
208 - "{{inputs.parameters.rg_name}}"
209 - "{{inputs.parameters.preemptible_nodes}}"
210 - "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
211 - "{{inputs.parameters.fleet_repo_url}}"
212 - "{{inputs.parameters.sw_catalogs_mount_path}}/{{inputs.parameters.cloned_sw_catalogs_folder_name}}"
213 - "{{inputs.parameters.sw_catalogs_repo_url}}"
214 ## Note that during upgrades, OSM's bootstrap is avoided:
216 - "{{inputs.parameters.mgmt_project_name}}"
217 - "{{inputs.parameters.mgmt_cluster_name}}"
218 - "{{inputs.parameters.base_templates_path}}"
221 - name: fleet-repo-volume
222 mountPath: '{{inputs.parameters.fleet_mount_path}}'
223 - name: sw-catalogs-repo-volume
224 mountPath: '{{inputs.parameters.sw_catalogs_mount_path}}'
226 - name: fleet-repo-volume
227 persistentVolumeClaim:
228 claimName: '{{inputs.parameters.fleet_volume_name}}'
229 - name: sw-catalogs-repo-volume
230 persistentVolumeClaim:
231 claimName: '{{inputs.parameters.sw_catalogs_volume_name}}'
238 # TODO: Deprecated - To be removed
239 # Create a PaaS cluster in Azure
240 - name: create-cluster-aks
243 # Volumes with cloned repos
244 - name: fleet_volume_name
245 - name: fleet_mount_path
247 - name: sw_catalogs_volume_name
248 - name: sw_catalogs_mount_path
249 value: "/sw-catalogs"
251 # Specific parameters
255 - name: cluster_location
258 - name: providerconfig_name
259 - name: cluster_kustomization_name
260 - name: mgmt_project_name
263 # Other parameters - Recommended to keep defaults
264 - name: fleet_repo_dir
265 value: "/fleet/fleet-osm/"
266 - name: sw_catalogs_repo_dir
267 value: "/sw-catalogs/sw-catalogs-osm/"
268 - name: target_folder
269 value: "{{inputs.parameters.fleet_repo_dir}}/{{inputs.parameters.mgmt_project_name}}/managed-resources/_management"
270 - name: manifest_filename
271 value: "{{inputs.parameters.cluster_name}}.yaml"
273 value: "{{inputs.parameters.sw_catalogs_repo_dir}}/cloud-resources/aks/templates/"
274 - name: template_manifest_filename
277 - name: fleet-repo-volume
278 persistentVolumeClaim:
279 claimName: '{{inputs.parameters.fleet_volume_name}}'
280 - name: sw-catalogs-repo-volume
281 persistentVolumeClaim:
282 claimName: '{{inputs.parameters.sw_catalogs_volume_name}}'
284 image: ttl.sh/osm-krm-functions:24h
285 # imagePullPolicy: Always
291 - name: fleet-repo-volume
292 mountPath: '{{inputs.parameters.fleet_mount_path}}'
293 - name: sw-catalogs-repo-volume
294 mountPath: '{{inputs.parameters.sw_catalogs_mount_path}}'
295 command: ["/app/scripts/entrypoint.sh"]
298 - "{{inputs.parameters.cluster_name}}"
299 - "{{inputs.parameters.vm_size}}"
300 - "{{inputs.parameters.node_count}}"
301 - "{{inputs.parameters.cluster_location}}"
302 - "{{inputs.parameters.rg_name}}"
303 - "{{inputs.parameters.k8s_version}}"
304 - "{{inputs.parameters.providerconfig_name}}"
305 - "{{inputs.parameters.cluster_kustomization_name}}"
306 - "{{inputs.parameters.target_folder}}"
307 - "{{inputs.parameters.manifest_filename}}"
308 - "{{inputs.parameters.templates}}"
309 - "{{inputs.parameters.template_manifest_filename}}"
312 # Bootstrap remote cluster running in **ANY cloud**
313 - name: bootstrap-remote-cluster
316 # Volumes with cloned repos
317 - name: fleet_volume_name
318 - name: fleet_mount_path
320 - name: sw_catalogs_volume_name
321 - name: sw_catalogs_mount_path
322 value: "/sw-catalogs"
324 # Specific parameters
326 - name: cluster_kustomization_name
327 - name: public_key_mgmt
328 - name: public_key_new_cluster
329 - name: secret_name_private_age_key_for_new_cluster
330 - name: key_name_in_secret
332 - name: fleet_repo_url
333 - name: sw_catalogs_repo_url
335 # Other parameters - Recommended to keep defaults
336 - name: mgmt_project_name
338 - name: imported_cluster
340 - name: fleet_repo_dir
341 value: "/fleet/fleet-osm/"
342 - name: sw_catalogs_repo_dir
343 value: "/sw-catalogs/sw-catalogs-osm/"
350 image: ttl.sh/osm-krm-functions:24h
351 # imagePullPolicy: Always
353 - name: PRIVATE_KEY_NEW_CLUSTER
356 name: "{{inputs.parameters.secret_name_private_age_key_for_new_cluster}}"
357 key: "{{inputs.parameters.key_name_in_secret}}"
359 value: "{{inputs.parameters.debug}}"
360 command: ["/app/scripts/entrypoint.sh"]
362 - create_bootstrap_for_remote_cluster
363 - "{{inputs.parameters.cluster_name}}"
364 - "{{inputs.parameters.cluster_kustomization_name}}"
365 - "{{inputs.parameters.fleet_repo_dir}}"
366 - "{{inputs.parameters.sw_catalogs_repo_dir}}"
367 - "{{inputs.parameters.fleet_repo_url}}"
368 - "{{inputs.parameters.sw_catalogs_repo_url}}"
369 - "{{inputs.parameters.mgmt_project_name}}"
370 - "{{inputs.parameters.public_key_mgmt}}"
371 - "{{inputs.parameters.public_key_new_cluster}}"
373 - "{{inputs.parameters.imported_cluster}}"
375 - name: fleet-repo-volume
376 mountPath: '{{inputs.parameters.fleet_mount_path}}'
377 - name: sw-catalogs-repo-volume
378 mountPath: '{{inputs.parameters.sw_catalogs_mount_path}}'
380 - name: fleet-repo-volume
381 persistentVolumeClaim:
382 claimName: '{{inputs.parameters.fleet_volume_name}}'
383 - name: sw-catalogs-repo-volume
384 persistentVolumeClaim:
385 claimName: '{{inputs.parameters.sw_catalogs_volume_name}}'
392 # Disconnect Flux in remote cluster running in **ANY cloud**
393 - name: disconnect-flux-remote-cluster
396 # Volumes with cloned repos
397 - name: fleet_volume_name
398 - name: fleet_mount_path
401 # Specific parameters
402 - name: cluster_kustomization_name
403 - name: mgmt_project_name
406 # Other parameters - Recommended to keep defaults
407 - name: fleet_repo_dir
408 value: "/fleet/fleet-osm/"
415 image: ttl.sh/osm-krm-functions:24h
416 # imagePullPolicy: Always
419 value: "{{inputs.parameters.debug}}"
420 command: ["/app/scripts/entrypoint.sh"]
422 - disconnect_flux_remote_cluster
423 - "{{inputs.parameters.cluster_kustomization_name}}"
424 - "{{inputs.parameters.fleet_repo_dir}}"
425 - "{{inputs.parameters.mgmt_project_name}}"
427 - name: fleet-repo-volume
428 mountPath: '{{inputs.parameters.fleet_mount_path}}'
430 - name: fleet-repo-volume
431 persistentVolumeClaim:
432 claimName: '{{inputs.parameters.fleet_volume_name}}'
439 # Delete cluster from **ANY** cloud
440 - name: delete-cluster
443 # Volumes with cloned repos
444 - name: fleet_volume_name
445 - name: fleet_mount_path
448 # Specific parameters
449 - name: cluster_kustomization_name
453 # Other parameters - Recommended to keep defaults
454 - name: fleet_repo_dir
455 value: "/fleet/fleet-osm/"
456 - name: mgmt_resources_dir
457 value: "{{inputs.parameters.fleet_repo_dir}}/{{inputs.parameters.project_name}}/managed-resources/_management"
460 image: ttl.sh/osm-krm-functions:24h
461 # imagePullPolicy: Always
462 command: ["/app/scripts/entrypoint.sh"]
464 - delete_remote_cluster
465 - "{{inputs.parameters.cluster_kustomization_name}}"
466 - "{{inputs.parameters.project_name}}"
467 - "{{inputs.parameters.fleet_repo_dir}}"
468 - "{{inputs.parameters.mgmt_resources_dir}}"
471 - name: fleet-repo-volume
472 mountPath: '{{inputs.parameters.fleet_mount_path}}'
474 - name: fleet-repo-volume
475 persistentVolumeClaim:
476 claimName: '{{inputs.parameters.fleet_volume_name}}'