> ## Documentation Index
> Fetch the complete documentation index at: https://www.qovery.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# qovery cluster

> Cluster management commands

## Overview

View and manage Kubernetes clusters in your Qovery organization.

## Commands

### List Clusters

List all clusters in current organization:

```bash theme={null}
qovery cluster list
```

| Flag             | Description       |
| ---------------- | ----------------- |
| `--organization` | Organization Name |
| `--json`         | JSON output       |

### Deploy Cluster

Deploy a cluster:

```bash theme={null}
qovery cluster deploy --cluster "cluster-name"
```

| Flag               | Description                                              |
| ------------------ | -------------------------------------------------------- |
| `--organization`   | Organization Name                                        |
| `--cluster` / `-n` | Cluster Name (required)                                  |
| `--watch` / `-w`   | Watch cluster status until it's ready or an error occurs |

### Stop Cluster

Stop a cluster:

```bash theme={null}
qovery cluster stop --cluster "cluster-name"
```

| Flag               | Description                                              |
| ------------------ | -------------------------------------------------------- |
| `--organization`   | Organization Name                                        |
| `--cluster` / `-n` | Cluster Name (required)                                  |
| `--watch` / `-w`   | Watch cluster status until it's ready or an error occurs |

### Install Cluster

Install Qovery on your cluster:

```bash theme={null}
qovery cluster install
```

### Upgrade Cluster

Upgrade a cluster to the next Kubernetes version:

```bash theme={null}
qovery cluster upgrade --cluster "cluster-name"
```

| Flag                         | Description                                              |
| ---------------------------- | -------------------------------------------------------- |
| `--organization`             | Organization Name                                        |
| `--cluster` / `-n`           | Cluster Name (required)                                  |
| `--watch` / `-w`             | Watch cluster status until it's ready or an error occurs |
| `--skip-confirmation` / `-y` | Skip prompt confirmation                                 |

### Download Kubeconfig

Download kubeconfig file for kubectl access:

```bash theme={null}
qovery cluster kubeconfig --cluster-id "cluster-id"
```

| Flag                  | Description           |
| --------------------- | --------------------- |
| `--cluster-id` / `-c` | Cluster ID (required) |

This command generates a kubeconfig file that allows you to connect to your cluster using kubectl.

### Get Cluster Token

Get an auth token for a cluster:

```bash theme={null}
qovery cluster get-token --cluster-id "cluster-id"
```

| Flag                  | Description |
| --------------------- | ----------- |
| `--cluster-id` / `-c` | Cluster ID  |

### Lock Cluster

Lock a cluster to prevent changes:

```bash theme={null}
qovery cluster lock \
  --cluster-id "cluster-id" \
  --reason "maintenance"
```

| Flag                   | Description                                     |
| ---------------------- | ----------------------------------------------- |
| `--cluster-id` / `-c`  | Cluster ID (required)                           |
| `--reason` / `-r`      | Reason (required)                               |
| `--ttl-in-days` / `-d` | Time-to-live for the lock in days (1 to 5 days) |

### Unlock Cluster

Unlock a cluster:

```bash theme={null}
qovery cluster unlock --cluster-id "cluster-id"
```

| Flag                  | Description |
| --------------------- | ----------- |
| `--cluster-id` / `-c` | Cluster ID  |

### List Cluster Nodes

List nodes of a cluster:

```bash theme={null}
qovery cluster list-nodes --cluster-id "cluster-id"
```

| Flag                  | Description |
| --------------------- | ----------- |
| `--cluster-id` / `-c` | Cluster ID  |

### Open Debug Pod

Launch an interactive debug pod with kubectl pre-configured:

```bash theme={null}
qovery cluster debug-pod \
  --organization-id "org-id" \
  --cluster-id "cluster-id"
```

| Flag                       | Description                                                        |
| -------------------------- | ------------------------------------------------------------------ |
| `--organization-id` / `-o` | Organization ID                                                    |
| `--cluster-id` / `-c`      | Cluster ID (required)                                              |
| `--node-selector` / `-n`   | Specify a node selector for the debug pod to be started on         |
| `--full-privilege` / `-p`  | Start a full privileged debug pod which has access to host machine |

This opens a debug shell inside your cluster with kubectl access, perfect for troubleshooting.

## Examples

### List All Clusters

```bash theme={null}
# Set organization context
qovery context set --organization "My Org"

# List clusters
qovery cluster list

# List clusters with JSON output
qovery cluster list --json
```

### Deploy and Watch Cluster

```bash theme={null}
qovery cluster deploy \
  --cluster "prod-us-east" \
  --watch
```

### Get kubectl Access

```bash theme={null}
# Download kubeconfig file
qovery cluster kubeconfig --cluster-id "abc123"

# Set kubectl to use the downloaded config
export KUBECONFIG=./kubeconfig-abc123.yaml

# Test connection
kubectl get nodes
```

### Open Debug Pod for Troubleshooting

```bash theme={null}
# Launch debug pod
qovery cluster debug-pod \
  --organization-id "org-abc123" \
  --cluster-id "cluster-abc123"

# Launch privileged debug pod on a specific node
qovery cluster debug-pod \
  --organization-id "org-abc123" \
  --cluster-id "cluster-abc123" \
  --node-selector "kubernetes.io/hostname=my-node" \
  --full-privilege

# Inside the debug pod, you can run kubectl commands:
# kubectl get pods --all-namespaces
# kubectl logs <pod-name> -n <namespace>
# exit
```

### Upgrade Cluster

```bash theme={null}
# Upgrade with confirmation prompt
qovery cluster upgrade --cluster "prod-us-east"

# Upgrade without confirmation and watch progress
qovery cluster upgrade \
  --cluster "prod-us-east" \
  --skip-confirmation \
  --watch
```

## Tips

<Tip>
  Use `qovery cluster deploy --watch` to monitor cluster deployment progress in real time.
</Tip>

<Tip>
  Use `qovery cluster kubeconfig` to get full kubectl access to your cluster for advanced operations.
</Tip>

<Tip>
  The `debug-pod` command is perfect for quick troubleshooting without needing to configure kubectl locally.
</Tip>

<Tip>
  Use `qovery cluster lock` during planned maintenance to prevent accidental changes to your cluster.
</Tip>

## Related Commands

* [`qovery context`](/cli/commands/context) - Set cluster context
* [`qovery environment`](/cli/commands/environment) - Manage environments on cluster
* [`qovery shell`](/cli/commands/shell) - Open shell in application container

## Related Documentation

* [Connect to EKS with kubectl](/integrations/kubernetes/eks/kubectl-access) - Comprehensive guide for kubectl access
