After you install and configure the VNodectl command-line tool, you can use VNodectl to manage VNodes and add-ons. This topic describes common commands for VNodectl.
You can add
--dryto vnode commands for client verification.If an API version compatibility error occurs when you run a vnode command, add
--kubernetes-versionto specify the Kubernetes version of the cluster.
Manage VNodes
Before you use the following commands to manage VNodes, make sure that the ~/.vnode/config file exists and the configurations of the file are correct.
create
"create" commands are used to create VNodes.
Syntax
vnode create [--vswitch-id] [--security-group-id] [--custom-resources] [--cluster-dns] [--cluster-domain]Parameter description
Parameter
Description
Example
--vswitch-id
The ID of the vSwitch to which the VNode is connected.
--vswitch-id vsw-7xv2yk45qp5etidgf****
--security-group-id
The ID of the security group to which the VNode belongs.
--security-group-id sg-7xv5tcch4kjdr65t****
--custom-resources
The custom resources supported by the VNode. If a custom resource is specified in the request of an Elastic Container Instance pod, the pod is scheduled to run on the VNode that supports the custom resource.
You can specify custom resources in the
Resource name=Number of resourcesformat. Separate multiple resources with commas (,).--custom-resources example1.com=10000,example2.com=20000
--cluster-dns
The IP addresses of the Alibaba Cloud DNS (DNS) server. If dnsPolicy of the pod is set to
ClusterFirst, Alibaba Cloud uses the value of this parameter to provide DNS services to containers.You can specify multiple IP addresses. Separate multiple IP addresses with commas (,).
--cluster-dns 192.168.XX.XX
--cluster-domain
The domain name of the cluster. If you configure this parameter together with the search domain of the host, Kubelet configures all containers to search for the specified domain name.
--cluster-domain example.com
Examples
Example 1: Create a VNode without using parameters

Example 2: Configure customResources

After the VNode is created, you can run the
kubectl describe nodecommand to view the details of the VNode. The custom resources that you configured are displayed in theCapacitysection andAllocatablesection.
Example 3: Configure clusterDNS and clusterDomain

After the VNode is created, you can run the
kubectl describe podcommand to view the details of the pods that are scheduled to run on the VNode. In theannotationssection, the values of clusterDNS and clusterDomain are displayed.
list
"list" commands are used to query the status of VNodes.
Syntax
vnode listExamples

describe
"describe" commands are used to view the details of VNodes.
Syntax
vnode describe <vnode id>Examples

update
"update" commands are used to update the configurations of a specified VNode. You can update the vSwitch, security group, customResources, clusterDNS, and clusterDomain of a VNode.
Syntax
vnode update <vnode id> [--vswitch-id] [--security-group-id] [--custom-resources] [--cluster-dns] [--cluster-domain]Parameter description
ImportantIf you run an update command to update the configurations of a VNode, the passed parameter values overwrite the original parameter values. For example, if
--custom-resources example1.com=10000is specified for a VNode and you want to add 10000 example2.com to the original custom resources, you must specify--custom-resources example1.com=10000,example2.com=10000.Parameter
Description
Example
--vswitch-id
The ID of the vSwitch to which the VNode is connected.
--vswitch-id vsw-7xv2yk45qp5etidgf****
--security-group-id
The ID of the security group to which the VNode belongs.
--security-group-id sg-7xv5tcch4kjdr65t****
--custom-resources
The custom resources supported by the VNode. If a custom resource is specified in the request of an Elastic Container Instance pod, the pod is scheduled to run on the VNode that supports the custom resource.
You can specify custom resources in the
Resource name=Number of resourcesformat. Separate multiple resources with commas (,).--custom-resources example1.com=10000,example2.com=20000
--cluster-dns
The IP addresses of the Alibaba Cloud DNS (DNS) server. If dnsPolicy of the pod is set to
ClusterFirst, Alibaba Cloud uses the value of this parameter to provide DNS services to containers.You can specify multiple IP addresses. Separate multiple IP addresses with commas (,).
--cluster-dns 192.168.XX.XX
--cluster-domain
The domain name of the cluster. If you configure this parameter together with the search domain of the host, Kubelet configures all containers to search for the specified domain name.
--cluster-domain example.com
Examples

delete
"delete" commands are used to delete specified VNodes. Before you delete a VNode, make sure that no elastic container instance exists on the VNode.
Syntax
vnode delete <vnode id>Examples

Manage components
VNodectl can also manage the eci-profile component and vnode-approver component.
addon list
"addon list" commands are used to list available add-ons.
Syntax
vnode addon list --kubeconfig /path/to/kubeconfigExamples

addon enable
"addon enable" commands are used to load add-ons.
Syntax
vnode addon enable <plug-in name> --kubeconfig /path/to/kubeconfigExamples

addon disable
"addon disable" commands are used to uninstall add-ons.
Syntax
vnode addon disable <plug-in name> --kubeconfig /path/to/kubeconfigExamples

Clear configurations of clusters
cluster clean
"cluster clean" commands are used to clear the configurations of clusters. If you no longer use a VNode, you can run cluster clean commands to clear the VNode configurations of the cluster.
Syntax
vnode cluster clean --kubeconfig <Path to the kubeconfig file> [--bootstrap]Examples
If you previously used a regular mode to configure the cluster, you can use the following command to clear the VNode configurations of the cluster:
vnode cluster clean --kubeconfig /path/to/kubeconfigIf you previously used the TLS boostrapping mode to configure the cluster, you can use the following command to clear the VNode configurations of the cluster:
vnode cluster clean --kubeconfig /path/to/kubeconfig --bootstrap