Creating an SSH Key Credential
1
Choose an approach
- Bring your own key: provide an existing SSH public key
- Generate a keypair: create a new keypair and save the private key, which you only get once
2
Add it to Ankra
Go to Integrations & alerts → Credentials, click Add credential, and under Git, registries and keys choose SSH key. In Add an SSH key, enter a Name and pick the Key source:
- Use an existing key: paste your Public key (for example
ssh-ed25519 AAAA…) and click Save public key. Never paste a private key. The credential’s page opens. - Generate a new key: click Generate and save public key. Your browser generates a 4096-bit RSA key pair and Ankra receives only the public key. Click Download
<name>.pem, tick I have downloaded and stored the private key safely, and click Done. Closing the page before that discards the private key.
3
Or via CLI
An SSH key credential belongs to the whole organisation, so one credential can be attached to clusters on any provider.With
--generate the platform generates an RSA key pair and returns the private key once, written to the file you name.The provider-named routes, such as ankra credentials hetzner ssh-key create --name my-key --generate, create the same organisation-wide credential and still work.Listing SSH Key Credentials
Attach a key to a cluster
- Portal
- CLI
- Go to Infrastructure → Clusters → <your cluster> → Settings → SSH access.
- Under SSH keys, choose a saved key in Add an SSH key. Repeat for each key.
- Click Review and save…, then Save SSH keys. The servers accept exactly these keys from the next time Ankra brings the cluster in line with its settings.
clusters.write permission.