> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/kubernetes-security/onboard-and-configure/onboard-the-kubernetes-connector/set-a-custom-cluster-name.md). Agents can also search and read this documentation through its [MCP server](https://cortex-docs.paloaltonetworks.com/~gitbook/mcp).

# Set a custom cluster name

Set a readable name for an on-premises Kubernetes cluster before registering the connector.

Give a self-managed cluster a name your team recognizes, such as `prod-dc1-payments`. By default, on-premises Kubernetes and Rancher clusters are identified by their API server address, usually an IP address, and self-managed OpenShift clusters by their infrastructure name. Set the name in one Helm value before you install the connector.

Custom names apply to on-premises Kubernetes, Rancher (RKE, RKE2, and k3s), and self-managed OpenShift. Managed clusters, such as EKS, GKE, AKS, and ROSA, use their cloud resource identifier instead. The name changes only how Cortex Cloud identifies the cluster, not the cluster itself.

### How the connector names a cluster

When the Kubernetes Connector first starts, it builds a cluster URI and registers the cluster with Cortex Cloud. On an on-premises cluster, the URI has two parts: the UID of the `kube-system` namespace and an API server hostname. OpenShift clusters use the OpenShift cluster ID in place of the namespace UID.

```
/clusterId/<kube-system-uid>/apiServerHostname/<hostname>
```

Rancher and OpenShift clusters prefix the `clusterId` segment with the distribution name.

By default, the hostname segment comes from the in-cluster `KUBERNETES_SERVICE_HOST` address, which is usually an IP address. You can replace the default with your own name in the `global.optionalValues.CLUSTER_URI` Helm value. The value accepts two forms:

| Value                                                           | Result                                                                            | Use when                                                                                    |
| --------------------------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| A bare name, such as `prod-dc1-payments`                        | The connector keeps the namespace UID and uses your name as the hostname segment. | You want a readable name. This is the recommended form.                                     |
| A full cluster URI matching the format in the preceding example | The connector uses the URI exactly as given.                                      | You're restoring a known URI, such as when you reinstall the connector on the same cluster. |

A bare name can contain only letters, digits, periods (`.`), hyphens (`-`), underscores (`_`), and colons (`:`), and can't be longer than 250 characters. The connector trims leading and trailing spaces.

### Prerequisites

* An on-premises Kubernetes, Rancher, or self-managed OpenShift cluster.
* The connector hasn't registered this cluster yet. See the Important note in the next section.
* The values file you'll use to install the connector with the `konnector-bundle` Helm chart.

### Set the cluster name

{% hint style="warning" %}
**Important**:\
Set the name before the first installation. After the connector registers the cluster, it saves the resolved cluster URI and agent ID in the `konnector-globals-override` ConfigMap. The saved values take precedence over your Helm values, and `helm upgrade` with the same distribution ID keeps the saved values. Changing `CLUSTER_URI` in your values file after registration doesn't rename the cluster.
{% endhint %}

1. Open the values file you'll use to install the Kubernetes Connector.
2. Set the cluster name under `global.optionalValues`:

   ```yaml
   global:
     optionalValues:
       CLUSTER_URI: "prod-dc1-payments"
   ```
3. Install the connector with this values file.

If the name contains an invalid character or is longer than 250 characters, the connector can't build the cluster URI and doesn't register. The `cortex-manager` logs then contain `invalid cluster name`, followed by the reason. Fix the value, and then run `helm upgrade` with the corrected values file. The corrected name takes effect the next time `cortex-manager` restarts, which can take several minutes.

### Verify the cluster name

After the connector registers, read the saved cluster URI:

```sh
kubectl get configmap konnector-globals-override --namespace panw \
  -o jsonpath='{.data.CLUSTER_URI}'
```

The output ends with `/apiServerHostname/` and then your name. For example, the output ends with `/apiServerHostname/prod-dc1-payments`.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cortex-docs.paloaltonetworks.com/kubernetes-security/onboard-and-configure/onboard-the-kubernetes-connector/set-a-custom-cluster-name.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
