Help Center/ Cloud Container Engine/ API Reference/ Appendix/ Specifying Add-ons to Be Installed During Cluster Creation
Updated on 2024-11-06 GMT+08:00

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.

Table 1 Value data structure

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 CCE Container Storage (Everest) add-ons are installed in the cluster by default. For details about the parameter values, see Table 2.

Table 2 Data structure of the AddonTemplate field

Parameter

Mandatory

Type

Description

addonTemplateName

Yes

String

Add-on name.

Options:

  • coredns: Install CoreDNS.
  • everest: Install CCE Container Storage (Everest).
  • node-local-dns: Install NodeLocal DNSCache.
  • volcano: Install Volcano Scheduler.
  • npd: Install CCE Node Problem Detector.
  • cie-collector: Install Cloud Native Cluster Monitoring.
  • log-agent: Install Cloud Native Logging.
  • virtual-kubelet: Install CCE Cloud Bursting Engine for CCI.

version

No

String

Add-on version.

To view the add-on version, log in to the CCE console, choose Add-ons in the navigation pane, click the name of the target add-on, and check the change history. If this parameter is left blank, the latest version is used by default.

values

No

Json Map

  • CoreDNS: For details about the parameters required for installing the add-on, see CoreDNS.
  • Cloud Native Cluster Monitoring: For details about the parameters required for installing the add-on, see Cloud Native Cluster Monitoring.
  • Cloud Native Logging: For details about the parameters required for installing the add-on, see Cloud Native Logging.
  • CCE Cloud Bursting Engine for CCI: For details about the parameters required for installing the add-on, see CCE Cloud Bursting Engine for CCI.
NOTE:

You do not need to specify this parameter when installing the CCE Container Storage (Everest), NodeLocal DNSCache, Volcano Scheduler, or CCE Node Problem Detector add-on.

Example Request

Create a cluster using a VPC network and install CoreDNS and CCE Container Storage (Everest) in it.

{
	"kind": "Cluster",
	"apiVersion": "v3",
	"metadata": {
		"name": "test",
		"annotations": {
			"cluster.install.addons.external/install": "[{\"addonTemplateName\":\"icagent\",\"extendParam\":{\"logSwitch\":\"false\",\"tDSEnable\":\"false\"}}]",
			"cluster.install.addons/install": "[{\"addonTemplateName\":\"coredns\",\"values\":{\"flavor\":{\"is_default\":false,\"name\":2500,\"recommend_cluster_flavor_types\":[\"small\"],\"replicas\":2,\"resources\":[{\"limitsCpu\":\"500m\",\"limitsMem\":\"512Mi\",\"name\":\"coredns\",\"replicas\":2,\"requestsCpu\":\"500m\",\"requestsMem\":\"512Mi\"}],\"size\":\"small\",\"category\":[\"CCE\",\"Turbo\"]}}},{\"addonTemplateName\":\"everest\"}]"
		}
	},
	"spec": {
		"category": "CCE",
		"flavor": "cce.s1.small",
		"version": "v1.29",
		"type": "VirtualMachine",
		"hostNetwork": {
			"vpc": "*****",
			"subnet": "*****"
		},
		"containerNetwork": {
			"mode": "vpc-router",
			"cidrs": [
				{
					"cidr": "10.0.0.0/16"
				}
			]
		},
		"ipv6enable": false,
		"description": "",
		"billingMode": 0,
		"kubeProxyMode": "iptables",
		"extendParam": {
			"alpha.cce/fixPoolMask": "25",
			"enterpriseProjectId": "0"
		},
		"authentication": {
			"mode": "rbac"
		},
		"configurationsOverride": [
			{
				"name": "kube-apiserver",
				"configurations": [
					{
						"name": "support-overload",
						"value": true
					}
				]
			}
		],
		"deletionProtection": false,
		"serviceNetwork": {
			"IPv4CIDR": "10.247.0.0/16"
		}
	}
}