import requests
url = "https://platform.ankra.app/org/clusters/ankracloud"
payload = {
"bastion_plan": "c1-2",
"control_plane_plan": "c2-4",
"credential_id": "11111111-2222-4333-8444-555555555555",
"name": "ankra-prod",
"ssh_key_credential_id": "99999999-8888-4777-8666-555555555555",
"zone": "de-fsn1"
}
headers = {
"cookie": "ankra_session=",
"X-Ankra-CSRF": "<x-ankra-csrf>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
cookie: 'ankra_session=',
'X-Ankra-CSRF': '<x-ankra-csrf>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
bastion_plan: 'c1-2',
control_plane_plan: 'c2-4',
credential_id: '11111111-2222-4333-8444-555555555555',
name: 'ankra-prod',
ssh_key_credential_id: '99999999-8888-4777-8666-555555555555',
zone: 'de-fsn1'
})
};
fetch('https://platform.ankra.app/org/clusters/ankracloud', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/org/clusters/ankracloud \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--data '
{
"bastion_plan": "c1-2",
"control_plane_plan": "c2-4",
"credential_id": "11111111-2222-4333-8444-555555555555",
"name": "ankra-prod",
"ssh_key_credential_id": "99999999-8888-4777-8666-555555555555",
"zone": "de-fsn1"
}
'{
"cluster_id": "11111111-2222-4333-8444-555555555555",
"name": "ankra-prod"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Create Ankra Cloud cluster (browser session)
Browser session authentication; RBAC permission clusters. RBAC permission clusters.create. Creates a self-managed kubeadm / k3s cluster on Ankra Cloud servers: a private RFC 1918 network (network_ip_range, or an adopted private_network_id), a router with NAT for IPv4 egress, a bastion with a public IPv4 and the cluster nodes on the private network only. Plans replace instance types (bastion_plan, control_plane_plan, worker_plan, etcd_plan; node groups keep instance_type), templateis the OS image (default debian-13). The preflight runs first and the first failing item is the refusal. kubeadm requires Cilium; the ankra-cloud-ccm is always installed.bastion_portis accepted for contract symmetry and ignored: the bastion listens on 22. Answers 404 while the organisation'sankra_cloud_provider` feature flag is off.
import requests
url = "https://platform.ankra.app/org/clusters/ankracloud"
payload = {
"bastion_plan": "c1-2",
"control_plane_plan": "c2-4",
"credential_id": "11111111-2222-4333-8444-555555555555",
"name": "ankra-prod",
"ssh_key_credential_id": "99999999-8888-4777-8666-555555555555",
"zone": "de-fsn1"
}
headers = {
"cookie": "ankra_session=",
"X-Ankra-CSRF": "<x-ankra-csrf>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
cookie: 'ankra_session=',
'X-Ankra-CSRF': '<x-ankra-csrf>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
bastion_plan: 'c1-2',
control_plane_plan: 'c2-4',
credential_id: '11111111-2222-4333-8444-555555555555',
name: 'ankra-prod',
ssh_key_credential_id: '99999999-8888-4777-8666-555555555555',
zone: 'de-fsn1'
})
};
fetch('https://platform.ankra.app/org/clusters/ankracloud', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/org/clusters/ankracloud \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--data '
{
"bastion_plan": "c1-2",
"control_plane_plan": "c2-4",
"credential_id": "11111111-2222-4333-8444-555555555555",
"name": "ankra-prod",
"ssh_key_credential_id": "99999999-8888-4777-8666-555555555555",
"zone": "de-fsn1"
}
'{
"cluster_id": "11111111-2222-4333-8444-555555555555",
"name": "ankra-prod"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}{
"detail": "Cluster not found"
}Authorizations
Browser session. Mutations also require X-Ankra-CSRF.
Headers
Must match the ankra_csrf browser cookie.
Body
Ankra Cloud zone (GET /clusters/ankracloud/zones); every server of the cluster is placed there.
IPv4/IPv6 addresses or CIDRs allowed to SSH to the bastion; empty allows any source.
Accepted for contract symmetry with the managed-gateway providers and ignored: the bastion listens on 22.
kubeadm supports only cilium on Ankra Cloud.
flannel, calico, cilium Show child attributes
Show child attributes
1 <= x <= 9k3s, kubeadm Required for an external etcd topology.
stacked, external 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.
RFC 1918 CIDR (/16 through /29) of the private network Ankra creates; omitted derives one per cluster.
Show child attributes
Show child attributes
Adopts an existing private network in the zone; mutually exclusive with network_ip_range. An adopted network is never deleted by the cluster.
delete, retain Credential the running cluster's cloud-controller-manager and CSI use; omitted reuses credential_id.
Public OS template id (GET /clusters/ankracloud/templates).
0 <= x <= 100Required when worker_count is above zero and no node_groups are given.