This guide covers the essential KubeAid CLI commands for managing your Kubernetes cluster. All operations are provider-agnostic and work the same way regardless of your deployment platform.
Note: All
kubeaid-clicommands are run on your local machine (the same machine where you installed the CLI during the installation step). The CLI connects to your cluster remotely via kubeconfig or SSH.
Here's a quick reference of the most common kubeaid-cli commands:
| Command | Description |
|---|---|
kubeaid-cli config generate <provider> |
Generate configuration templates |
kubeaid-cli cluster bootstrap |
Create and provision a new cluster |
kubeaid-cli cluster delete main |
Delete the main cluster |
kubeaid-cli cluster delete management |
Delete the local management cluster |
kubeaid-cli cluster upgrade --new-k8s-version <version> |
Upgrade Kubernetes version |
kubeaid-cli --version |
Show CLI version |
kubeaid-cli --help |
Show help and available commands |
Note: KubeAid CLI does not have start/stop/pause/enable/disable commands. Cluster lifecycle is managed through
bootstrap,upgrade, anddeleteoperations. For workload management, use standardkubectlcommands.
export KUBECONFIG=./outputs/kubeconfigs/main.yaml
# Verify cluster info
kubectl cluster-info
# Check all nodes are ready
kubectl get nodes
# Check all system pods are running
kubectl get pods -Akubectl get applications -n argocdAll applications should show Healthy and Synced status.
- Backup important data - Export any critical secrets or configurations
- Review changelogs - Check for breaking changes in the new Kubernetes version
- Test in staging - If possible, test the upgrade on a non-production cluster first
To upgrade the Kubernetes version of your cluster:
kubeaid-cli cluster upgrade --new-k8s-version v1.32.0Note: Replace
v1.32.0with your target Kubernetes version. Always review the Kubernetes changelog before upgrading.
This section covers how to delete and clean up your KubeAid-managed Kubernetes cluster.
Warning: Cluster deletion is irreversible. Ensure you have:
- Backed up any important data (especially
general.yamlif you want to recreate the cluster later)- Exported any sealed secrets you want to preserve
- Saved your
secrets.yamlin your password store
kubeaid-cli cluster delete mainThis command will:
- Drain and remove all worker nodes
- Delete the control plane
- Remove cloud resources (for cloud providers)
Note: This step only applies to ClusterAPI-based installations (AWS, Azure, Hetzner). If you used KubeOne for a bare metal (SSH-only) cluster, skip this step - there is no management cluster.
What is the management cluster?
ClusterAPI uses a temporary local Kubernetes cluster (running in Docker via K3D) to orchestrate the provisioning
of your actual "main" cluster. This management cluster runs the ClusterAPI controllers
that create and manage your cloud infrastructure.
kubeaid-cli cluster delete managementThis command removes the local management cluster used during bootstrapping.
For ClusterAPI-based installations, a single command cleanup:
kubeaid-cli cluster delete main && kubeaid-cli cluster delete management---
title: What Gets Deleted
---
flowchart TB
Start["Step 1:<br/>kubeaid-cli cluster delete main"]
Start --> MainCluster
subgraph MainCluster["Your Main Cluster"]
direction TB
CP["❌ Control Plane<br/>Nodes"]
Workers["❌ Worker<br/>Nodes"]
Cloud["❌ Cloud<br/>Resources"]
LB["❌ Load<br/>Balancers"]
Volumes["❌ Volumes"]
Network["❌ Network<br/>Resources"]
end
MainCluster --> Next["Step 2:<br/>kubeaid-cli cluster delete management<br/>(ClusterAPI only)"]
Next --> MgmtCluster
subgraph MgmtCluster["Local Management Cluster"]
direction TB
CAPI["❌ ClusterAPI<br/>Controllers"]
K3D["❌ K3D Container<br/>(in Docker)"]
State["❌ Local State"]
end
After cluster deletion, perform these additional cleanup steps to ensure no resources remain.
# If you need to recreate this cluster at a later time, save general.yaml before deleting
# cp outputs/configs/general.yaml /path/to/safe/location/
# Remove generated outputs (keep if you want to inspect logs)
rm -rf outputs/
# Keep your secrets.yaml backup in password store!After deletion, verify all AWS resources are cleaned up:
# Check for lingering resources
aws ec2 describe-instances --filters "Name=tag:kubernetes.io/cluster/<cluster-name>,Values=owned"
aws elb describe-load-balancers
aws ec2 describe-volumes --filters "Name=tag:kubernetes.io/cluster/<cluster-name>,Values=owned"If resources remain, delete them manually through the AWS Console or CLI.
Verify resource group cleanup:
az group list --query "[?contains(name, '<cluster-name>')]"If the resource group still exists, delete it:
az group delete --name <cluster-name>-rg --yes --no-waitVerify servers are deleted:
hcloud server listCheck for lingering volumes:
hcloud volume listFor Hetzner Bare Metal, servers are not automatically wiped. You must manually:
- Reset servers via the Hetzner Robot interface
- Or reinstall the OS if you plan to reuse them
For SSH-only bare metal servers, the physical machines remain. To clean up:
- SSH into each node
- Run cleanup commands:
# On each node
kubeadm reset -f
rm -rf /etc/kubernetes /var/lib/kubelet /var/lib/etcd
iptables -F && iptables -X
ipvsadm --clearLocal K3D clusters are automatically cleaned up. Verify:
docker ps -a | grep k3d
k3d cluster listTo create a new cluster with the same configuration:
- Retrieve your
general.yaml(which you saved in your kubeaid-config repo during pre-configuration, right?) - Retrieve your
secrets.yamlfrom your password store - Follow the Pre-Configuration and Installation guides
# Retrieve secrets from password store (example using pass)
pass kubeaid/my-cluster/secrets.yaml > outputs/configs/secrets.yaml
# Bootstrap the cluster
kubeaid-cli cluster bootstrap| Issue | Cause | Solution |
|---|---|---|
| CLI command not found | CLI not installed or not in PATH | Re-run the CLI installation |
| Delete hangs | Resources stuck or network issues | Check cloud provider console for stuck resources |
| Management cluster already deleted | Running delete twice | This is safe to ignore |
| Kubeconfig not found | Wrong path or cluster not created | Verify outputs/kubeconfigs/main.yaml exists |
# View operation logs
cat outputs/.log
# Follow logs in real-time
tail -f outputs/.log# Show all available commands
kubeaid-cli --help
# Show help for a specific command
kubeaid-cli cluster --help
kubeaid-cli config --help