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: full-update-crossplane-cluster-and-bootstrap-wft
22 namespace: osm-workflows
30 - name: fleet_destination_folder
31 - name: git_fleet_cred_secret
34 - name: git_sw_catalogs_url
35 - name: sw_catalogs_destination_folder
36 - name: git_sw_catalogs_cred_secret
38 # Specific parameters - Generic cluster creation
39 - name: cluster_kustomization_name
42 - name: providerconfig_name
45 - name: cluster_location
48 # Specific parameters - Bootstrap and credentials
49 - name: public_key_mgmt
50 - name: public_key_new_cluster
51 - name: secret_name_private_age_key_for_new_cluster
52 - name: key_name_in_secret
54 # Using `git_fleet_url` instead:
55 # - name: fleet_repo_url
56 # Using `git_sw_catalogs_url` instead:
57 # - name: sw_catalogs_repo_url
58 - name: mgmt_project_name
61 # Specific parameters - AKS only
65 # Specific parameters - GKE only
66 - name: preemptible_nodes
69 # Advanced parameters - Recommended to keep defaults
70 - name: mgmt_cluster_name
72 - name: base_templates_path
73 value: "cloud-resources"
74 - name: cloned_fleet_folder_name
76 - name: cloned_sw_catalogs_folder_name
77 value: "sw-catalogs-osm"
88 # secondsAfterCompletion: 100 # Time to live after workflow is completed, replaces ttlSecondsAfterFinished
89 # secondsAfterSuccess: 50 # Time to live after workflow is successful
90 # secondsAfterFailure: 50 # Time to live after workflow fails
92 entrypoint: update-cluster-and-bootstrap
96 - name: update-cluster-and-bootstrap
100 - name: git_fleet_url
101 - name: fleet_destination_folder
102 - name: git_fleet_cred_secret
104 - name: git_sw_catalogs_url
105 - name: sw_catalogs_destination_folder
106 - name: git_sw_catalogs_cred_secret
107 # Specific parameters
108 - name: cluster_kustomization_name
111 - name: providerconfig_name
114 - name: cluster_location
116 - name: public_key_mgmt
117 - name: public_key_new_cluster
118 - name: secret_name_private_age_key_for_new_cluster
119 - name: key_name_in_secret
120 # - name: fleet_repo_url
121 # - name: sw_catalogs_repo_url
122 - name: mgmt_project_name
123 # - name: skip_bootstrap
124 ## AKS only (otherwise, ignored)
126 ## GKE only (otherwise, ignored)
127 - name: preemptible_nodes
128 # Other parameters - Recommended to keep defaults
129 - name: mgmt_cluster_name
130 - name: base_templates_path
131 - name: cloned_fleet_folder_name
132 - name: cloned_sw_catalogs_folder_name
138 # ------ Preparations for transaction
139 - - name: generate-fleet-volume-repo
141 name: k8s-resources-wft
142 template: generate-volume
147 - name: generate-sw-catalogs-volume-repo
149 name: k8s-resources-wft
150 template: generate-volume
155 - - name: clone-fleet
164 value: "{{inputs.parameters.git_fleet_url}}"
165 - name: destination_folder
166 value: "{{inputs.parameters.fleet_destination_folder}}"
167 - name: git_cred_secret
168 value: "{{inputs.parameters.git_fleet_cred_secret}}"
169 - name: git_volume_name
170 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
171 - name: clone-sw-catalogs
178 value: "/sw-catalogs"
180 value: "{{inputs.parameters.git_sw_catalogs_url}}"
181 - name: destination_folder
182 value: "{{inputs.parameters.sw_catalogs_destination_folder}}"
183 - name: git_cred_secret
184 value: "{{inputs.parameters.git_sw_catalogs_cred_secret}}"
185 - name: git_volume_name
186 value: '{{steps.generate-sw-catalogs-volume-repo.outputs.parameters.pvc-name}}'
187 # ------ end of preparations for transaction
189 # ------ Transformations
190 # Create cluster in target cloud
191 - - name: update-cluster
193 name: cluster-management-wft
194 template: update-crossplane-cluster
197 # Volumes with cloned repos
198 - name: fleet_volume_name
199 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
200 - name: fleet_mount_path
202 - name: sw_catalogs_volume_name
203 value: '{{steps.generate-sw-catalogs-volume-repo.outputs.parameters.pvc-name}}'
204 - name: sw_catalogs_mount_path
205 value: "/sw-catalogs"
206 # Specific parameters
207 - name: cluster_kustomization_name
208 value: "{{inputs.parameters.cluster_kustomization_name}}"
210 value: "{{inputs.parameters.cluster_name}}"
212 value: "{{inputs.parameters.cluster_type}}"
213 - name: providerconfig_name
214 value: "{{inputs.parameters.providerconfig_name}}"
216 value: "{{inputs.parameters.vm_size}}"
218 value: "{{inputs.parameters.node_count}}"
219 - name: cluster_location
220 value: "{{inputs.parameters.cluster_location}}"
222 value: "{{inputs.parameters.k8s_version}}"
223 - name: public_key_mgmt
224 value: "{{inputs.parameters.public_key_mgmt}}"
225 - name: public_key_new_cluster
226 value: "{{inputs.parameters.public_key_new_cluster}}"
227 - name: secret_name_private_age_key_for_new_cluster
228 value: "{{inputs.parameters.secret_name_private_age_key_for_new_cluster}}"
229 - name: key_name_in_secret
230 value: "{{inputs.parameters.key_name_in_secret}}"
231 ## Fed with `git_fleet_url` to avoid duplicates
232 - name: fleet_repo_url
233 value: "{{inputs.parameters.git_fleet_url}}"
234 ## Fed with `git_sw_catalogs_url` to avoid duplicates
235 - name: sw_catalogs_repo_url
236 value: "{{inputs.parameters.git_sw_catalogs_url}}"
237 - name: mgmt_project_name
238 value: "{{inputs.parameters.mgmt_project_name}}"
239 # - name: skip_bootstrap
240 # value: "{{inputs.parameters.skip_bootstrap}}"
243 value: "{{inputs.parameters.rg_name}}"
245 - name: preemptible_nodes
246 value: "{{inputs.parameters.preemptible_nodes}}"
247 # Other parameters - Recommended to keep defaults
248 - name: mgmt_cluster_name
249 value: "{{inputs.parameters.mgmt_cluster_name}}"
250 - name: base_templates_path
251 value: "{{inputs.parameters.base_templates_path}}"
252 - name: cloned_fleet_folder_name
253 value: "{{inputs.parameters.cloned_fleet_folder_name}}"
254 - name: cloned_sw_catalogs_folder_name
255 value: "{{inputs.parameters.cloned_sw_catalogs_folder_name}}"
258 value: "{{inputs.parameters.debug}}"
259 # ------ end of transformations
261 # ------ Commit transaction
262 - - name: push-to-fleet
265 template: git-commit-merge-push
271 value: "{{inputs.parameters.fleet_destination_folder}}"
272 - name: git_cred_secret
273 value: "{{inputs.parameters.git_fleet_cred_secret}}"
274 - name: git_volume_name
275 value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
276 - name: commit_message
277 value: "Create AKS cluster {{inputs.parameters.cluster_kustomization_name}}"
280 - name: contrib_branch
283 value: "{{inputs.parameters.dry_run}}"
284 # ------ end of commit transaction