import requests
url = "https://platform.ankra.app/api/v1/clusters/hetzner"
payload = {
"credential_id": "<string>",
"location": "<string>",
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({credential_id: '<string>', location: '<string>', name: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/clusters/hetzner', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/clusters/hetzner \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credential_id": "<string>",
"location": "<string>",
"name": "<string>"
}
'{
"cluster_id": "<string>",
"name": "<string>",
"server_types": {
"bastion": "<string>",
"control_plane": "<string>",
"etcd": "<string>",
"worker": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Create a Hetzner cluster
Creates a Hetzner cluster from the request, after checking server-type availability in the chosen location with Hetzner, and starts provisioning it in the background, answering 201 with the new cluster’s cluster_id and name. A configuration that fails validation answers 400 with the reason, and an organisation whose billing is restricted is refused with 402.
import requests
url = "https://platform.ankra.app/api/v1/clusters/hetzner"
payload = {
"credential_id": "<string>",
"location": "<string>",
"name": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({credential_id: '<string>', location: '<string>', name: '<string>'})
};
fetch('https://platform.ankra.app/api/v1/clusters/hetzner', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/clusters/hetzner \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"credential_id": "<string>",
"location": "<string>",
"name": "<string>"
}
'{
"cluster_id": "<string>",
"name": "<string>",
"server_types": {
"bastion": "<string>",
"control_plane": "<string>",
"etcd": "<string>",
"worker": "<string>"
}
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
11IPv4 addresses or CIDRs allowed to reach the bastion's SSH port. The platform's own egress addresses are always allowed in addition, so the platform can never be locked out. Omit (or send an empty list) to keep the bastion reachable from anywhere (key-only SSH, rate-limited). IPv6 and 0.0.0.0/0 entries are refused; at most 64 entries.
64Omit to let the platform pick the cheapest x86 type the target location can currently provision that meets the role's minimum size.
1Container network. Omitted resolves to cilium on kubeadm (the default distribution) and flannel on k3s.
flannel, calico, cilium 1 <= x <= 5Omit to let the platform pick the cheapest x86 type the target location can currently provision that meets the role's minimum size.
1production, staging, development, disposable 1 - 50Omit to let the platform pick the cheapest x86 type the target location can currently provision that meets the role's minimum size.
GitOps provider of the repository the cluster is bootstrapped onto. Omitted is github, where gitops_repository is owner/name. bitbucket_cloud names the repository by gitops_workspace and gitops_repo_slug (or gitops_repository as workspace/repo_slug) and binds it as a Bitbucket Cloud repository.
github, bitbucket_cloud Bitbucket Cloud workspace of the GitOps repository. Only with gitops_provider bitbucket_cloud; provided together with gitops_repo_slug.
Bitbucket Cloud repository slug of the GitOps repository. Only with gitops_provider bitbucket_cloud; provided together with gitops_workspace.
Version for the chosen distribution (kubeadm unless distribution says k3s). kubeadm takes a plain upstream tag such as v1.36.4; k3s takes a k3s build such as v1.35.7+k3s1, and a bare patch resolves to its newest +k3sN build. A +k3sN build with distribution kubeadm is refused. Omit to install the version catalogue's stable version for the distribution.
k3s packaged components to keep disabled (k3s --disable), for example ["traefik"] on a cluster that brings its own ingress. k3s distribution only: the list is rendered into the server config at install and re-asserted by the maintenance pass, so the entries stay off across restarts.
coredns, servicelb, traefik, local-storage, metrics-server, runtimes Show child attributes
Show child attributes
0 <= x <= 50Omit to let the platform pick the cheapest x86 type the target location can currently provision that meets the role's minimum size.
1Response
Cluster created successfully
The server type each role will be provisioned with. Roles the request left empty are filled by the platform with the cheapest x86 type the location can provision now that meets the role's minimum size (bastion and worker 2 vCPU / 4 GB, control plane and etcd 4 vCPU / 8 GB). worker is omitted when the request carried node_groups, etcd unless etcd_topology is external.
Show child attributes
Show child attributes