Skip to main content
A rename changes the name Ankra knows a cluster by. The cluster keeps running as it is: nothing is rebuilt, no node is replaced, no data moves, and the cluster id stays the same.

Before you start

  • You need clusters.write on the cluster.
  • The new name must be 1 to 53 lowercase letters, digits and hyphens. It must start with a letter, end with a letter or digit, and must not already belong to another cluster in the organisation (in any project).
  • These two kinds of cluster cannot be renamed yet. The platform refuses and changes nothing:
    • A cluster synced with a connected GitOps repository. Its cluster file in the repository is named after the cluster.
    • An Ankra Cloud cluster. Its load balancers are owned by the cluster’s name.

Rename the cluster

Give the cluster by its current name or its id:
The API equivalent is PATCH /api/v1/org/clusters/imported/{cluster_id}/name with {"name": "my-cluster-dev"}. The answer carries the new name, the previous name, and the GitOps directory the cluster resolves to. If you selected the cluster with ankra cluster select, that selection follows the rename.

What changes and what does not

After the rename

ImportCluster files. ankra cluster apply finds a cluster by the file’s metadata.name. A file that still names the old cluster is refused with a message that names the new name. It never creates a second cluster:
Change metadata.name to the new name before the next apply, or keep the file as it is and pass --cluster my-cluster-dev. The file’s own path in your repository can stay where it is. Kubeconfig. Existing contexts are named ankra-<old-name> and keep working. For a context under the new name, run:
Pipelines. A .ankra/pipeline.yaml whose runs_on.cluster names the cluster by its old name is refused until you change it to the new name, or to the cluster id, which never changes. Reusing the old name. While the renamed cluster exists, the old name stays reserved for cluster apply, so an old file cannot recreate it. Renaming the cluster back releases it. The reservation ends when the cluster is deleted.

Next steps