import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.kubernetes_clusters.create_kubernetes_cluster(data={
"type": latitudesh_python_sdk.CreateKubernetesClusterType.KUBERNETES_CLUSTERS,
"attributes": {
"name": "my-cluster",
"project_id": "proj_6059EqYkOQj8p",
"site": "SAN3",
"plan": "c2-small-x86",
"ssh_keys": [
"ssh_VkE1DwV37dnZJ",
],
},
})
# Handle response
print(res){
"data": {
"type": "kubernetes_clusters",
"id": "kc_pRMLydp0dQKr1",
"attributes": {
"name": "my-cluster",
"status": "provisioning",
"control_plane_endpoint": "https://api.my-cluster.example.com:6443"
}
}
}Creates a new managed Kubernetes cluster. Maximum of 1 cluster per project.
Cluster names must follow Kubernetes naming rules: lowercase alphanumeric characters or hyphens, must start and end with an alphanumeric character, and be at most 63 characters long.
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.kubernetes_clusters.create_kubernetes_cluster(data={
"type": latitudesh_python_sdk.CreateKubernetesClusterType.KUBERNETES_CLUSTERS,
"attributes": {
"name": "my-cluster",
"project_id": "proj_6059EqYkOQj8p",
"site": "SAN3",
"plan": "c2-small-x86",
"ssh_keys": [
"ssh_VkE1DwV37dnZJ",
],
},
})
# Handle response
print(res){
"data": {
"type": "kubernetes_clusters",
"id": "kc_pRMLydp0dQKr1",
"attributes": {
"name": "my-cluster",
"status": "provisioning",
"control_plane_endpoint": "https://api.my-cluster.example.com:6443"
}
}
}Was this page helpful?