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.
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:
zcli cluster-instance --help leave out --onboard-type. That flag is required, so those examples fail with a usage error.
Cluster configuration file
The cluster configuration file sets the size of the cluster. Each setting is on its own line, inkey=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, notset_default. Withportset toport tag nameand onlyset_defaultin the file, ZCLI prints'set_as_default' missing in netinst configand creates nothing. - ZCLI reads
dnsandntp, notname_serverandntp_server. Values under the template names are ignored.
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.
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
Runshow without a name to list cluster instances.
Example:
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.--tagsreplaces all of the existing tags. To keep a tag, pass it again.- If a
--tagsvalue is not inkey:valueformat, ZCLI printsPlease 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: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:restart restarts the cluster instance. refresh refreshes it. Add --purge to purge the cluster instance during the refresh.
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
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.