---
title: Configure access
url: /docs/iac/get-started/kubernetes/configure/
---
## Configure access to Kubernetes

Pulumi's CLI needs access to a Kubernetes cluster to manage cloud resources.

You must have access to a Kubernetes cluster—either a local cluster (such as [Minikube](https://minikube.sigs.k8s.io/), [kind](https://kind.sigs.k8s.io/), or [Docker Desktop](https://docs.docker.com/desktop/kubernetes/)) or a cloud-managed cluster (such as [GKE](https://cloud.google.com/kubernetes-engine), [AKS](https://azure.microsoft.com/en-us/products/kubernetes-service), or [EKS](https://aws.amazon.com/eks/)).

You also need [kubectl](https://kubernetes.io/docs/tasks/tools/) installed and configured to access your cluster.

### Testing access

To test that your Kubernetes cluster access is configured properly, run:

<!-- chooser: os -->
<!-- option: linux -->

```bash
$ kubectl cluster-info
```

<!-- /option -->

<!-- option: windows -->

```powershell
> kubectl cluster-info
```

<!-- /option -->
<!-- /chooser -->

If your cluster's control plane and services are printed, your configuration is correct. If not, read on:

```
Kubernetes control plane is running at https://127.0.0.1:6443
CoreDNS is running at https://127.0.0.1:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
```

You can also verify you have access to cluster resources:

<!-- chooser: os -->
<!-- option: linux -->

```bash
$ kubectl get nodes
$ kubectl auth can-i get pods
```

<!-- /option -->

<!-- option: windows -->

```powershell
> kubectl get nodes
> kubectl auth can-i get pods
```

<!-- /option -->
<!-- /chooser -->

### How Pulumi accesses your cluster

Pulumi uses the same kubeconfig file that kubectl uses (typically `~/.kube/config`). If you can run `kubectl get nodes`, Pulumi will work automatically.

You can verify which context Pulumi will use:

<!-- chooser: os -->
<!-- option: linux -->

```bash
$ kubectl config current-context
```

<!-- /option -->

<!-- option: windows -->

```powershell
> kubectl config current-context
```

<!-- /option -->
<!-- /chooser -->

### Alternative approaches

If you need to use a specific kubeconfig file or context, you can set:

<!-- chooser: os -->
<!-- option: linux -->

```bash
$ export KUBECONFIG="$HOME/path/to/kubeconfig"
```

<!-- /option -->

<!-- option: windows -->

```powershell
> $env:KUBECONFIG = "C:\path\to\kubeconfig"
```

<!-- /option -->
<!-- /chooser -->

Or specify the context in your Pulumi stack configuration:

<!-- chooser: os -->
<!-- option: linux -->

```bash
$ pulumi config set kubernetes:context my-cluster-context
```

<!-- /option -->

<!-- option: windows -->

```powershell
> pulumi config set kubernetes:context my-cluster-context
```

<!-- /option -->
<!-- /chooser -->

For detailed information on Pulumi's use of Kubernetes credentials, see [Kubernetes Setup](/registry/packages/kubernetes/installation-configuration/).

---
[← Previous step](/docs/iac/get-started/kubernetes/begin/)
[Next: Create project →](/docs/iac/get-started/kubernetes/create-project/)


