# Use break-glass credentials

Take a one-hour cluster-admin client certificate for when {{product}} sign-in or the cluster's RBAC is broken.

Replace _my-cluster_ with your cluster's name or id.

**Important:**
The certificate is `cluster-admin`, valid for one hour, and cannot be revoked. Every issuance is
recorded in the cluster's **Activity** with your name, and in the audit log.

## Prerequisites

- Permission for `eks:GetClusterAdminCredentials` on the cluster. No access entry is needed.
- In the console, also `eks:DescribeCluster` to open the cluster.
- The cluster is `active` (or `updating`); the console offers the button only then. Until the
  first provisioning step has made the cluster's key material, the request answers `409` "The
  cluster is still being created".

## Take the credentials

**Console**
1. Open **Kubernetes**, then open the cluster.
2. On **Overview**, under **Break glass**, choose **Get break-glass credentials…**.
3. Choose **Issue and download (recorded)**.

The console downloads `my-cluster-break-glass.kubeconfig.yaml` and shows until when the certificate
works. It is not shown again.

**CLI**
```sh
dcloud eks clusters admin-credentials my-cluster --json
```

**API**
```http
POST /eks/api/clusters/my-cluster/admin-credentials
```

## Result

The answer holds `server`, `certificateAuthorityData`, `clientCertificateData`, `clientKeyData`
(base64 PEM) and `expiresAt`. `server` is always the endpoint's public address, so the
credentials reach the cluster only while public endpoint access is on and your address is in the
allowed networks.

## Related

- [Cluster access](cluster-access.md)
- [Set API endpoint access](set-endpoint-access.md)
- `eks.clusters.admin-credentials` · `dcloud eks clusters admin-credentials`
