# pw kube auth

> Source: https://parallelworks.com/docs/cli/pw/kube/auth

## pw kube auth

Set up cluster configuration

### Synopsis

The **pw kube auth** command configures kubectl access to a platform Kubernetes
cluster. It writes cluster, user, and context entries, named after the cluster with a
**pw#** prefix, to your kubeconfig (**~/.kube/config**, or the file **KUBECONFIG**
points to) and switches to the new context unless **--no-context-switch** is given.

The user entry authenticates through an exec plugin that runs **pw kube token**, so
kubectl follows the CLI's current context and credentials.

Requires kubectl 1.22 or newer on your PATH. Run **pw kube ls** to list the
clusters available to you.

```
pw kube auth <cluster> [flags]
```

### Examples

```
  # Configure kubectl for the cluster "demo" and switch to its context
  pw kube auth demo
  
  # Configure kubectl without switching the current context
  pw kube auth --no-context-switch demo
```

### Options

```
  -h, --help                help for auth
      --no-context-switch   Skip switching to the new context after configuration
```

### Options inherited from parent commands

```
      --context string         The context to use. Overrides PW_CONTEXT environment variable and current context from config.
      --platform-host string   The Parallel Works ACTIVATE platform host to use. Overrides PW_PLATFORM_HOST environment variable and the current context's server.
  -v, --verbose                Enable verbose logging
```

### SEE ALSO

* [pw kube](/docs/cli/pw/kube)	 - Kubernetes commands
