}
+# Create remote NodeGroup in AWS
+function create_nodegroup() {
+ local NODEGROUP_NAME="$1"
+ local NODEGROUP_KUSTOMIZATION_NAME="$2"
+ local CLUSTER_NAME="$3"
+ local CLUSTER_TYPE="$4"
+ local PROVIDERCONFIG_NAME="${5:-default}"
+ local VM_SIZE="$6"
+ local NODE_COUNT="$7"
+ local CLUSTER_LOCATION="$8"
+ local CONFIGMAP_NAME="${9}"
+ local NODEGROUP_ROLE="${10}"
+ local PUBLIC_KEY_MGMT="${11:-"${PUBLIC_KEY_MGMT}"}"
+ local PUBLIC_KEY_NEW_CLUSTER="${12}"
+ local PRIVATE_KEY_NEW_CLUSTER="${13:-"${PRIVATE_KEY_NEW_CLUSTER}"}"
+ local AKS_RG_NAME="${14:-""}"
+ local GKE_PREEMPTIBLE_NODES="${15:-""}"
+ local FLEET_REPO_DIR="${16:-"${FLEET_REPO_DIR}"}"
+ local FLEET_REPO_URL="${17:-""}"
+ local SW_CATALOGS_REPO_DIR="${18:-"${SW_CATALOGS_REPO_DIR}"}"
+ local SW_CATALOGS_REPO_URL="${19:-""}"
+ local SKIP_BOOTSTRAP="${20:"false"}"
+ local MGMT_PROJECT_NAME="${21:-"osm_admin"}"
+ local MGMT_CLUSTER_NAME="${22:-"_management"}"
+ local BASE_TEMPLATES_PATH="${23:-"cloud-resources"}"
+ local TEMPLATE_MANIFEST_FILENAME="${24:-"nodegroup.yaml"}"
+ local MANIFEST_FILENAME="${25:-"${NODEGROUP_NAME}.yaml"}"
+
+ # Is the provider type supported?
+ local VALID_PROVIDERS=("eks" "aks" "gke")
+ CLUSTER_TYPE="${CLUSTER_TYPE,,}"
+ [[ ! ($(echo ${VALID_PROVIDERS[@]} | grep -w "${CLUSTER_TYPE}")) ]] && return 1
+
+ # Determines the source dir for the templates and the target folder in Fleet
+ local TEMPLATES_DIR="${SW_CATALOGS_REPO_DIR}/${BASE_TEMPLATES_PATH}/eks-nodegroup/templates"
+ local TARGET_FOLDER="${FLEET_REPO_DIR}/${MGMT_PROJECT_NAME}/managed-resources/${MGMT_CLUSTER_NAME}/${CLUSTER_NAME}"
+
+ local IS_NODEGROUP_ROLE=$([[ "${NODEGROUP_ROLE}" != "default" ]]; echo $?)
+ local IS_DEFAULT_NODEGROUP_ROLE=$([[ "${NODEGROUP_ROLE}" == "default" ]]; echo $?)
+
+ local PATCH_VALUE=""
+ local COMPONENT=()
+ if [[ "${IS_NODEGROUP_ROLE}" == "0" ]];
+ then
+ PATCH_VALUE=$(cat <<EOF
+patch: |
+ apiVersion: eks.aws.upbound.io/v1beta1
+ kind: NodeGroup
+ metadata:
+ name: \${nodegroup_name}
+ spec:
+ forProvider:
+ nodeRoleArn: \${role}
+EOF
+)
+ else
+ COMPONENT=("../role")
+ fi
+
+ # Pipeline of transformations to create the cluster resource
+ export NODEGROUP_KUSTOMIZATION_NAME
+ # export OVERLAY_FOLDER
+ folder2list \
+ "${TEMPLATES_DIR}" | \
+ replace_env_vars \
+ '${NODEGROUP_KUSTOMIZATION_NAME}' | \
+ patch_replace \
+ ".spec.postBuild.substitute.nodegroup_name" \
+ "${NODEGROUP_NAME}" \
+ "| select(.kind == \"Kustomization\") | select(.metadata.name == \"${NODEGROUP_KUSTOMIZATION_NAME}\")" | \
+ patch_replace \
+ ".spec.postBuild.substitute.cluster_name" \
+ "${CLUSTER_NAME}" \
+ "| select(.kind == \"Kustomization\") | select(.metadata.name == \"${NODEGROUP_KUSTOMIZATION_NAME}\")" | \
+ patch_replace \
+ ".spec.postBuild.substitute.cluster_location" \
+ "${CLUSTER_LOCATION}" \
+ "| select(.kind == \"Kustomization\") | select(.metadata.name == \"${NODEGROUP_KUSTOMIZATION_NAME}\")" | \
+ patch_replace \
+ ".spec.postBuild.substitute.vm_size" \
+ "${VM_SIZE}" \
+ "| select(.kind == \"Kustomization\") | select(.metadata.name == \"${NODEGROUP_KUSTOMIZATION_NAME}\")" | \
+ patch_replace \
+ ".spec.postBuild.substitute.node_count" \
+ "${NODE_COUNT}" \
+ "| select(.kind == \"Kustomization\") | select(.metadata.name == \"${NODEGROUP_KUSTOMIZATION_NAME}\")" | \
+ patch_replace \
+ ".spec.postBuild.substitute.providerconfig_name" \
+ "${PROVIDERCONFIG_NAME}" \
+ "| select(.kind == \"Kustomization\") | select(.metadata.name == \"${NODEGROUP_KUSTOMIZATION_NAME}\")" | \
+ patch_replace \
+ ".spec.postBuild.substituteFrom[0].name" \
+ "${CONFIGMAP_NAME}" \
+ "| select(.kind == \"Kustomization\") | select(.metadata.name == \"${NODEGROUP_KUSTOMIZATION_NAME}\")" | \
+ patch_replace \
+ ".spec.postBuild.substitute.role" \
+ "${NODEGROUP_ROLE}" \
+ "| select(.kind == \"Kustomization\") | select(.metadata.name == \"${NODEGROUP_KUSTOMIZATION_NAME}\")" | \
+ transform_if \
+ "${IS_NODEGROUP_ROLE}" \
+ add_patch_to_kustomization_as_list \
+ "${NODEGROUP_KUSTOMIZATION_NAME}" \
+ "${PATCH_VALUE}" | \
+ transform_if \
+ "${IS_DEFAULT_NODEGROUP_ROLE}" \
+ add_component_to_kustomization_as_list \
+ "${NODEGROUP_KUSTOMIZATION_NAME}" \
+ "${COMPONENT}" | \
+ rename_file_in_items \
+ "${TEMPLATE_MANIFEST_FILENAME}" \
+ "${MANIFEST_FILENAME}" | \
+ prepend_folder_path "${NODEGROUP_KUSTOMIZATION_NAME}/" | \
+ list2folder_cp_over \
+ "${TARGET_FOLDER}"
+}
+
+function scale_nodegroup() {
+ local NODEGROUP_NAME="$1"
+ local NODEGROUP_KUSTOMIZATION_NAME="$2"
+ local CLUSTER_NAME="$3"
+ local CLUSTER_TYPE="$4"
+ local NODE_COUNT="$5"
+ local PUBLIC_KEY_MGMT="${6:-"${PUBLIC_KEY_MGMT}"}"
+ local PUBLIC_KEY_NEW_CLUSTER="${7}"
+ local PRIVATE_KEY_NEW_CLUSTER="${8:-"${PRIVATE_KEY_NEW_CLUSTER}"}"
+ ## `FLEET_REPO_DIR` is the result of:
+ ## "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
+ local FLEET_REPO_DIR="${9:-"${FLEET_REPO_DIR}"}"
+ local FLEET_REPO_URL="${10:-""}"
+ ## `SW_CATALOGS_REPO_DIR` is the result of:
+ ## "{{inputs.parameters.sw_catalogs_mount_path}}/{{inputs.parameters.cloned_sw_catalogs_folder_name}}"
+ local SW_CATALOGS_REPO_DIR="${11:-"${SW_CATALOGS_REPO_DIR}"}"
+ local SW_CATALOGS_REPO_URL="${12:-""}"
+ # Only change if absolutely needeed
+ local MGMT_PROJECT_NAME="${13:-"osm_admin"}"
+ local MGMT_CLUSTER_NAME="${14:-"_management"}"
+ local BASE_TEMPLATES_PATH="${15:-"cloud-resources"}"
+ local MANIFEST_FILENAME="${16:-"${NODEGROUP_NAME}"}"
+
+ # Is the provider type supported?
+ local VALID_PROVIDERS=("eks" "aks" "gke")
+ CLUSTER_TYPE="${CLUSTER_TYPE,,}"
+ [[ ! ($(echo ${VALID_PROVIDERS[@]} | grep -w "${CLUSTER_TYPE}")) ]] && return 1
+
+ # Determines the folder in Fleet
+ local TARGET_FOLDER="${FLEET_REPO_DIR}/${MGMT_PROJECT_NAME}/managed-resources/${MGMT_CLUSTER_NAME}/${CLUSTER_NAME}/${NODEGROUP_KUSTOMIZATION_NAME}"
+
+ # Pipeline of transformations to create the cluster resource
+ export NODEGROUP_KUSTOMIZATION_NAME
+ folder2list \
+ "${TARGET_FOLDER}" | \
+ patch_replace \
+ ".spec.postBuild.substitute.node_count" \
+ "${NODE_COUNT}" \
+ "| select(.kind == \"Kustomization\") | select(.metadata.name == \"${NODEGROUP_KUSTOMIZATION_NAME}\")" | \
+ list2folder_cp_over \
+ "${TARGET_FOLDER}"
+}
+
+# Delete nodegroup
+function delete_nodegroup() {
+ local NODEGROUP_KUSTOMIZATION_NAME="$1"
+ local CLUSTER_NAME="$2"
+ local PROJECT_NAME="${3:-"${MGMT_PROJECT_NAME}"}"
+ local FLEET_REPO_DIR="${4:-"${FLEET_REPO_DIR}"}"
+ local MGMT_RESOURCES_DIR="${5:-"${MGMT_RESOURCES_DIR}"}"
+
+ local NODEGROUP_DIR="${MGMT_RESOURCES_DIR}/${CLUSTER_NAME}/${NODEGROUP_KUSTOMIZATION_NAME}"
+
+ # Delete node Kustomizations
+ rm -rf "${NODEGROUP_DIR}"
+}
+
# TODO: Deprecated
# Create AKS cluster (without bootstrap)
function create_cluster_aks() {
--- /dev/null
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+apiVersion: eks.aws.upbound.io/v1beta1
+kind: NodeGroup
+metadata:
+ name: ${nodegroup_name}
+ annotations:
+ crossplane.io/external-name: ${nodegroup_name}
+ labels:
+ provider: aws
+ node: ${nodegroup_name}
+ cluster: ${cluster_name}
+spec:
+ forProvider:
+ region: ${cluster_location}
+ clusterNameSelector:
+ matchLabels:
+ provider: aws
+ cluster: ${cluster_name}
+ type: cluster
+ nodeRoleArnSelector:
+ matchLabels:
+ provider: aws
+ node: ${nodegroup_name}
+ type: ec2
+ subnetIds: ${subnet}
+ scalingConfig:
+ - minSize: 1
+ desiredSize: ${node_count}
+ maxSize: 10
+ diskSize: 30
+ instanceTypes:
+ - ${vm_size}
+ tags:
+ Name: ${nodegroup_name}
+ # Use in case you wanted to use different credentials (i.e., ProviderConfig different than default)
+ providerConfigRef:
+ name: ${providerconfig_name}
+
--- /dev/null
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+apiVersion: kustomize.config.k8s.io/v1alpha1
+kind: Component
+resources:
+ - role.yaml
+ - role-policy-attachment.yaml
--- /dev/null
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+apiVersion: iam.aws.upbound.io/v1beta1
+kind: RolePolicyAttachment
+metadata:
+ name: ${nodegroup_name}-worker
+ labels:
+ provider: aws
+ node: ${nodegroup_name}
+spec:
+ forProvider:
+ policyArn: arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy
+ roleSelector:
+ matchLabels:
+ provider: aws
+ node: ${nodegroup_name}
+ type: ec2
+ # Use in case you wanted to use different credentials (i.e., ProviderConfig different than default)
+ providerConfigRef:
+ name: ${providerconfig_name}
+---
+
+apiVersion: iam.aws.upbound.io/v1beta1
+kind: RolePolicyAttachment
+metadata:
+ name: ${nodegroup_name}-ssm
+ labels:
+ provider: aws
+ node: ${nodegroup_name}
+spec:
+ forProvider:
+ policyArn: arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore
+ roleSelector:
+ matchLabels:
+ provider: aws
+ node: ${nodegroup_name}
+ type: ec2
+ # Use in case you wanted to use different credentials (i.e., ProviderConfig different than default)
+ providerConfigRef:
+ name: ${providerconfig_name}
+
+---
+apiVersion: iam.aws.upbound.io/v1beta1
+kind: RolePolicyAttachment
+metadata:
+ name: ${nodegroup_name}-cni
+ labels:
+ provider: aws
+ node: ${nodegroup_name}
+spec:
+ forProvider:
+ policyArn: arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy
+ roleSelector:
+ matchLabels:
+ provider: aws
+ node: ${nodegroup_name}
+ type: ec2
+ # Use in case you wanted to use different credentials (i.e., ProviderConfig different than default)
+ providerConfigRef:
+ name: ${providerconfig_name}
+
+---
+apiVersion: iam.aws.upbound.io/v1beta1
+kind: RolePolicyAttachment
+metadata:
+ name: ${nodegroup_name}-registry
+ labels:
+ provider: aws
+ node: ${nodegroup_name}
+spec:
+ forProvider:
+ policyArn: arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly
+ roleSelector:
+ matchLabels:
+ provider: aws
+ node: ${nodegroup_name}
+ type: ec2
+ # Use in case you wanted to use different credentials (i.e., ProviderConfig different than default)
+ providerConfigRef:
+ name: ${providerconfig_name}
+
--- /dev/null
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+apiVersion: iam.aws.upbound.io/v1beta1
+kind: Role
+metadata:
+ name: ${nodegroup_name}-ec2
+ annotations:
+ crossplane.io/external-name: ${nodegroup_name}-nodeRole
+ labels:
+ provider: aws
+ node: ${nodegroup_name}
+ type: ec2
+spec:
+ forProvider:
+ assumeRolePolicy: |
+ {
+ "Version": "2012-10-17",
+ "Statement": [
+ {
+ "Effect": "Allow",
+ "Principal": {
+ "Service": [
+ "ec2.amazonaws.com"
+ ]
+ },
+ "Action": [
+ "sts:AssumeRole"
+ ]
+ }
+ ]
+ }
+ # Use in case you wanted to use different credentials (i.e., ProviderConfig different than default)
+ providerConfigRef:
+ name: ${providerconfig_name}
+
--- /dev/null
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+# NodeGroup resource
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+ name: ${NODEGROUP_KUSTOMIZATION_NAME}
+ namespace: managed-resources
+ labels:
+ node: ${NODEGROUP_KUSTOMIZATION_NAME}
+spec:
+ commonMetadata:
+ labels:
+ node: ${NODEGROUP_KUSTOMIZATION_NAME}
+ interval: 1h
+ retryInterval: 1m
+ timeout: 5m
+ sourceRef:
+ kind: GitRepository
+ name: sw-catalogs
+ namespace: flux-system
+ path: ./cloud-resources/eks-nodegroup/manifests/base
+ prune: true
+ # force: true
+ wait: true
+ # Input parameters
+ postBuild:
+ substitute:
+ providerconfig_name: default
+ nodegroup_name: node1
+ cluster_name: ekscluster01
+ node_count: "1"
+ vm_size: t3.medium
+ cluster_location: ap-south-1
+ role: arn:aws:iam::123456789012:role/role
+ substituteFrom:
+ - kind: ConfigMap
+ name: node1-parameters
+
--- /dev/null
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+
+apiVersion: argoproj.io/v1alpha1
+kind: WorkflowTemplate
+metadata:
+ name: nodegroup-management-wft
+ namespace: osm-workflows
+spec:
+ templates:
+
+ # Create a nodegroup in AWS
+ - name: create-nodegroup
+ inputs:
+ parameters:
+ # Volumes with cloned repos
+ - name: fleet_volume_name
+ - name: fleet_mount_path
+ value: "/fleet"
+ - name: sw_catalogs_volume_name
+ - name: sw_catalogs_mount_path
+ value: "/sw-catalogs"
+
+ # Specific parameters
+ - name: nodegroup_name
+ - name: nodegroup_kustomization_name
+ - name: cluster_name
+ - name: cluster_type
+ - name: providerconfig_name
+ - name: vm_size
+ - name: node_count
+ - name: cluster_location
+ - name: configmap_name
+ - name: role
+ - name: public_key_mgmt
+ - name: public_key_new_cluster
+ - name: secret_name_private_age_key_for_new_cluster
+ - name: key_name_in_secret
+ value: "agekey"
+ - name: fleet_repo_url
+ - name: sw_catalogs_repo_url
+ - name: mgmt_project_name
+ value: "osm_admin"
+ ## Do we want to skip OSM's bootstrap?
+ - name: skip_bootstrap
+ value: "false"
+ ## AKS only (otherwise, empty)
+ - name: rg_name
+ values: ""
+ ## GKE only (otherwise, empty)
+ - name: preemptible_nodes
+ values: "false"
+ # Other parameters - Recommended to keep defaults
+ - name: mgmt_cluster_name
+ value: "_management"
+ - name: base_templates_path
+ value: "cloud-resources"
+ - name: cloned_fleet_folder_name
+ value: "fleet-osm"
+ - name: cloned_sw_catalogs_folder_name
+ value: "sw-catalogs-osm"
+ # Debug?
+ - name: debug
+ value: "false"
+
+ container:
+ image: opensourcemano/osm-krm-functions:testing-daily
+ # imagePullPolicy: Always
+ env:
+ - name: PRIVATE_KEY_NEW_CLUSTER
+ valueFrom:
+ secretKeyRef:
+ name: "{{inputs.parameters.secret_name_private_age_key_for_new_cluster}}"
+ key: "{{inputs.parameters.key_name_in_secret}}"
+ - name: DEBUG
+ value: "{{inputs.parameters.debug}}"
+ command: ["/app/scripts/entrypoint.sh"]
+ args:
+ - create_nodegroup
+ - "{{inputs.parameters.nodegroup_name}}"
+ - "{{inputs.parameters.nodegroup_kustomization_name}}"
+ - "{{inputs.parameters.cluster_name}}"
+ - "{{inputs.parameters.cluster_type}}"
+ - "{{inputs.parameters.providerconfig_name}}"
+ - "{{inputs.parameters.vm_size}}"
+ - "{{inputs.parameters.node_count}}"
+ - "{{inputs.parameters.cluster_location}}"
+ - "{{inputs.parameters.configmap_name}}"
+ - "{{inputs.parameters.role}}"
+ - "{{inputs.parameters.public_key_mgmt}}"
+ - "{{inputs.parameters.public_key_new_cluster}}"
+ - ''
+ - "{{inputs.parameters.rg_name}}"
+ - "{{inputs.parameters.preemptible_nodes}}"
+ - "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
+ - "{{inputs.parameters.fleet_repo_url}}"
+ - "{{inputs.parameters.sw_catalogs_mount_path}}/{{inputs.parameters.cloned_sw_catalogs_folder_name}}"
+ - "{{inputs.parameters.sw_catalogs_repo_url}}"
+ - "{{inputs.parameters.skip_bootstrap}}"
+ - "{{inputs.parameters.mgmt_project_name}}"
+ - "{{inputs.parameters.mgmt_cluster_name}}"
+ - "{{inputs.parameters.base_templates_path}}"
+
+ volumeMounts:
+ - name: fleet-repo-volume
+ mountPath: '{{inputs.parameters.fleet_mount_path}}'
+ - name: sw-catalogs-repo-volume
+ mountPath: '{{inputs.parameters.sw_catalogs_mount_path}}'
+ volumes:
+ - name: fleet-repo-volume
+ persistentVolumeClaim:
+ claimName: '{{inputs.parameters.fleet_volume_name}}'
+ - name: sw-catalogs-repo-volume
+ persistentVolumeClaim:
+ claimName: '{{inputs.parameters.sw_catalogs_volume_name}}'
+ securityContext:
+ runAsUser: 10000
+ # runAsGroup: 10000
+ # fsGroup: 10000
+
+ - name: scale-nodegroup
+ inputs:
+ parameters:
+ # Volumes with cloned repos
+ - name: fleet_volume_name
+ - name: fleet_mount_path
+ value: "/fleet"
+ - name: sw_catalogs_volume_name
+ - name: sw_catalogs_mount_path
+ value: "/sw-catalogs"
+
+ # Specific parameters
+ - name: nodegroup_name
+ - name: nodegroup_kustomization_name
+ - name: cluster_name
+ - name: cluster_type
+ - name: node_count
+ - name: public_key_mgmt
+ - name: public_key_new_cluster
+ - name: secret_name_private_age_key_for_new_cluster
+ - name: key_name_in_secret
+ value: "agekey"
+ - name: fleet_repo_url
+ - name: sw_catalogs_repo_url
+ - name: mgmt_project_name
+ value: "osm_admin"
+ # Other parameters - Recommended to keep defaults
+ - name: mgmt_cluster_name
+ value: "_management"
+ - name: base_templates_path
+ value: "cloud-resources"
+ - name: cloned_fleet_folder_name
+ value: "fleet-osm"
+ - name: cloned_sw_catalogs_folder_name
+ value: "sw-catalogs-osm"
+ # Debug?
+ - name: debug
+ value: "false"
+
+ container:
+ image: opensourcemano/osm-krm-functions:testing-daily
+ # imagePullPolicy: Always
+ env:
+ - name: PRIVATE_KEY_NEW_CLUSTER
+ valueFrom:
+ secretKeyRef:
+ name: "{{inputs.parameters.secret_name_private_age_key_for_new_cluster}}"
+ key: "{{inputs.parameters.key_name_in_secret}}"
+ - name: DEBUG
+ value: "{{inputs.parameters.debug}}"
+ command: ["/app/scripts/entrypoint.sh"]
+ args:
+ - scale_nodegroup
+ - "{{inputs.parameters.nodegroup_name}}"
+ - "{{inputs.parameters.nodegroup_kustomization_name}}"
+ - "{{inputs.parameters.cluster_name}}"
+ - "{{inputs.parameters.cluster_type}}"
+ - "{{inputs.parameters.node_count}}"
+ - "{{inputs.parameters.public_key_mgmt}}"
+ - "{{inputs.parameters.public_key_new_cluster}}"
+ - ''
+ - "{{inputs.parameters.fleet_mount_path}}/{{inputs.parameters.cloned_fleet_folder_name}}"
+ - "{{inputs.parameters.fleet_repo_url}}"
+ - "{{inputs.parameters.sw_catalogs_mount_path}}/{{inputs.parameters.cloned_sw_catalogs_folder_name}}"
+ - "{{inputs.parameters.sw_catalogs_repo_url}}"
+ - "{{inputs.parameters.mgmt_project_name}}"
+ - "{{inputs.parameters.mgmt_cluster_name}}"
+ - "{{inputs.parameters.base_templates_path}}"
+
+ volumeMounts:
+ - name: fleet-repo-volume
+ mountPath: '{{inputs.parameters.fleet_mount_path}}'
+ - name: sw-catalogs-repo-volume
+ mountPath: '{{inputs.parameters.sw_catalogs_mount_path}}'
+ volumes:
+ - name: fleet-repo-volume
+ persistentVolumeClaim:
+ claimName: '{{inputs.parameters.fleet_volume_name}}'
+ - name: sw-catalogs-repo-volume
+ persistentVolumeClaim:
+ claimName: '{{inputs.parameters.sw_catalogs_volume_name}}'
+ securityContext:
+ runAsUser: 10000
+ # runAsGroup: 10000
+ # fsGroup: 10000
+
+ # Delete nodegroup from **ANY** cluster
+ - name: delete-nodegroup
+ inputs:
+ parameters:
+ # Volumes with cloned repos
+ - name: fleet_volume_name
+ - name: fleet_mount_path
+ value: "/fleet"
+
+ # Specific parameters
+ - name: nodegroup_kustomization_name
+ - name: cluster_name
+ - name: project_name
+ value: "osm_admin"
+
+ # Other parameters - Recommended to keep defaults
+ - name: fleet_repo_dir
+ value: "/fleet/fleet-osm/"
+ - name: mgmt_resources_dir
+ value: "{{inputs.parameters.fleet_repo_dir}}/{{inputs.parameters.project_name}}/managed-resources/_management"
+
+ container:
+ image: opensourcemano/osm-krm-functions:testing-daily
+ # imagePullPolicy: Always
+ command: ["/app/scripts/entrypoint.sh"]
+ args:
+ - delete_nodegroup
+ - "{{inputs.parameters.nodegroup_kustomization_name}}"
+ - "{{inputs.parameters.cluster_name}}"
+ - "{{inputs.parameters.project_name}}"
+ - "{{inputs.parameters.fleet_repo_dir}}"
+ - "{{inputs.parameters.mgmt_resources_dir}}"
+
+ volumeMounts:
+ - name: fleet-repo-volume
+ mountPath: '{{inputs.parameters.fleet_mount_path}}'
+ volumes:
+ - name: fleet-repo-volume
+ persistentVolumeClaim:
+ claimName: '{{inputs.parameters.fleet_volume_name}}'
+ securityContext:
+ runAsUser: 10000
+ # runAsGroup: 10000
+ # fsGroup: 10000
--- /dev/null
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+
+apiVersion: argoproj.io/v1alpha1
+kind: WorkflowTemplate
+metadata:
+ name: full-create-nodegroup-wft
+ namespace: osm-workflows
+
+spec:
+ arguments:
+ parameters:
+
+ # Fleet repo
+ - name: git_fleet_url
+ - name: fleet_destination_folder
+ - name: git_fleet_cred_secret
+
+ # SW-Catalogs repo
+ - name: git_sw_catalogs_url
+ - name: sw_catalogs_destination_folder
+ - name: git_sw_catalogs_cred_secret
+
+ # Specific parameters - Generic cluster creation
+ - name: nodegroup_name
+ - name: nodegroup_kustomization_name
+ - name: cluster_name
+ - name: cluster_type
+ - name: providerconfig_name
+ - name: vm_size
+ - name: node_count
+ - name: cluster_location
+ - name: configmap_name
+ - name: role
+
+ # Specific parameters - Bootstrap and credentials
+ - name: public_key_mgmt
+ - name: public_key_new_cluster
+ - name: secret_name_private_age_key_for_new_cluster
+ - name: key_name_in_secret
+ value: "agekey"
+ # Using `git_fleet_url` instead:
+ # - name: fleet_repo_url
+ # Using `git_sw_catalogs_url` instead:
+ # - name: sw_catalogs_repo_url
+ - name: mgmt_project_name
+ value: "osm_admin"
+
+ # Specific parameters - AKS only
+ - name: rg_name
+ values: ""
+
+ # Specific parameters - GKE only
+ - name: preemptible_nodes
+ values: "false"
+
+ # Advanced parameters - Recommended to keep defaults
+ - name: skip_bootstrap
+ value: "false"
+ - name: mgmt_cluster_name
+ value: "_management"
+ - name: base_templates_path
+ value: "cloud-resources"
+ - name: cloned_fleet_folder_name
+ value: "fleet-osm"
+ - name: cloned_sw_catalogs_folder_name
+ value: "sw-catalogs-osm"
+
+ # Debug/dry run?
+ - name: debug
+ value: "false"
+ - name: dry_run
+ value: "false"
+
+
+ # # Cleanup policy
+ # ttlStrategy:
+ # secondsAfterCompletion: 100 # Time to live after workflow is completed, replaces ttlSecondsAfterFinished
+ # secondsAfterSuccess: 50 # Time to live after workflow is successful
+ # secondsAfterFailure: 50 # Time to live after workflow fails
+
+ entrypoint: create-nodegroup
+
+ templates:
+ # Main template
+ - name: create-nodegroup
+ inputs:
+ parameters:
+ # Fleet repo
+ - name: git_fleet_url
+ - name: fleet_destination_folder
+ - name: git_fleet_cred_secret
+ # SW-Catalogs repo
+ - name: git_sw_catalogs_url
+ - name: sw_catalogs_destination_folder
+ - name: git_sw_catalogs_cred_secret
+ # Specific parameters
+ - name: nodegroup_name
+ - name: nodegroup_kustomization_name
+ - name: cluster_name
+ - name: cluster_type
+ - name: providerconfig_name
+ - name: vm_size
+ - name: node_count
+ - name: cluster_location
+ - name: configmap_name
+ - name: role
+ - name: public_key_mgmt
+ - name: public_key_new_cluster
+ - name: secret_name_private_age_key_for_new_cluster
+ - name: key_name_in_secret
+ # - name: fleet_repo_url
+ # - name: sw_catalogs_repo_url
+ - name: mgmt_project_name
+ - name: skip_bootstrap
+ ## AKS only (otherwise, ignored)
+ - name: rg_name
+ ## GKE only (otherwise, ignored)
+ - name: preemptible_nodes
+ # Other parameters - Recommended to keep defaults
+ - name: mgmt_cluster_name
+ - name: base_templates_path
+ - name: cloned_fleet_folder_name
+ - name: cloned_sw_catalogs_folder_name
+ # Debug/dry run?
+ - name: debug
+ - name: dry_run
+
+ steps:
+ # ------ Preparations for transaction
+ - - name: generate-fleet-volume-repo
+ templateRef:
+ name: k8s-resources-wft
+ template: generate-volume
+ arguments:
+ parameters:
+ - name: pvc-size
+ value: '100Mi'
+ - name: generate-sw-catalogs-volume-repo
+ templateRef:
+ name: k8s-resources-wft
+ template: generate-volume
+ arguments:
+ parameters:
+ - name: pvc-size
+ value: '100Mi'
+ - - name: clone-fleet
+ templateRef:
+ name: git-wft
+ template: git-clone
+ arguments:
+ parameters:
+ - name: mount_path
+ value: "/fleet"
+ - name: repo_url
+ value: "{{inputs.parameters.git_fleet_url}}"
+ - name: destination_folder
+ value: "{{inputs.parameters.fleet_destination_folder}}"
+ - name: git_cred_secret
+ value: "{{inputs.parameters.git_fleet_cred_secret}}"
+ - name: git_volume_name
+ value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
+ - name: clone-sw-catalogs
+ templateRef:
+ name: git-wft
+ template: git-clone
+ arguments:
+ parameters:
+ - name: mount_path
+ value: "/sw-catalogs"
+ - name: repo_url
+ value: "{{inputs.parameters.git_sw_catalogs_url}}"
+ - name: destination_folder
+ value: "{{inputs.parameters.sw_catalogs_destination_folder}}"
+ - name: git_cred_secret
+ value: "{{inputs.parameters.git_sw_catalogs_cred_secret}}"
+ - name: git_volume_name
+ value: '{{steps.generate-sw-catalogs-volume-repo.outputs.parameters.pvc-name}}'
+ # ------ end of preparations for transaction
+
+ # ------ Transformations
+ # Create cluster in target cloud
+ - - name: create-nodegroup
+ templateRef:
+ name: nodegroup-management-wft
+ template: create-nodegroup
+ arguments:
+ parameters:
+ # Volumes with cloned repos
+ - name: fleet_volume_name
+ value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
+ - name: fleet_mount_path
+ value: "/fleet"
+ - name: sw_catalogs_volume_name
+ value: '{{steps.generate-sw-catalogs-volume-repo.outputs.parameters.pvc-name}}'
+ - name: sw_catalogs_mount_path
+ value: "/sw-catalogs"
+ # Specific parameters
+ - name: nodegroup_name
+ value: "{{inputs.parameters.nodegroup_name}}"
+ - name: nodegroup_kustomization_name
+ value: "{{inputs.parameters.nodegroup_kustomization_name}}"
+ - name: cluster_name
+ value: "{{inputs.parameters.cluster_name}}"
+ - name: cluster_type
+ value: "{{inputs.parameters.cluster_type}}"
+ - name: providerconfig_name
+ value: "{{inputs.parameters.providerconfig_name}}"
+ - name: vm_size
+ value: "{{inputs.parameters.vm_size}}"
+ - name: node_count
+ value: "{{inputs.parameters.node_count}}"
+ - name: cluster_location
+ value: "{{inputs.parameters.cluster_location}}"
+ - name: configmap_name
+ value: "{{inputs.parameters.configmap_name}}"
+ - name: role
+ value: "{{inputs.parameters.role}}"
+ - name: public_key_mgmt
+ value: "{{inputs.parameters.public_key_mgmt}}"
+ - name: public_key_new_cluster
+ value: "{{inputs.parameters.public_key_new_cluster}}"
+ - name: secret_name_private_age_key_for_new_cluster
+ value: "{{inputs.parameters.secret_name_private_age_key_for_new_cluster}}"
+ - name: key_name_in_secret
+ value: "{{inputs.parameters.key_name_in_secret}}"
+ ## Fed with `git_fleet_url` to avoid duplicates
+ - name: fleet_repo_url
+ value: "{{inputs.parameters.git_fleet_url}}"
+ ## Fed with `git_sw_catalogs_url` to avoid duplicates
+ - name: sw_catalogs_repo_url
+ value: "{{inputs.parameters.git_sw_catalogs_url}}"
+ - name: mgmt_project_name
+ value: "{{inputs.parameters.mgmt_project_name}}"
+ - name: skip_bootstrap
+ value: "{{inputs.parameters.skip_bootstrap}}"
+ ## AKS only
+ - name: rg_name
+ value: "{{inputs.parameters.rg_name}}"
+ ## GKE only
+ - name: preemptible_nodes
+ value: "{{inputs.parameters.preemptible_nodes}}"
+ # Other parameters - Recommended to keep defaults
+ - name: mgmt_cluster_name
+ value: "{{inputs.parameters.mgmt_cluster_name}}"
+ - name: base_templates_path
+ value: "{{inputs.parameters.base_templates_path}}"
+ - name: cloned_fleet_folder_name
+ value: "{{inputs.parameters.cloned_fleet_folder_name}}"
+ - name: cloned_sw_catalogs_folder_name
+ value: "{{inputs.parameters.cloned_sw_catalogs_folder_name}}"
+ # Debug?
+ - name: debug
+ value: "{{inputs.parameters.debug}}"
+ # ------ end of transformations
+
+ # ------ Commit transaction
+ - - name: push-to-fleet
+ templateRef:
+ name: git-wft
+ template: git-commit-merge-push
+ arguments:
+ parameters:
+ - name: mount_path
+ value: "/fleet"
+ - name: repo_folder
+ value: "{{inputs.parameters.fleet_destination_folder}}"
+ - name: git_cred_secret
+ value: "{{inputs.parameters.git_fleet_cred_secret}}"
+ - name: git_volume_name
+ value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
+ - name: commit_message
+ value: "Create nodegroup {{inputs.parameters.nodegroup_kustomization_name}} at {{inputs.parameters.cluster_location}}"
+ - name: main_branch
+ value: main
+ - name: contrib_branch
+ value: osm_contrib
+ - name: dry_run
+ value: "{{inputs.parameters.dry_run}}"
+# ------ end of commit transaction
--- /dev/null
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+
+apiVersion: argoproj.io/v1alpha1
+kind: WorkflowTemplate
+metadata:
+ name: full-delete-nodegroup-wft
+ namespace: osm-workflows
+
+spec:
+ arguments:
+ parameters:
+
+ # Fleet repo
+ - name: git_fleet_url
+ - name: fleet_destination_folder
+ - name: git_fleet_cred_secret
+
+ # Specific parameters
+ - name: nodegroup_kustomization_name
+ - name: cluster_name
+ - name: project_name
+ value: "osm_admin"
+
+ # Debugging
+ - name: dry_run
+ value: false
+
+
+ # # Cleanup policy
+ # ttlStrategy:
+ # secondsAfterCompletion: 100 # Time to live after workflow is completed, replaces ttlSecondsAfterFinished
+ # secondsAfterSuccess: 50 # Time to live after workflow is successful
+ # secondsAfterFailure: 50 # Time to live after workflow fails
+
+ entrypoint: delete-nodegroup
+
+ templates:
+
+ # Main template
+ - name: delete-nodegroup
+ inputs:
+ parameters:
+ # Git repos
+ - name: git_fleet_url
+ - name: fleet_destination_folder
+ - name: git_fleet_cred_secret
+
+ # Specific parameters
+ - name: nodegroup_kustomization_name
+ - name: cluster_name
+ - name: project_name
+
+ # Debugging
+ - name: dry_run
+
+ steps:
+
+ # ------ Preparations for transaction
+ - - name: generate-fleet-volume-repo
+ templateRef:
+ name: k8s-resources-wft
+ template: generate-volume
+ arguments:
+ parameters:
+ - name: pvc-size
+ value: '100Mi'
+ - - name: clone-fleet
+ templateRef:
+ name: git-wft
+ template: git-clone
+ arguments:
+ parameters:
+ - name: mount_path
+ value: "/fleet"
+ - name: repo_url
+ value: "{{inputs.parameters.git_fleet_url}}"
+ - name: destination_folder
+ value: "{{inputs.parameters.fleet_destination_folder}}"
+ - name: git_cred_secret
+ value: "{{inputs.parameters.git_fleet_cred_secret}}"
+ - name: git_volume_name
+ value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
+ # ------ end of preparations for transaction
+
+ # ------ Transformations
+ - - name: delete-nodegroup
+ templateRef:
+ name: nodegroup-management-wft
+ template: delete-nodegroup
+ arguments:
+ parameters:
+ # Volumes with cloned repos
+ - name: fleet_volume_name
+ value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
+ - name: fleet_mount_path
+ value: "/fleet"
+ # Specific parameters
+ - name: nodegroup_kustomization_name
+ value: "{{inputs.parameters.nodegroup_kustomization_name}}"
+ - name: cluster_name
+ value: "{{inputs.parameters.cluster_name}}"
+ - name: project_name
+ value: "{{inputs.parameters.project_name}}"
+ # ------ end of transformations
+
+ # ------ Commit transaction
+ - - name: push-to-fleet
+ templateRef:
+ name: git-wft
+ template: git-commit-merge-push
+ arguments:
+ parameters:
+ - name: mount_path
+ value: "/fleet"
+ - name: repo_folder
+ value: "{{inputs.parameters.fleet_destination_folder}}"
+ - name: git_cred_secret
+ value: "{{inputs.parameters.git_fleet_cred_secret}}"
+ - name: git_volume_name
+ value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
+ - name: commit_message
+ value: "Delete nodegroup {{inputs.parameters.nodegroup_kustomization_name}}"
+ - name: main_branch
+ value: main
+ - name: contrib_branch
+ value: osm_contrib
+ - name: dry_run
+ value: "{{inputs.parameters.dry_run}}"
+# ------ end of commit transaction
--- /dev/null
+#######################################################################################
+# Copyright ETSI Contributors and Others.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+# implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#######################################################################################
+
+apiVersion: argoproj.io/v1alpha1
+kind: WorkflowTemplate
+metadata:
+ name: full-scale-nodegroup-wft
+ namespace: osm-workflows
+
+spec:
+ arguments:
+ parameters:
+
+ # Fleet repo
+ - name: git_fleet_url
+ - name: fleet_destination_folder
+ - name: git_fleet_cred_secret
+
+ # SW-Catalogs repo
+ - name: git_sw_catalogs_url
+ - name: sw_catalogs_destination_folder
+ - name: git_sw_catalogs_cred_secret
+
+ # Specific parameters - Generic cluster creation
+ - name: nodegroup_name
+ - name: nodegroup_kustomization_name
+ - name: cluster_name
+ - name: cluster_type
+ - name: node_count
+
+ # Specific parameters - Bootstrap and credentials
+ - name: public_key_mgmt
+ - name: public_key_new_cluster
+ - name: secret_name_private_age_key_for_new_cluster
+ - name: key_name_in_secret
+ value: "agekey"
+ # Using `git_fleet_url` instead:
+ # - name: fleet_repo_url
+ # Using `git_sw_catalogs_url` instead:
+ # - name: sw_catalogs_repo_url
+ - name: mgmt_project_name
+ value: "osm_admin"
+
+ # Advanced parameters - Recommended to keep defaults
+ - name: mgmt_cluster_name
+ value: "_management"
+ - name: base_templates_path
+ value: "cloud-resources"
+ - name: cloned_fleet_folder_name
+ value: "fleet-osm"
+ - name: cloned_sw_catalogs_folder_name
+ value: "sw-catalogs-osm"
+
+ # Debug/dry run?
+ - name: debug
+ value: "false"
+ - name: dry_run
+ value: "false"
+
+
+ # # Cleanup policy
+ # ttlStrategy:
+ # secondsAfterCompletion: 100 # Time to live after workflow is completed, replaces ttlSecondsAfterFinished
+ # secondsAfterSuccess: 50 # Time to live after workflow is successful
+ # secondsAfterFailure: 50 # Time to live after workflow fails
+
+ entrypoint: scale-nodegroup
+
+ templates:
+ # Main template
+ - name: scale-nodegroup
+ inputs:
+ parameters:
+ # Fleet repo
+ - name: git_fleet_url
+ - name: fleet_destination_folder
+ - name: git_fleet_cred_secret
+ # SW-Catalogs repo
+ - name: git_sw_catalogs_url
+ - name: sw_catalogs_destination_folder
+ - name: git_sw_catalogs_cred_secret
+ # Specific parameters
+ - name: nodegroup_name
+ - name: nodegroup_kustomization_name
+ - name: cluster_name
+ - name: cluster_type
+ - name: node_count
+ - name: public_key_mgmt
+ - name: public_key_new_cluster
+ - name: secret_name_private_age_key_for_new_cluster
+ - name: key_name_in_secret
+ # - name: fleet_repo_url
+ # - name: sw_catalogs_repo_url
+ - name: mgmt_project_name
+ # Other parameters - Recommended to keep defaults
+ - name: mgmt_cluster_name
+ - name: base_templates_path
+ - name: cloned_fleet_folder_name
+ - name: cloned_sw_catalogs_folder_name
+ # Debug/dry run?
+ - name: debug
+ - name: dry_run
+
+ steps:
+ # ------ Preparations for transaction
+ - - name: generate-fleet-volume-repo
+ templateRef:
+ name: k8s-resources-wft
+ template: generate-volume
+ arguments:
+ parameters:
+ - name: pvc-size
+ value: '100Mi'
+ - name: generate-sw-catalogs-volume-repo
+ templateRef:
+ name: k8s-resources-wft
+ template: generate-volume
+ arguments:
+ parameters:
+ - name: pvc-size
+ value: '100Mi'
+ - - name: clone-fleet
+ templateRef:
+ name: git-wft
+ template: git-clone
+ arguments:
+ parameters:
+ - name: mount_path
+ value: "/fleet"
+ - name: repo_url
+ value: "{{inputs.parameters.git_fleet_url}}"
+ - name: destination_folder
+ value: "{{inputs.parameters.fleet_destination_folder}}"
+ - name: git_cred_secret
+ value: "{{inputs.parameters.git_fleet_cred_secret}}"
+ - name: git_volume_name
+ value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
+ - name: clone-sw-catalogs
+ templateRef:
+ name: git-wft
+ template: git-clone
+ arguments:
+ parameters:
+ - name: mount_path
+ value: "/sw-catalogs"
+ - name: repo_url
+ value: "{{inputs.parameters.git_sw_catalogs_url}}"
+ - name: destination_folder
+ value: "{{inputs.parameters.sw_catalogs_destination_folder}}"
+ - name: git_cred_secret
+ value: "{{inputs.parameters.git_sw_catalogs_cred_secret}}"
+ - name: git_volume_name
+ value: '{{steps.generate-sw-catalogs-volume-repo.outputs.parameters.pvc-name}}'
+ # ------ end of preparations for transaction
+
+ # ------ Transformations
+ # Create cluster in target cloud
+ - - name: scale-nodegroup
+ templateRef:
+ name: nodegroup-management-wft
+ template: scale-nodegroup
+ arguments:
+ parameters:
+ # Volumes with cloned repos
+ - name: fleet_volume_name
+ value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
+ - name: fleet_mount_path
+ value: "/fleet"
+ - name: sw_catalogs_volume_name
+ value: '{{steps.generate-sw-catalogs-volume-repo.outputs.parameters.pvc-name}}'
+ - name: sw_catalogs_mount_path
+ value: "/sw-catalogs"
+ # Specific parameters
+ - name: nodegroup_name
+ value: "{{inputs.parameters.nodegroup_name}}"
+ - name: nodegroup_kustomization_name
+ value: "{{inputs.parameters.nodegroup_kustomization_name}}"
+ - name: cluster_name
+ value: "{{inputs.parameters.cluster_name}}"
+ - name: cluster_type
+ value: "{{inputs.parameters.cluster_type}}"
+ - name: node_count
+ value: "{{inputs.parameters.node_count}}"
+ - name: public_key_mgmt
+ value: "{{inputs.parameters.public_key_mgmt}}"
+ - name: public_key_new_cluster
+ value: "{{inputs.parameters.public_key_new_cluster}}"
+ - name: secret_name_private_age_key_for_new_cluster
+ value: "{{inputs.parameters.secret_name_private_age_key_for_new_cluster}}"
+ - name: key_name_in_secret
+ value: "{{inputs.parameters.key_name_in_secret}}"
+ ## Fed with `git_fleet_url` to avoid duplicates
+ - name: fleet_repo_url
+ value: "{{inputs.parameters.git_fleet_url}}"
+ ## Fed with `git_sw_catalogs_url` to avoid duplicates
+ - name: sw_catalogs_repo_url
+ value: "{{inputs.parameters.git_sw_catalogs_url}}"
+ - name: mgmt_project_name
+ value: "{{inputs.parameters.mgmt_project_name}}"
+ # Other parameters - Recommended to keep defaults
+ - name: mgmt_cluster_name
+ value: "{{inputs.parameters.mgmt_cluster_name}}"
+ - name: base_templates_path
+ value: "{{inputs.parameters.base_templates_path}}"
+ - name: cloned_fleet_folder_name
+ value: "{{inputs.parameters.cloned_fleet_folder_name}}"
+ - name: cloned_sw_catalogs_folder_name
+ value: "{{inputs.parameters.cloned_sw_catalogs_folder_name}}"
+ # Debug?
+ - name: debug
+ value: "{{inputs.parameters.debug}}"
+ # ------ end of transformations
+
+ # ------ Commit transaction
+ - - name: push-to-fleet
+ templateRef:
+ name: git-wft
+ template: git-commit-merge-push
+ arguments:
+ parameters:
+ - name: mount_path
+ value: "/fleet"
+ - name: repo_folder
+ value: "{{inputs.parameters.fleet_destination_folder}}"
+ - name: git_cred_secret
+ value: "{{inputs.parameters.git_fleet_cred_secret}}"
+ - name: git_volume_name
+ value: '{{steps.generate-fleet-volume-repo.outputs.parameters.pvc-name}}'
+ - name: commit_message
+ value: "Scale nodegroup {{inputs.parameters.nodegroup_kustomization_name}} in {{inputs.parameters.cluster_name}}"
+ - name: main_branch
+ value: main
+ - name: contrib_branch
+ value: osm_contrib
+ - name: dry_run
+ value: "{{inputs.parameters.dry_run}}"
+# ------ end of commit transaction