Specifying Add-ons to Be Installed During Cluster Creation
When creating a cluster, you can add a key-value pair to annotations of the metadata field in the request body to install an add-on in the cluster. The key is cluster.install.addons/install, and the value is a JSON array of AddonTemplate.
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
Value |
Yes |
JSON array of AddonTemplate string |
Add-on to be installed in the cluster. If this parameter is not specified, the coredns and storage-driver add-ons are installed by default for clusters of Kubernetes 1.13 and earlier versions, and the coredns, everest, and npd add-ons are installed by default for clusters of Kubernetes 1.15 and later versions. For details, see Table 2. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
addonTemplateName |
Yes |
String |
Add-on name. The value can be coredns, autoscaler, gpu-beta, or storage-driver. |
version |
No |
String |
Add-on version. To view the add-on version information, log in to the CCE console, click Add-ons in the navigation pane. Click the target add-on name. On the Version History tab page, you can view the versions of the add-on. If this parameter is left blank, the latest version is used by default. |
values |
No |
Json Map |
Parameters to be set for installing an add-on.
NOTE:
You do not need to set this parameter when installing the storage-driver add-on. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
flavor |
Yes |
flavor object |
Add-on specifications. |
custom |
Yes |
custom object |
Custom coredns parameters. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
description |
Yes |
String |
Specification description. |
name |
Yes |
String |
Flavor name. |
replicas |
Yes |
Integer |
Number of pods. |
resources |
Yes |
resource object |
Add-on resources. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
name |
Yes |
String |
Resource name. |
limitsCpu |
Yes |
String |
CPU quota limit. |
limitsMem |
Yes |
String |
Memory quota limit. |
requestsCpu |
Yes |
String |
Requested CPU. |
requestsMem |
Yes |
String |
Requested memory. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
stub_domains |
No |
Json Map |
JSON map that uses the DNS suffix key (such as acme.local) and the value composed of the JSON array of the DNS IP address. |
upstream_nameservers |
No |
Json Array |
The value of this parameter replaces the name server value obtained from /etc/resolv.conf of the node by default. Restriction: A maximum of three upstream name servers can be specified. |
tenant_id |
Yes |
String |
Project ID. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
flavor |
Yes |
flavor Object |
Add-on specifications. |
custom |
Yes |
custom object |
Custom autoscaler parameters. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
coresTotal |
Yes |
Integer |
Maximum and minimum number of cores of a cluster. The format is <min>:<max>. The autoscaler add-on performs cluster scaling within this range. |
maxEmptyBulkDeleteFlag |
Yes |
Integer |
Maximum number of empty nodes that can be deleted at a time. |
maxNodesTotal |
Yes |
Integer |
Maximum number of nodes in all node groups. The autoscaler add-on performs cluster scaling within this range. |
memoryTotal |
Yes |
Integer |
Maximum and minimum size of memory of a cluster. The format is <min>:<max>. The autoscaler add-on performs cluster scaling within this range. |
scaleDownDelayAfterAdd |
Yes |
Integer |
Interval for performing scale-down evaluation after a scale-up. |
scaleDownDelayAfterDelete |
Yes |
Integer |
Interval for performing scale-down evaluation after nodes are deleted. The default value is scanInterval. |
scaleDownDelayAfterFailure |
Yes |
Integer |
Interval for performing scale-down evaluation after a scale-down failure. |
scaleDownEnabled |
Yes |
Boolean |
Whether to enable cluster scaling down. |
scaleDownUnneededTime |
Yes |
Integer |
Time waited to start a scale-down after a node has reached the scale-down threshold. |
scaleDownUtilizationThreshold |
Yes |
Float |
Threshold percentage of the total CPU or memory occupied by all pods running on the node to the allocatable resources on the node. When the actual percentage is lower than this threshold, node scale-down is triggered. |
scaleUpCpuUtilizationThreshold |
Yes |
Float |
CPU usage threshold for triggering scale-up. |
scaleUpMemUtilizationThreshold |
Yes |
Float |
Memory usage threshold for triggering scale-up. |
scaleUpUnscheduledPodEnabled |
Yes |
Boolean |
Scale-up is triggered when there are unscheduled pods. |
scaleUpUtilizationEnabled |
Yes |
Boolean |
Scale-up is triggered when the resource usage reaches the threshold. |
tenant_id |
Yes |
String |
Project ID. |
unremovableNodeRecheckTimeout |
Yes |
Integer |
Interval for checking whether a node can be removed. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
custom |
Yes |
custom object |
Customer parameters of gpu-beta. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
is_driver_from_nvidia |
Yes |
Boolean |
Whether to use the NVIDIA driver. Set this parameter to true. |
nvidia_driver_download_url |
Yes |
String |
Driver downloading URL. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
type |
Yes |
String |
Cluster type. Possible values:
|
flavor |
Yes |
String |
Cluster flavor, which cannot be changed after the cluster is created.
NOTE:
|
version |
No |
String |
Cluster's baseline Kubernetes version. The latest version is recommended.
NOTE:
If this parameter is left blank, the cluster of the latest version is created by default. |
description |
No |
String |
Cluster description, for example, which purpose the cluster is intended to serve. By default, this parameter is left unspecified. To modify cluster description after the cluster is created, call the API used to update information about a specified cluster or go to the cluster details page on the CCE console. |
ipv6enable |
No |
Boolean |
Whether the cluster supports IPv6. Clusters of version 1.15 and later support IPv6. |
hostNetwork |
Yes |
HostNetwork object |
Node networking parameters, including VPC and subnet ID. hostNetwork is mandatory because nodes in a cluster communicate with each other by using a VPC. |
containerNetwork |
Yes |
ContainerNetwork object |
Container networking parameters, including the container network model and container CIDR block. |
authentication |
No |
Authentication object |
Configurations of the cluster authentication mode. |
kubernetesSvcIpRange |
No |
String |
Service CIDR block or the IP address range which the kubernetes clusterIp must fall within. This parameter is available only for clusters of v1.11.7 and later. |
billingMode |
No |
Integer |
Billing mode of a cluster. Currently, only pay-per-use clusters can be created. Value 0 indicates pay-per-use. If this parameter is left unspecified, the default value 0 is used. |
masters |
No |
MasterSpec object |
Advanced configurations of the master node |
extendParam |
No |
Map<String,String> |
Extended fields in the format of key-value pairs. You can configure multi-AZ clusters and dedicated hybrid clusters. |
Request Example
{ "kind" : "Cluster", "apiVersion" : "v3", "metadata" : { "name" : "mycluster", "labels" : { "foo" : "bar" }, "annotations" : { "cluster.install.addons/install" : "[{\"addonTemplateName\":\"autoscaler\",\"version\":\"1.15.11\",\"values\":{\"flavor\":{\"description\":\"Has only one instance\",\"name\":\"Single\",\"replicas\":1,\"resources\":[{\"limitsCpu\":\"90m\",\"limitsMem\":\"200Mi\",\"name\":\"autoscaler\",\"requestsCpu\":\"50m\",\"requestsMem\":\"100Mi\"}]},\"custom\":{\"coresTotal\":32000,\"maxEmptyBulkDeleteFlag\":10,\"maxNodesTotal\":1000,\"memoryTotal\":128000,\"scaleDownDelayAfterAdd\":10,\"scaleDownDelayAfterDelete\":10,\"scaleDownDelayAfterFailure\":3,\"scaleDownEnabled\":false,\"scaleDownUnneededTime\":10,\"scaleDownUtilizationThreshold\":0.5,\"scaleUpCpuUtilizationThreshold\":1,\"scaleUpMemUtilizationThreshold\":1,\"scaleUpUnscheduledPodEnabled\":true,\"scaleUpUtilizationEnabled\":true,\"tenant_id\":\"22a8a02394794b908d256103a5b63c65\",\"unremovableNodeRecheckTimeout\":5}}},{\"addonTemplateName\":\"coredns\",\"version\":\"1.15.3\",\"values\":{\"flavor\":{\"description\":\"Has two instances\",\"name\":2500,\"replicas\":2,\"resources\":[{\"limitsCpu\":\"500m\",\"limitsMem\":\"512Mi\",\"name\":\"coredns\",\"requestsCpu\":\"500m\",\"requestsMem\":\"512Mi\"}]},\"custom\":{\"stub_domains\":{},\"upstream_nameservers\":[],\"tenant_id\":\"22a8a02394794b908d256103a5b63c65\"}}},{\"addonTemplateName\":\"gpu-beta\",\"version\":\"1.1.7\",\"values\":{\"custom\":{\"is_driver_from_nvidia\":true,\"nvidia_driver_download_url\":\"https://us.download.nvidia.com/tesla/396.37/NVIDIA-Linux-x86_64-396.37.run\"}}},{\"addonTemplateName\":\"storage-driver\",\"version\":\"\"}]" } }, "spec" : { "type" : "VirtualMachine", "flavor" : "cce.s1.small", "version" : "v1.15.11", "description" : "this is a demo cluster", "hostNetwork" : { "vpc" : "1cb74d47-8e09-4d14-a065-75f4fc03e5eb", "subnet" : "d44c089c-fbdc-49b3-ae8f-7b42c64219cf" }, "containerNetwork" : { "mode" : "overlay_l2", "cidr" : "172.16.0.0/16" }, "extendParam" : { "foo" : "bar" } } }
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot