---
title: "ezgh kubernetes update-kubeconfig"
description: "Set up kubectl for a cluster."
---

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

# ezgh kubernetes update-kubeconfig

{/* Generated by ezgh-cli's internal/tools/clidocs from the ezgh command tree. Don't edit: change the command's help in ezgh-cli and regenerate. */}

```sh
ezgh kubernetes update-kubeconfig <cluster> [--private] [--alias name] [--kubeconfig path] [flags]
```

Add a cluster to your kubeconfig and make it the current context. kubectl then signs in as this profile's identity, running `ezgh kubernetes token` for a short-lived token whenever it needs one: nothing is stored. Your identity needs kubernetes.clusters.accessKubernetesApi on the cluster and an access entry in it. `--private` uses the endpoint inside the VPC. Other clusters, users and contexts in the file are kept; running it again changes nothing. The file is the first in KUBECONFIG, else ~/.kube/config.

Part of [`ezgh kubernetes`](/cli/reference/kubernetes).

## Examples

```sh
ezgh kubernetes update-kubeconfig prod
kubectl get nodes
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--alias` | string |  | the name of the cluster, user and context (default ezgh-&lt;cluster ID&gt;) |
| `--kubeconfig` | string |  | the kubeconfig to write (default the first in KUBECONFIG, else ~/.kube/config) |
| `--private` | boolean |  | use the endpoint inside the VPC |

This command also takes the [global flags](/cli/reference#global-flags).

Source: https://docs.ezghcloud.com/cli/reference/kubernetes-update-kubeconfig/index.mdx
