import requests
url = "https://platform.ankra.app/org/clusters/managed/{provider}"
payload = {
"credential_id": "11111111-2222-4333-8444-555555555555",
"location": "fr-par",
"name": "kapsule-prod",
"node_pools": [
{
"autohealing": True,
"count": 3,
"name": "default",
"public_ip": False,
"root_volume_type": "sbs-5k",
"size": "DEV1-M",
"zone": "fr-par-1"
}
]
}
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({
credential_id: '11111111-2222-4333-8444-555555555555',
location: 'fr-par',
name: 'kapsule-prod',
node_pools: [
{
autohealing: true,
count: 3,
name: 'default',
public_ip: false,
root_volume_type: 'sbs-5k',
size: 'DEV1-M',
zone: 'fr-par-1'
}
]
})
};
fetch('https://platform.ankra.app/org/clusters/managed/{provider}', 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/managed/{provider} \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--data '
{
"credential_id": "11111111-2222-4333-8444-555555555555",
"location": "fr-par",
"name": "kapsule-prod",
"node_pools": [
{
"autohealing": true,
"count": 3,
"name": "default",
"public_ip": false,
"root_volume_type": "sbs-5k",
"size": "DEV1-M",
"zone": "fr-par-1"
}
]
}
'{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"provenance": "created"
}{
"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 a managed cluster (browser session)
Browser session authentication; RBAC permission clusters.create. For Kapsule, provider_cluster_id is the opaque region-qualified regions/{region}/clusters/{id} reference. CNI is immutable. Imported/unknown provenance is disconnect-only; provider deletion is allowed by default only for created clusters.
import requests
url = "https://platform.ankra.app/org/clusters/managed/{provider}"
payload = {
"credential_id": "11111111-2222-4333-8444-555555555555",
"location": "fr-par",
"name": "kapsule-prod",
"node_pools": [
{
"autohealing": True,
"count": 3,
"name": "default",
"public_ip": False,
"root_volume_type": "sbs-5k",
"size": "DEV1-M",
"zone": "fr-par-1"
}
]
}
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({
credential_id: '11111111-2222-4333-8444-555555555555',
location: 'fr-par',
name: 'kapsule-prod',
node_pools: [
{
autohealing: true,
count: 3,
name: 'default',
public_ip: false,
root_volume_type: 'sbs-5k',
size: 'DEV1-M',
zone: 'fr-par-1'
}
]
})
};
fetch('https://platform.ankra.app/org/clusters/managed/{provider}', 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/managed/{provider} \
--header 'Content-Type: application/json' \
--header 'X-Ankra-CSRF: <x-ankra-csrf>' \
--cookie ankra_session= \
--data '
{
"credential_id": "11111111-2222-4333-8444-555555555555",
"location": "fr-par",
"name": "kapsule-prod",
"node_pools": [
{
"autohealing": true,
"count": 3,
"name": "default",
"public_ip": false,
"root_volume_type": "sbs-5k",
"size": "DEV1-M",
"zone": "fr-par-1"
}
]
}
'{
"cluster_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"provenance": "created"
}{
"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.
Path Parameters
doks, uks, gke, ovh_mks, aks, eks, kapsule, ankracloud_k8s "kapsule"
Body
1Show child attributes
Show child attributes
cilium, cilium_native, calico production, staging, development, disposable Show child attributes
Show child attributes
1 - 50GitOps 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.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Ankra Cloud Kubernetes networking: an existing private network the nodes join (Ankra creates and owns ankra- otherwise), the RFC 1918 range of that created network, and the IPv4 API endpoint add-on (on unless refused).
Show child attributes
Show child attributes
Show child attributes
Show child attributes