import requests
url = "https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/agent/tolerations"
payload = { "tolerations": [
{
"key": "<string>",
"value": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({tolerations: [{key: '<string>', value: '<string>'}]})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/agent/tolerations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/agent/tolerations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tolerations": [
{
"key": "<string>",
"value": "<string>"
}
]
}
'{
"tolerations": [
{
"key": "<string>",
"operator": "Equal",
"effect": "NoSchedule",
"value": "<string>"
}
],
"updated_at": "2023-11-07T05:31:56Z",
"apply_state": "not_set",
"message": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Set the cluster agent's extra tolerations
Replaces the extra tolerations Ankra holds for the cluster’s agent, so the agent can run on tainted nodes. Send the whole list, up to 8; an empty list stops holding any. Each toleration names a taint key, the operator Equal (with a value) or Exists, and the effect NoSchedule, PreferNoSchedule or NoExecute. There is no toleration_seconds: an agent that tolerates a NoExecute taint may be placed on, and is never evicted from, a node carrying it. Keys under node.kubernetes.io/ and node.cloudprovider.kubernetes.io/ are refused, because an agent tolerating a node condition could be left on a node that is down, and so are the taints the Cluster Autoscaler (ToBeDeletedByClusterAutoscaler, DeletionCandidateOfClusterAutoscaler), Karpenter (karpenter.sh/), Cilium (node.cilium.io/) and Ankra (ankra.io/, ankra.cloud/) put on a node they are removing, preparing or keeping work off. The held list is added to the tolerations of the agent’s own Helm release, and every later agent upgrade and every install command renders it. An online agent that accepts held tolerations re-renders its release at once and restarts onto it; an agent that predates the setting gets them from the first upgrade after it accepts them. A toleration allows the agent on a node and does not move it there. Clearing the list while every node the agent could run on is tainted leaves the agent Pending and the cluster offline. The bearer twin of ankra cluster agent tolerations set and clear.
import requests
url = "https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/agent/tolerations"
payload = { "tolerations": [
{
"key": "<string>",
"value": "<string>"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({tolerations: [{key: '<string>', value: '<string>'}]})
};
fetch('https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/agent/tolerations', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request PUT \
--url https://platform.ankra.app/api/v1/org/clusters/{cluster_id}/agent/tolerations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"tolerations": [
{
"key": "<string>",
"value": "<string>"
}
]
}
'{
"tolerations": [
{
"key": "<string>",
"operator": "Equal",
"effect": "NoSchedule",
"value": "<string>"
}
],
"updated_at": "2023-11-07T05:31:56Z",
"apply_state": "not_set",
"message": "<string>"
}{
"detail": "Cluster not found"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Body
Response
Successful Response