> For the complete documentation index, see [llms.txt](https://docs.cxcloud.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cxcloud.com/v3.0-docs/guides/managing-infrastructure/getting-access-to-an-already-running-infrastructure.md).

# Getting Access To An Already Running Infrastructure

In most real world cases, you haven't probably generated and set up the Kubernetes infrastructure yourself. But you might need to access it to deploy services or change settings.

To do that, you should have access to the AWS account that the infrastructure is running in, and export the `AWS_PROFILE` variable like before:

```bash
$ export AWS_PROFILE=my-cxcloud-dev
```

Now run the following script to download the configuration from the running cluster to your system:

```bash
$ kops export kubecfg somecluster.k8s.local --state=s3://somecluster.k8s.local
```

This command will download the configuration to your system and sets up a Kubernetes `context` for easier use. Now you can run any `kubectl` or `cxcloud` command to interact with your cluster.

## Kubernetes Contexts

In case you have access to more than one Kubernetes cluster, you can use `kubectl config` tool and switch between different contexts.

To see a list of your available contexts run:

```bash
$ kubectl config get-contexts
```

This command will print a list of configured contexts on your system and the currently in use context.

To switch between contexts, run:

```bash
$ kubectl config use-context mycluster.k8s.local
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.cxcloud.com/v3.0-docs/guides/managing-infrastructure/getting-access-to-an-already-running-infrastructure.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
