Skip to main content
Use the ZEDEDA CLI (ZCLI) to manage cluster instances from the command line. This article covers zcli cluster-instance commands, with syntax and examples for each operation. A cluster instance is a Kubernetes cluster that runs inside edge applications. You choose an edge app that packages the Kubernetes distribution and a pool of edge nodes, and Edge Infrastructure Services deploys the edge app on those nodes as Kubernetes server and agent nodes. ZCLI supports two cluster types:
  • k3s, a K3s cluster.
  • tkg-attach, a cluster that is attached to VMware Tanzu Kubernetes Grid (TKG). The edge app is a virtual machine edge app with the TKG Attach deployment type.
The cluster can be onboarded to an external Kubernetes manager. With manual onboarding, you give a call-home URL. With automatic onboarding, Edge Infrastructure Services onboards the cluster through an orchestrator integration plugin, for example for Rancher. Cluster instances are separate from ZEDEDA Edge Kubernetes Service clusters, which run on node clusters of edge nodes running EVE-k, and which you manage with zcli edge-kubernetes-cluster. See Manage ZEDEDA Edge Kubernetes Service Clusters and Manage Node Clusters. The zcli edge-kubernetes-cluster and zcli edge-kubernetes-cluster-group commands do not act on cluster instances.

Before You Start

  • ZCLI is installed and authenticated against your enterprise. See Get Started.
  • You have a role that allows you to deploy edge apps in the project. [TBD: confirm the minimum role required to create and delete cluster instances with ZCLI.]
  • The project, the edge app, and the edge nodes exist. See Manage Edge Apps and Manage Nodes.
  • For automatic onboarding, an orchestrator integration plugin exists in your enterprise. To list plugins, run zcli plugin show.

Create a Cluster Instance

ZCLI creates the cluster instance in the active state. create prints nothing when it succeeds. To check the result, see View Cluster Instances. Example, a K3s cluster on every edge node tagged site:factory-1, with manual onboarding:
Example, a TKG Attach cluster on one edge node, with automatic onboarding and the interface connected to a tagged virtual network:
The examples in zcli cluster-instance --help leave out --onboard-type. That flag is required, so those examples fail with a usage error.
ZCLI checks very few values before it sends the request:
  • ZCLI does not check the project, edge app, edge node, or orchestrator plugin names. If a name does not exist, ZCLI sends an empty ID for it.
  • A --cluster-type or --onboard-type value other than the listed lowercase values is sent as an unspecified type, with no error from ZCLI.
  • If an --edge-node-pool-tag value is not in key:value format, ZCLI prints Please provide tag values as key-value pairs. Example: region:India but still sends the request, with no edge nodes selected. A bad --tags value is dropped in the same way.
Check each name and value before you run create.

Cluster configuration file

The cluster configuration file sets the size of the cluster. Each setting is on its own line, in key=value format. The following example is the sample file that ships with ZCLI:
All six size settings are required. If one is missing, ZCLI prints Fields missing in cluster config. Refer to example supplicant file at /zcli/config_templates/cluster-inst.conf and does not create the cluster instance. In the ZCLI container, the template is actually at /zcli/zcli/config-templates/cluster-inst.conf, and the sample is at /zcli/zcli/resources/cluster-inst.conf.sample. To copy the sample to your working directory, run:
ZCLI reads each value up to the next = sign. If your callHomeURL contains an =, for example in a query string, ZCLI sends only the part before it. If the file does not exist, ZCLI stops with a Python error instead of a message.

Network assignment

--network-assignment connects the network interface of the edge app to a virtual network on each edge node. The interface name is the one defined in the edge app. ZCLI applies the same interface setting to both the server and the agent nodes. If the value is not in <interface>:<assignment> format, or the assignment is tag and you do not pass --network-tag, ZCLI prints an error and creates nothing. These error messages refer to the flags as --network_assignment and --network_tags. The flags that you type are --network-assignment and --network-tag.

Onboarding

Virtual network configuration file

With --network-config, Edge Infrastructure Services creates virtual networks on the edge nodes that the cluster instance selects. The file is a JSON array with one object for each virtual network. Example:
The template that ships with ZCLI (/zcli/zcli/config-templates/netinst-config.tmpl) uses some key names that ZCLI does not read:
  • ZCLI reads set_as_default, not set_default. With port set to port tag name and only set_default in the file, ZCLI prints 'set_as_default' missing in netinst config and creates nothing.
  • ZCLI reads dns and ntp, not name_server and ntp_server. Values under the template names are ignored.
If the file is not valid JSON, or if you set gateway or dhcp_range without subnet, ZCLI stops with a Python error instead of a message.

View Cluster Instances

View a single cluster instance

Pass the name or --uuid. Add --detail to see the edge node pool, the cluster size settings, the call-home URL, the version, and who created and last updated the cluster instance.
The output shows the cluster type, title, description, tags, the edge app (as Cluster Name), the admin state, and the run state. With --detail, it also lists each edge node in the pool with its run state.

List cluster instances

Run show without a name to list cluster instances. Example:
The list has the columns Name, Admin Status, Type, Edge Node Pool Tags, and Project. The Edge Node Pool Tags column shows the number of edge nodes in the pool, not the tags. When you pass a name or --uuid, ZCLI ignores --name-pattern, --project, and --page-size. When you pass --summary, ZCLI ignores every other option.

Update a Cluster Instance

You can change only the title, the description, and the tags.
Example:
  • --tags replaces all of the existing tags. To keep a tag, pass it again.
  • If a --tags value is not in key:value format, ZCLI prints Please provide tag values as key-value pairs. Example: region:India, keeps the existing tags, and still applies the other changes.
  • If you pass no options, ZCLI prints Nothing to update.

Activate or Deactivate a Cluster Instance

To activate a cluster instance:
To deactivate a cluster instance:
deactivate stops the cluster instance, and activate starts it again. If the cluster instance is already in the requested state, nothing changes. Both commands print nothing when they succeed.

Restart or Refresh a Cluster Instance

To restart a cluster instance:
To refresh a cluster instance:
restart restarts the cluster instance. refresh refreshes it. Add --purge to purge the cluster instance during the refresh.
refresh --purge deletes the data of the cluster instance. There is no confirmation prompt for restart or refresh, with or without --purge, and the commands print nothing when they succeed.
These two commands are not described in the Commands section of zcli cluster-instance --help, but they appear in its usage lines.

Delete a Cluster Instance

ZCLI asks Delete cluster-instance <name>? [Y/N] before it deletes the cluster instance. If you answer no, ZCLI prints Cluster-Instance <name> not deleted. Add -f to delete without the prompt. Example:

Next Steps

Manage Edge Apps

Create the edge app that runs the cluster.

Manage Virtual Networks

Create and tag the virtual networks that cluster instances connect to.

Manage ZEDEDA Edge Kubernetes Service Clusters

Manage Kubernetes clusters that run on node clusters.

Get Started

Install ZCLI, configure access to Edge Infrastructure Services, and sign in.