Kubernetes
Kubernetes API Product - v1 (v1)
APIs related to the Kubernetes product.
Endpoints related to the creation, listing, deletion, and retrieval of the kubeconfig for a Kubernetes cluster.
Create a cluster
Creates a Kubernetes cluster in Magalu Cloud.
Authorizations:
header Parameters
x-tenant-id required | string <uuid> User's UUID for identification. |
Request Body schema: application/json
name required | string <= 63 characters Kubernetes cluster name. The name is primarily intended for idempotence, and must be unique within a namespace. The name cannot be changed. The name must follow the following rules:
|
version | string The Kubernetes version for the cluster, specified in the standard "vX.Y.Z" format. If no version is provided, the latest available version will be used by default. |
description | string Default: "" A brief description of the Kubernetes cluster. |
zone | string Deprecated [Deprecated] This parameter is deprecated and its use won't create a cluster at requested zone. Identifier of the zone where the Kubernetes cluster will be located. |
enabled_bastion | boolean Deprecated Default: false [Deprecated] This parameter is deprecated and its use won't create a bastion server Enables the use of a bastion host for secure access to the cluster. |
enabled_server_group | boolean Default: true Enables the use of a server group with anti-affinity policy during the creation of the cluster and its node pools. |
Array of objects (CreateNodePoolRequest) An array representing a set of nodes within a Kubernetes cluster. | |
allowed_cidrs | Array of strings List of allowed CIDR blocks for API server access. |
cluster_ipv4_cidr | string (ClusterIpv4Cidr) Default: "192.168.0.0/16" The IP address CIDR used by the Pods in the cluster. The CIDR is always subdivided with a "/24" mask per node. If "192.168.0.0/16" is used, the first node PodCIDR will be "192.168.0.0/24", the second will be "192.168.1.0/24" and so forth. This configuration can only be used during the cluster creation and can not be updated later. If not specified, the "192.168.0.0/16" value is used by default. |
services_ipv4_cidr | string (ServicesIpv4Cidr) Default: "10.96.0.0/12" The IPv4 subnet CIDR used by Kubernetes Services. This parameter can only be set when creating a new cluster and can not be updated later. If not specified, the value of "10.96.0.0/12" will be used by default. |
Responses
Request samples
- Payload
{- "name": "cluster-example",
- "version": "v1.32.3",
- "description": "This is an example cluster.",
- "zone": "br-region-zone",
- "enabled_bastion": false,
- "enabled_server_group": false,
- "node_pools": [
- {
- "name": "nodepool-example",
- "flavor": "cloud-k8s.gp1.small",
- "replicas": 3,
- "tags": [
- "tag-value1"
], - "taints": [
- {
- "key": "example-key",
- "value": "valor1",
- "effect": "NoSchedule"
}
], - "auto_scale": {
- "min_replicas": 2,
- "max_replicas": 5
}, - "availability_zones": [
- "a",
- "b",
- "c"
]
}
], - "allowed_cidrs": [
- "192.168.1.0/24",
- "10.0.0.0/16"
], - "cluster_ipv4_cidr": "10.128.0.0/12",
- "services_ipv4_cidr": "10.128.0.0/12"
}
Response samples
- 201
- 400
- 401
- 403
- 404
- 429
- 500
{- "name": "cluster-example",
- "id": "10113826-624a-4801-900f-6a5742433411",
- "status": {
- "state": "Pending",
- "message": "Ready"
}, - "allowed_cidrs": [
- "192.168.1.0/24",
- "10.0.0.0/16"
], - "cluster_ipv4_cidr": "10.128.0.0/12",
- "services_ipv4_cidr": "10.128.0.0/12"
}
List all clusters
Lists all clusters for a user.
Authorizations:
header Parameters
x-tenant-id required | string <uuid> User's UUID for identification. |
Responses
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 500
{- "results": [
- {
- "id": "10113826-624a-4801-900f-6a5742433411",
- "name": "cluster-example",
- "status": {
- "state": "Pending",
- "message": "Ready"
}, - "version": "v1.22.9",
- "kube_api_server": {
- "disable_api_server_fip": true,
- "fixed_ip": "172.100.10.1",
- "floating_ip": "172.100.10.1",
- "port": 6443
}, - "description": "This is an example cluster",
- "project_id": "0000806e53ec429792a7885e63264411",
- "region": "br-ne-1a",
- "created_at": "2023-03-01T09:00:00Z",
- "machine_types_source": "external",
- "cluster_ipv4_cidr": "10.128.0.0/12",
- "services_ipv4_cidr": "10.128.0.0/12"
}
]
}
List a cluster by uuid
Lists detailed cluster information by cluster_uuid.
Authorizations:
path Parameters
cluster_id required | string <uuid> Cluster's UUID. |
header Parameters
x-tenant-id required | string <uuid> User's UUID for identification. |
Responses
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 500
{- "name": "cluster-example",
- "id": "10113826-624a-4801-900f-6a5742433411",
- "status": {
- "state": "Pending",
- "message": "Ready"
}, - "version": "v1.22.9",
- "description": "This is an example cluster",
- "project_id": "0000806e53ec429792a7885e63264411",
- "region": "br-ne-1a",
- "created_at": "2023-03-01T09:00:00Z",
- "updated_at": "2023-03-01T09:10:00Z",
- "network": {
- "uuid": "7c24eb01-9423-4f09-a2d2-99ba5df01411",
- "cidr": "00.0.0.0/00",
- "name": "k8s-clusterapi-cluster-example",
- "subnet_id": "c5f750a0-a032-477e-a23a-bcffab8b0707"
}, - "controlplane": {
- "id": "2cc6f625-7d67-4ed2-8c5e-24e5b40b951b",
- "name": "nodepool-example",
- "instance_template": {
- "flavor": {
- "name": "cloud-k8s.gp1.small",
- "id": "c777eaa7-d67c-46f4-9e4f-232bc9b67b58",
- "vcpu": 2,
- "ram": 4096,
- "size": 20
}, - "node_image": "ubuntu-2004-kube-v1.22.9-v1",
- "disk_size": 0,
- "disk_type": "string"
}, - "replicas": 3,
- "zone": [
- "br-ne-1b"
], - "tags": [
- "tag-example"
], - "labels": {
- "key1": "value1"
}, - "taints": [
- {
- "key": "example-key",
- "value": "value1",
- "effect": "NoSchedule"
}
], - "securityGroups": [
- "security-group-name"
], - "created_at": "2023-03-01T09:00:00Z",
- "updated_at": "2023-03-01T09:10:00Z",
- "auto_scale": {
- "min_replicas": 2,
- "max_replicas": 5
}, - "status": {
- "state": "Pending",
- "messages": [
- "Ready"
]
}, - "max_pods_per_node": 32,
- "availability_zones": [
- "a",
- "b",
- "c"
]
}, - "kube_api_server": {
- "disable_api_server_fip": true,
- "fixed_ip": "172.100.10.1",
- "floating_ip": "172.100.10.1",
- "port": 6443
}, - "node_pools": [
- {
- "id": "2cc6f625-7d67-4ed2-8c5e-24e5b40b951b",
- "name": "nodepool-example",
- "instance_template": {
- "flavor": {
- "name": "cloud-k8s.gp1.small",
- "id": "c777eaa7-d67c-46f4-9e4f-232bc9b67b58",
- "vcpu": 2,
- "ram": 4096,
- "size": 20
}, - "node_image": "ubuntu-2004-kube-v1.22.9-v1",
- "disk_size": 0,
- "disk_type": "string"
}, - "replicas": 3,
- "zone": [
- "br-ne-1b"
], - "tags": [
- "tag-example"
], - "labels": {
- "key1": "value1"
}, - "taints": [
- {
- "key": "example-key",
- "value": "value1",
- "effect": "NoSchedule"
}
], - "securityGroups": [
- "security-group-name"
], - "created_at": "2023-03-01T09:00:00Z",
- "updated_at": "2023-03-01T09:10:00Z",
- "auto_scale": {
- "min_replicas": 2,
- "max_replicas": 5
}, - "status": {
- "state": "Pending",
- "messages": [
- "Ready"
]
}, - "max_pods_per_node": 32,
- "availability_zones": [
- "a",
- "b",
- "c"
]
}
], - "addons": {
- "loadbalance": "string",
- "volume": "string",
- "secrets": "string"
}, - "allowed_cidrs": [
- "192.168.1.0/24",
- "10.0.0.0/16"
], - "machine_types_source": "external",
- "cluster_ipv4_cidr": "10.128.0.0/12",
- "services_ipv4_cidr": "10.128.0.0/12"
}
Delete a cluster
Deletes a cluster by cluster_uuid.
Authorizations:
path Parameters
cluster_id required | string <uuid> Cluster's UUID. |
header Parameters
x-tenant-id required | string <uuid> User's UUID for identification. |
Responses
Response samples
- 400
- 401
- 403
- 404
- 409
- 429
- 500
{- "id": "string",
- "message": "string"
}
Patches a cluster
Patches the mutable fields of a cluster
Authorizations:
path Parameters
cluster_id required | string <uuid> Cluster's UUID |
header Parameters
x-tenant-id required | string <uuid> User's UUID for identification. |
Request Body schema: application/json
allowed_cidrs | Array of strings |
Responses
Request samples
- Payload
{- "allowed_cidrs": [
- "string"
]
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 500
{- "allowed_cidrs": [
- "string"
]
}
Get kubeconfig cluster
Retrieves the kubeconfig of a Kubernetes cluster by cluster_uuid.
Authorizations:
path Parameters
cluster_id required | string <uuid> Schema to get the cluster's kubeconfig file. |
header Parameters
x-tenant-id required | string <uuid> User's UUID for identification. |
Responses
Response samples
- 400
- 401
- 403
- 404
- 429
- 500
{- "id": "string",
- "message": "string"
}
Endpoints related to the creation, listing of nodepools and nodes, updating, and deletion of nodepools for a Kubernetes cluster.
Create a node pool
Creates a node pool in a Kubernetes cluster.
Authorizations:
path Parameters
cluster_id required | string <uuid> Cluster's UUID. |
header Parameters
x-tenant-id required | string <uuid> User's UUID for identification. |
Request Body schema: application/json
name required | string <= 63 characters Name of the node pool. The name is primarily for idempotence and must be unique within a namespace. The name cannot be changed. The name must follow the following rules:
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
flavor required | string Definition of the CPU, RAM, and storage capacity of the nodes.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
replicas required | integer or null Default: 1 Number of replicas of the nodes in the node pool. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
tags | Array of strings List of tags applied to the node pool. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Array of objects (Taint) Property associating a set of nodes. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
object (AutoScale) Object specifying properties for updating workload resources in the Kubernetes cluster. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
max_pods_per_node | integer (MaxPodsPerNode) [ 8 .. 110 ] Default: 110 Maximum number of Pods allowed per node. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
availability_zones | Array of strings (AvailabilityZones) Items Enum: "a" "b" "c" List of availability zones where the resource can be created. |
Responses
Request samples
- Payload
{- "name": "nodepool-example",
- "flavor": "cloud-k8s.gp1.small",
- "replicas": 3,
- "tags": [
- "tag-value1"
], - "taints": [
- {
- "key": "example-key",
- "value": "value1",
- "effect": "NoSchedule"
}
], - "auto_scale": {
- "min_replicas": 2,
- "max_replicas": 5
}, - "max_pods_per_node": 32,
- "availability_zones": [
- "a",
- "b",
- "c"
]
}
Response samples
- 201
- 400
- 401
- 403
- 404
- 429
- 500
{- "id": "2cc6f625-7d67-4ed2-8c5e-24e5b40b951b",
- "name": "nodepool-example",
- "instance_template": {
- "flavor": {
- "name": "cloud-k8s.gp1.small",
- "id": "c777eaa7-d67c-46f4-9e4f-232bc9b67b58",
- "vcpu": 2,
- "ram": 4096,
- "size": 20
}, - "node_image": "ubuntu-2004-kube-v1.22.9-v1",
- "disk_size": 0,
- "disk_type": "string"
}, - "replicas": 3,
- "zone": [
- "br-ne-1b"
], - "tags": [
- "tag-example"
], - "labels": {
- "key1": "value1"
}, - "taints": [
- {
- "key": "example-key",
- "value": "value1",
- "effect": "NoSchedule"
}
], - "securityGroups": [
- "security-group-name"
], - "created_at": "2023-03-01T09:00:00Z",
- "updated_at": "2023-03-01T09:10:00Z",
- "auto_scale": {
- "min_replicas": 2,
- "max_replicas": 5
}, - "status": {
- "state": "Pending",
- "messages": [
- "Ready"
]
}, - "max_pods_per_node": 32,
- "availability_zones": [
- "a",
- "b",
- "c"
]
}
List node pools by cluster_id
Gets a node pool from a Kubernetes cluster by cluster_uuid.
Authorizations:
path Parameters
cluster_id required | string <uuid> Cluster's UUID. |
header Parameters
x-tenant-id required | string <uuid> User's UUID for identification. |
Responses
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 500
{- "results": [
- {
- "id": "2cc6f625-7d67-4ed2-8c5e-24e5b40b951b",
- "name": "nodepool-example",
- "instance_template": {
- "flavor": {
- "name": "cloud-k8s.gp1.small",
- "id": "c777eaa7-d67c-46f4-9e4f-232bc9b67b58",
- "vcpu": 2,
- "ram": 4096,
- "size": 20
}, - "node_image": "ubuntu-2004-kube-v1.22.9-v1",
- "disk_size": 0,
- "disk_type": "string"
}, - "replicas": 3,
- "zone": [
- "br-ne-1b"
], - "tags": [
- "tag-example"
], - "labels": {
- "key1": "value1"
}, - "taints": [
- {
- "key": "example-key",
- "value": "value1",
- "effect": "NoSchedule"
}
], - "securityGroups": [
- "security-group-name"
], - "created_at": "2023-03-01T09:00:00Z",
- "updated_at": "2023-03-01T09:10:00Z",
- "auto_scale": {
- "min_replicas": 2,
- "max_replicas": 5
}, - "status": {
- "state": "Pending",
- "messages": [
- "Ready"
]
}, - "max_pods_per_node": 32,
- "availability_zones": [
- "a",
- "b",
- "c"
]
}
]
}
Get node pool by node_pool_id
Gets nodes in a node pool by nodepool_uuid.
Authorizations:
path Parameters
cluster_id required | string <uuid> Cluster's UUID. |
node_pool_id required | string <uuid> Nodepool's UUID. |
header Parameters
x-tenant-id required | string <uuid> User's UUID for identification. |
Responses
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 500
{- "id": "2cc6f625-7d67-4ed2-8c5e-24e5b40b951b",
- "name": "nodepool-example",
- "instance_template": {
- "flavor": {
- "name": "cloud-k8s.gp1.small",
- "id": "c777eaa7-d67c-46f4-9e4f-232bc9b67b58",
- "vcpu": 2,
- "ram": 4096,
- "size": 20
}, - "node_image": "ubuntu-2004-kube-v1.22.9-v1",
- "disk_size": 0,
- "disk_type": "string"
}, - "replicas": 3,
- "zone": [
- "br-ne-1b"
], - "tags": [
- "tag-example"
], - "labels": {
- "key1": "value1"
}, - "taints": [
- {
- "key": "example-key",
- "value": "value1",
- "effect": "NoSchedule"
}
], - "securityGroups": [
- "security-group-name"
], - "created_at": "2023-03-01T09:00:00Z",
- "updated_at": "2023-03-01T09:10:00Z",
- "auto_scale": {
- "min_replicas": 2,
- "max_replicas": 5
}, - "status": {
- "state": "Pending",
- "messages": [
- "Ready"
]
}, - "max_pods_per_node": 32,
- "availability_zones": [
- "a",
- "b",
- "c"
]
}
Patch node pool replicas by node_pool_id
Updates nodes from a node pool by nodepool_uuid.
Authorizations:
path Parameters
cluster_id required | string <uuid> Cluster's UUID. |
node_pool_id required | string <uuid> Nodepool's UUID. |
header Parameters
x-tenant-id required | string <uuid> User's UUID for identification. |
Request Body schema: application/json
replicas | integer Number of replicas of the nodes in the node pool. |
object (AutoScale) Object specifying properties for updating workload resources in the Kubernetes cluster. |
Responses
Request samples
- Payload
{- "replicas": 0,
- "auto_scale": {
- "min_replicas": 2,
- "max_replicas": 5
}
}
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 500
{- "id": "2cc6f625-7d67-4ed2-8c5e-24e5b40b951b",
- "name": "nodepool-example",
- "instance_template": {
- "flavor": {
- "name": "cloud-k8s.gp1.small",
- "id": "c777eaa7-d67c-46f4-9e4f-232bc9b67b58",
- "vcpu": 2,
- "ram": 4096,
- "size": 20
}, - "node_image": "ubuntu-2004-kube-v1.22.9-v1",
- "disk_size": 0,
- "disk_type": "string"
}, - "replicas": 3,
- "zone": [
- "br-ne-1b"
], - "tags": [
- "tag-example"
], - "labels": {
- "key1": "value1"
}, - "taints": [
- {
- "key": "example-key",
- "value": "value1",
- "effect": "NoSchedule"
}
], - "securityGroups": [
- "security-group-name"
], - "created_at": "2023-03-01T09:00:00Z",
- "updated_at": "2023-03-01T09:10:00Z",
- "auto_scale": {
- "min_replicas": 2,
- "max_replicas": 5
}, - "status": {
- "state": "Pending",
- "messages": [
- "Ready"
]
}, - "max_pods_per_node": 32,
- "availability_zones": [
- "a",
- "b",
- "c"
]
}
Delete node pool by node_pool_id
Deletes a node pool in a Kubernetes cluster by nodepool_uuid.
Authorizations:
path Parameters
cluster_id required | string <uuid> Cluster's UUID. |
node_pool_id required | string <uuid> Nodepool's UUID. |
header Parameters
x-tenant-id required | string <uuid> User's UUID for identification. |
Responses
Response samples
- 400
- 401
- 403
- 404
- 429
- 500
{- "id": "string",
- "message": "string"
}
List nodes from a node pool by node_pool_id Deprecated
Lists nodes in a node pool by nodepool_uuid.
Authorizations:
path Parameters
cluster_id required | string <uuid> Cluster's UUID. |
node_pool_id required | string <uuid> Nodepool's UUID. |
header Parameters
x-tenant-id required | string <uuid> User's UUID for identification. |
Responses
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 500
{- "results": [
- {
- "id": "77b3a951-dc2c-4802-a246-63a3c7f7ecac",
- "name": "node-example",
- "namespace": "namespace-example",
- "cluster_name": "cluster-example",
- "nodepool_name": "nodepool-example",
- "created_at": "2023-03-01T09:00:00Z",
- "annotations": {
- "annotation-key1": "value1"
}, - "labels": {
- "label-key1": "value1"
}, - "taints": [
- {
- "key": "example-key",
- "value": "value1",
- "effect": "NoSchedule"
}
], - "addresses": [
- {
- "address": "address-example",
- "type": "Hostname"
}
], - "flavor": "cloud-k8s.gp1.small",
- "infrastructure": {
- "architecture": "amd64",
- "containerRuntimeVersion": "containerd://1.6.2",
- "kernelVersion": "5.4.0-122-generic",
- "kubeProxyVersion": "v1.22.9",
- "kubeletVersion": "v1.22.9",
- "operatingSystem": "linux",
- "osImage": "Ubuntu 20.04.4 LTS",
- "allocatable": {
- "cpu": "2",
- "ephemeral_storage": "18859814062",
- "hugepages_1Gi": "string",
- "hugepages_2Mi": "string",
- "memory": "3923640Ki",
- "pods": "110"
}, - "capacity": {
- "cpu": "2",
- "ephemeral_storage": "18859814062",
- "hugepages_1Gi": "string",
- "hugepages_2Mi": "string",
- "memory": "3923640Ki",
- "pods": "110"
}
}, - "status": {
- "state": "Pending",
- "message": "Ready"
}
}
]
}
V1alpha0 List node pools by cluster_id
V1alpha0 Gets a node pool from a Kubernetes cluster by cluster_uuid.
Authorizations:
path Parameters
cluster_id required | string <uuid> Cluster's UUID. |
header Parameters
x-tenant-id required | string <uuid> User's UUID for identification. |
Responses
Response samples
- 200
- 400
- 401
- 403
- 404
- 429
- 500
{- "results": [
- {
- "id": "2cc6f625-7d67-4ed2-8c5e-24e5b40b951b",
- "name": "nodepool-example",
- "flavor": "cloud-k8s.gp1.small",
- "replicas": 3,
- "auto_scale": {
- "min_replicas": 2,
- "max_replicas": 5
}, - "status": {
- "state": "Pending",
- "messages": [
- "Ready"
]
}
}
]
}
Endpoints related to listing available flavors (resource configurations) and Kubernetes versions for a Kubernetes cluster.
Response samples
- 200
- 400
- 401
- 403
- 429
- 500
{- "results": [
- {
- "nodepool": [
- {
- "name": "cloud-k8s.gp1.small",
- "id": "c777eaa7-d67c-46f4-9e4f-232bc9b67b58",
- "vcpu": 2,
- "ram": 4096,
- "size": 20,
- "sku": "sku-1234"
}
], - "controlplane": [
- {
- "name": "cloud-k8s.gp1.small",
- "id": "c777eaa7-d67c-46f4-9e4f-232bc9b67b58",
- "vcpu": 2,
- "ram": 4096,
- "size": 20,
- "sku": "sku-1234"
}
]
}
]
}
Response samples
- 200
- 400
- 401
- 403
- 429
- 500
{- "results": [
- {
- "nodepool": [
- {
- "name": "cloud-k8s.gp1.small",
- "id": "c777eaa7-d67c-46f4-9e4f-232bc9b67b58",
- "vcpu": 2,
- "ram": 4096,
- "size": 20,
- "sku": "sku-1234"
}
], - "controlplane": [
- {
- "name": "cloud-k8s.gp1.small",
- "id": "c777eaa7-d67c-46f4-9e4f-232bc9b67b58",
- "vcpu": 2,
- "ram": 4096,
- "size": 20,
- "sku": "sku-1234"
}
]
}
]
}