If you use Resource Orchestration Service (ROS) to create a stack that manages multiple categories of resources, the parameters for different resources may conflict with each other. You can use Metadata to group these parameters so that you can configure them in the ROS console in a centralized manner.
Background information
Metadata groups the parameters defined in the Parameters section and assigns a label to each group. The following example uses the Deploy a Harbor Cluster (Existing VPC) template to demonstrate how to group parameters. For more information about the template, go to the Deploy a Harbor Cluster (Existing VPC) page.
The following parameter groups are configured to deploy a Harbor cluster:
-
Infrastructure Configuration
-
Harbor Configuration
-
DB Configuration
-
Redis Configuration
-
SLB Configuration
You can add the parameters for each group to the Parameters section of the corresponding group. The following sample code shows an example of Metadata:
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- VSwitchZoneId
- VPC
- VSwitch
- SecurityGroup
Label:
default:
en: Infrastructure Configuration
- Parameters:
- ClusterAmount
- InstanceType
- SystemDiskCategory
- SystemDiskSize
- Password
- HarborAdminPassword
Label:
default:
en: Harbor Configuration
- Parameters:
- DBInstanceEngineAndVersion
- DBInstanceClass
- DBInstanceStorage
- DBUser
- DBPassword
Label:
default:
en: DB Configuration
- Parameters:
- RedisInstanceClass
- EvictionPolicy
- RedisPassword
Label:
default:
en: Redis Configuration
- Parameters:
- LoadBalancerSpec
- Bandwidth
Label:
default:
en: SLB Configuration
TemplateTags:
- Creates one ECS(Harbor) instance - Existing Vpc
Procedure
-
Log in to the ROS console.
-
In the left-side navigation pane, choose Public Templates.
-
Search for the Deploy a Harbor Cluster (Existing VPC) template.
-
Click Create Stack.
-
In the Configure Parameters step, specify the Stack Name parameter and configure parameters in the Infrastructure Configuration, Harbor Configuration, DB Configuration, Redis Configuration, and SLB Configuration sections.
-
Click Next:Check and Confirm. Then, click Create.