# Add a Kubernetes environment

When connecting a Kubernetes environment to Portainer, there are a few different methods you can use depending on your particular requirements. You can install the Portainer Agent on the Kubernetes cluster and connect via the agent, you can deploy the Portainer Edge Agent in standard or async mode, or you can choose to import an existing Kubernetes environment with a kubeconfig file.

Regardless of the method you choose, there are some generic requirements you will need to meet. You will require:

* A working and up to date Kubernetes cluster.

The installation instructions also make the following assumptions about your environment:

* Your environment meets [our requirements](/start/requirements-and-prerequisites.md). While Portainer may work with other configurations, it may require configuration changes or have limited functionality.
* You will be using the `portainer` namespace for Portainer.

<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Edge Agent Standard</strong></td><td></td><td></td><td><a href="/files/K2sAiKuaUnXONjrBvgJZ">/files/K2sAiKuaUnXONjrBvgJZ</a></td><td><a href="/pages/mrIFZucEo6tip0wfLJ5O">/pages/mrIFZucEo6tip0wfLJ5O</a></td></tr><tr><td><strong>Edge Agent Async</strong></td><td></td><td></td><td><a href="/files/ojNZAcFFpS7Vat45sJOb">/files/ojNZAcFFpS7Vat45sJOb</a></td><td><a href="/pages/1wbyioYIKHAIOuZJZSOp">/pages/1wbyioYIKHAIOuZJZSOp</a></td></tr><tr><td><strong>Agent</strong></td><td></td><td></td><td><a href="/files/KQPhtkJBlXhTVOUQrPzO">/files/KQPhtkJBlXhTVOUQrPzO</a></td><td><a href="/pages/j2Z0x1iRHjOULewP2wRp">/pages/j2Z0x1iRHjOULewP2wRp</a></td></tr><tr><td><strong>Import</strong></td><td>Import an existing Kubernetes config</td><td></td><td><a href="/files/egYyQadyoxYh47eBpJ5R">/files/egYyQadyoxYh47eBpJ5R</a></td><td><a href="/pages/7LCBvFFcTHpmaFkj14hE">/pages/7LCBvFFcTHpmaFkj14hE</a></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.portainer.io/admin/environments/add/kubernetes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
