Create a workload cluster
This page describes how to create an NVIDIA Kubernetes Engine (NVKE) workload cluster for a customer with nvkectl, watch it until its nodes are ready, change its day-2 settings, and delete it. You create workload clusters after you configure the infrastructure provider, and before you give the customer access.
Before you begin
-
You have completed Run NVKE end to end on one machine and Configure an infrastructure provider: NICo.
-
nvkectlpoints at your management plane, set withnvkectl config set-site, andnvkectl get providersreports thenicorow asCONFIGURED. If you turned on API authentication,nvkectluses an OpenID Connect (OIDC) kubeconfig, as described in Secure the NVKE API.nvkectl get providersreads the management cluster’s Kubernetes API with that kubeconfig, which the bootstrap does not configure to accept tokens from your identity provider, so the command fails. Check the provider with the management cluster’s admin kubeconfig instead:The Deployment
controller-managershows all replicas ready, and the Secretnico-credentialsis listed.<CLUSTER_NAME>is the management cluster’s name. -
You have the NVIDIA Infra Controller (NICo) identifiers listed in Collect the NICo identifiers: the organization, site and virtual private cloud (VPC) IDs, the instance type IDs, the VPC prefix or subnet IDs, and optionally SSH key group IDs.
-
The releases you plan to use exist on the management cluster. The control plane names a cluster release and each node pool names a node pool release. List them with
nvkectl get clusterreleasesandnvkectl get nodepoolreleases. -
If the cluster has more than one control-plane node, you have an unused, routable IPv4 address on the control-plane network for the Kubernetes API virtual IP address (VIP).
-
curlandjqare installed, for the REST calls on this page.
Write the cluster spec
The cluster spec is a YAML file that describes the cluster, its control plane and its initial worker node pools. Its fields are those of the CreateClusterRequest in the NVKE REST API reference, and nvkectl rejects any field the schema does not define.
-
Write the spec and save it as
cluster.yaml.<WORKLOAD_CLUSTER>: a lowercase DNS label of at most 55 characters, unique on the management plane, such asexample-customer-a. Node names are built from it.<K8S_VERSION>: the Kubernetes version asX.Y.Zwith no leadingv, such as1.36.3. Use a version your releases’ node images carry; see Supported platforms and versions.<API_VIP>: the Kubernetes API VIP. It must be outside the pod and service CIDRs.<NICO_ORG_ID>,<NICO_SITE_ID>and<NICO_VPC_ID>: your NICo organization ID, and the site and VPC IDs. Every NICo ID in the spec except the organization ID is a UUID.<CP_INSTANCE_TYPE_ID>and<WORKER_INSTANCE_TYPE_ID>: NICo instance type IDs.instanceTypePreferenceis a required, ordered list: add more IDs after the first as fallbacks.<VPC_PREFIX_ID>: a NICo VPC prefix ID. On a site without native networking, usesubnetIDswith subnet IDs instead. Eachnicoobject takes exactly one of the two.<SSH_KEY_GROUP_ID>: a NICo SSH key group for node access. Optional; omitsshKeyGroupIDsto add none.<CP_RELEASE>: the name of a cluster release.<WORKER_RELEASE>: the name of a node pool release.
-
Review the settings that are fixed at creation.
The network cannot be changed after creation.
-
Review the control-plane and node pool settings.
Node pools also take
recycleBudgetandautoModeDisabled, and acceptnodeLabelsandnodeTaints, which are applied to each node when it joins. Manage node pools describes them. You can create the cluster with nonodePoolsand add pools later.
Create the cluster
-
Create the cluster from the spec.
The command prints
Cluster "<WORKLOAD_CLUSTER>" created (id: <CLUSTER_ID>)and returns before provisioning finishes.-f -reads the spec from standard input.If the request is invalid, the command prints the API’s error and creates nothing. Common causes are a duplicate name, a missing
nico.orgID,siteIDorvpcID, a missing control-planerelease,maxSurgeabove1, a pod CIDR too small for the nodes, and a VIP inside the pod or service CIDR.The API does not check release names at creation. A name with no matching release fails when the first node provisions.
The equivalent REST call sends the same fields as JSON to POST /api/clusters. Here cluster.json is cluster.yaml converted to JSON:
<MANAGEMENT_ADDRESS> is the management cluster’s API VIP, or the node IP of a single-node management cluster. If API authentication is on, add -H "Authorization: Bearer <TOKEN>" to each curl command that calls /api/, where <TOKEN> is a JSON Web Token (JWT) from your identity provider, as described in Secure the NVKE API. The API returns 201 with the new cluster, or 400 with a message.
Watch it come up
-
Check the cluster’s status.
STATUSreadsProvisioning, thenProvisioned. TheIDcolumn holds<CLUSTER_ID>, which REST calls use. -
If the status stays
Provisioning, read the condition messages.Each condition under
conditionshas astatus, alastTransitionTimeand amessage. NVKE keeps waiting for a control-plane machine that does not become ready, so a NICo instance type without capacity shows as a cluster that stays inProvisioning. See Troubleshoot. -
Check the node pools.
Each pool’s
STATUSreadsProvisionedonce the cluster is provisioned. Its nodes can still be joining.
Verify
-
List the cluster’s nodes and their Kubernetes readiness.
The output has one line for each control-plane node and each worker, and every line ends in
True. The count of control-plane lines (truein the second column) equalscontrolPlaneConfig.desiredCount. -
Check the cluster’s status.
STATUSreadsProvisioned.
Change cluster settings after creation
You change three cluster settings after creation with nvkectl patch cluster, which sends a patch document in YAML or JSON to PATCH /api/clusters/<CLUSTER_ID>. Fields you leave out keep their values.
enableEtcdEncryption and enableOidc start a rollout across the control-plane nodes, one node at a time. Both require a cluster in Provisioned state. Only one operation runs at a time: while one runs, STATUS reads Updating and every other PATCH returns 409 with a message that names the running operation. You cannot combine the two in one request, or combine either with a Kubernetes version change.
-
Apply the change. For example, to turn on etcd encryption:
The command prints
Cluster "<WORKLOAD_CLUSTER>" patched (id: <CLUSTER_ID>)and returns before the rollout finishes. Use--patch 'enableOidc: true'or--patch 'enableCPNodeRecycling: true'for the other settings, or--patch-fileto read the document from a file. -
Wait for
STATUSto return toProvisioned.After etcd encryption,
nvkectl get clusters <WORKLOAD_CLUSTER> -o yamlshowsetcdEncrypted: true. IfSTATUSreadsUpdateFailed, send the same patch again to retry.
enableOidc requires Kubernetes 1.30.0 or later and turns on the shared OIDC provider that the nvkeOIDCAuth chart values configure. The install in Run NVKE end to end on one machine configures it for the management cluster’s SPIRE server and sets nvkeOIDCAuth.enabled to false, so new clusters start without it and the enableOidc patch is accepted. Try enableOidc on one cluster before you rely on it. Configure OIDC for workload clusters describes the shared provider, and the fleet-wide providers that a cluster gets only at creation.
The same PATCH also takes controlPlaneKubernetesVersion, to upgrade the control plane, and controlPlaneConfig, to change the control-plane node count or release. An upgrade, a node count above one and a release change each require controlPlaneVIP.
Delete a workload cluster
-
Delete the cluster.
The command asks for no confirmation. It prints
Cluster "<WORKLOAD_CLUSTER>" deletion started (id: <CLUSTER_ID>)and returns. The REST equivalent isDELETE /api/clusters/<CLUSTER_ID>, which returns202. You can delete a cluster in any state, including while it provisions or upgrades. -
Wait for the cluster to disappear.
The cluster shows
Deletinguntil teardown finishes, then is no longer listed.
Deletion removes the node pools and nodes, the cluster’s etcd encryption key, its Cluster API objects and its records on the management plane. For each node, NVKE makes a best-effort kubeadm reset, then deletes the node’s Cluster API machine, which releases the NICo instance back to NICo. A failed reset does not stop the deletion. The cluster stays listed until every machine is released. What happens to the hardware after release is decided by NICo, not NVKE.
If teardown fails, the cluster stays in Deleting and its deleting condition message starts with Workflow failed:. See Troubleshoot.
Next steps
- Access a workload cluster to get the kubeconfig and hand the cluster to the customer.
- Manage node pools to add, scale or remove node pools.