# Portainer Web GUI - Environment Connection

With my K8 cluster now set up, I'm going to connect this cluster to my Portainer container running in my local Docker engine on another VM I have in Proxmox. For more details about my Portainer set up, check out my [Docker Containers](https://austinhomelabs.com/books/docker-containers/chapter/portainer) book. Portainer is a Web GUI container you can use for Kubernetes and Docker management, and it'll allow me to manage and deploy containers and clusters. See below to view how I set up my connection:

Portainer Agent

To connect this cluster, I'll be deploying a Portainer Agent onto the cluster. To do so, run the following command in any node of your cluster:

```
kubectl apply -f https://downloads.portainer.io/ce2-19/portainer-agent-k8s-nodeport.yaml
```

[![agent-install.png](https://austinhomelabs.com/uploads/images/gallery/2024-04/scaled-1680-/70hUCfZsKxZQE756-agent-install.png)](https://austinhomelabs.com/uploads/images/gallery/2024-04/70hUCfZsKxZQE756-agent-install.png)

With this installed, check the status of the agent by running the following command:

```
kubectl get pods --namespace=portainer
```

[![image.png](https://austinhomelabs.com/uploads/images/gallery/2024-04/scaled-1680-/HKs5nKiPdxi7L64o-image.png)](https://austinhomelabs.com/uploads/images/gallery/2024-04/HKs5nKiPdxi7L64o-image.png)

Now, open up your Portainer GUI in the web browser and navigate to Environment ---&gt; Add. Select Kubernetes and start the wizard:

[![image.png](https://austinhomelabs.com/uploads/images/gallery/2024-04/scaled-1680-/ItZ3l6R5gK0MZ7NY-image.png)](https://austinhomelabs.com/uploads/images/gallery/2024-04/ItZ3l6R5gK0MZ7NY-image.png)

Next, enter your node IP address and specify port 30778. I'm using NordPort so 30778 applies; if you're using load balancer then use port 9001:

[![image.png](https://austinhomelabs.com/uploads/images/gallery/2024-04/scaled-1680-/rpxy6lmpFj8EQdeW-image.png)](https://austinhomelabs.com/uploads/images/gallery/2024-04/rpxy6lmpFj8EQdeW-image.png)

Your cluster should now connect, load, and be added to your dashboard:

[![image.png](https://austinhomelabs.com/uploads/images/gallery/2024-04/scaled-1680-/EXoCDvWzGmqP6BXA-image.png)](https://austinhomelabs.com/uploads/images/gallery/2024-04/EXoCDvWzGmqP6BXA-image.png)

Select "Live Connect" to view your cluster resources:

The cluster is now connected to Portainer and can be managed via the Web GUI!