Skip to main content

Kubernetes

Kubernetes API Product - v1 (v1)

APIs related to the Kubernetes product.

cluster

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:
BearerAuthOAuth2
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:

  • must contain a maximum of 63 characters
  • must contain only lowercase alphanumeric characters or '-'
  • must start with an alphabetic character
  • must end with an alphanumeric character
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

Content type
application/json
{
  • "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": [
    ],
  • "allowed_cidrs": [
    ],
  • "cluster_ipv4_cidr": "10.128.0.0/12",
  • "services_ipv4_cidr": "10.128.0.0/12"
}

Response samples

Content type
application/json
{
  • "name": "cluster-example",
  • "id": "10113826-624a-4801-900f-6a5742433411",
  • "status": {
    },
  • "allowed_cidrs": [
    ],
  • "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:
BearerAuthOAuth2
header Parameters
x-tenant-id
required
string <uuid>

User's UUID for identification.

Responses

Response samples

Content type
application/json
{
  • "results": [
    ]
}

List a cluster by uuid

Lists detailed cluster information by cluster_uuid.

Authorizations:
BearerAuthOAuth2
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

Content type
application/json
{
  • "name": "cluster-example",
  • "id": "10113826-624a-4801-900f-6a5742433411",
  • "status": {
    },
  • "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": {
    },
  • "controlplane": {
    },
  • "kube_api_server": {
    },
  • "node_pools": [
    ],
  • "addons": {
    },
  • "allowed_cidrs": [
    ],
  • "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:
BearerAuthOAuth2
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

Content type
application/json
{
  • "id": "string",
  • "message": "string"
}

Patches a cluster

Patches the mutable fields of a cluster

Authorizations:
BearerAuthOAuth2
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

Content type
application/json
{
  • "allowed_cidrs": [
    ]
}

Response samples

Content type
application/json
{
  • "allowed_cidrs": [
    ]
}

Get kubeconfig cluster

Retrieves the kubeconfig of a Kubernetes cluster by cluster_uuid.

Authorizations:
BearerAuthOAuth2
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

Content type
application/json
{
  • "id": "string",
  • "message": "string"
}

nodepool

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:
BearerAuthOAuth2
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:

  • Must contain a maximum of 63 characters
  • Must contain only lowercase alphanumeric characters or '-'
  • Must start with an alphabetic character
  • Must end with an alphanumeric character
flavor
required
string

Definition of the CPU, RAM, and storage capacity of the nodes.

Flavor vCPUs RAM (GB) Root Disk (GB)
cloud-k8s.gp1.small 2 4 20
cloud-k8s.gp1.medium 4 8 50
cloud-k8s.gp1.large 8 16 100
cloud-k8s.gp2.small 2 4 300
cloud-k8s.gp2.large 8 32 300
cloud-k8s.hm1.medium 4 16 50
cloud-k8s.i1-c48-r96-d300 48 96 300
cloud-k8s.i1-c1-r8-d100 1 8 100
cloud-k8s.i1-c8-r8-d40 8 8 40
cloud-k8s.i1-c4-r16-d100 4 16 100
cloud-k8s.i1-c4-r32-d100 4 32 100
cloud-k8s.i1-c8-r32-d100 8 32 100
cloud-k8s.i1-c16-r32-d40 16 32 40
cloud-k8s.i1-c16-r64-d100 16 64 100
cloud-k8s.i1-c32-r64-d100 32 64 100
cloud-k8s.i1-c32-r128-d500 32 128 500
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

Content type
application/json
{
  • "name": "nodepool-example",
  • "flavor": "cloud-k8s.gp1.small",
  • "replicas": 3,
  • "tags": [
    ],
  • "taints": [
    ],
  • "auto_scale": {
    },
  • "max_pods_per_node": 32,
  • "availability_zones": [
    ]
}

Response samples

Content type
application/json
{
  • "id": "2cc6f625-7d67-4ed2-8c5e-24e5b40b951b",
  • "name": "nodepool-example",
  • "instance_template": {
    },
  • "replicas": 3,
  • "zone": [
    ],
  • "tags": [
    ],
  • "labels": {
    },
  • "taints": [
    ],
  • "securityGroups": [
    ],
  • "created_at": "2023-03-01T09:00:00Z",
  • "updated_at": "2023-03-01T09:10:00Z",
  • "auto_scale": {
    },
  • "status": {
    },
  • "max_pods_per_node": 32,
  • "availability_zones": [
    ]
}

List node pools by cluster_id

Gets a node pool from a Kubernetes cluster by cluster_uuid.

Authorizations:
BearerAuthOAuth2
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

Content type
application/json
{
  • "results": [
    ]
}

Get node pool by node_pool_id

Gets nodes in a node pool by nodepool_uuid.

Authorizations:
BearerAuthOAuth2
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

Content type
application/json
{
  • "id": "2cc6f625-7d67-4ed2-8c5e-24e5b40b951b",
  • "name": "nodepool-example",
  • "instance_template": {
    },
  • "replicas": 3,
  • "zone": [
    ],
  • "tags": [
    ],
  • "labels": {
    },
  • "taints": [
    ],
  • "securityGroups": [
    ],
  • "created_at": "2023-03-01T09:00:00Z",
  • "updated_at": "2023-03-01T09:10:00Z",
  • "auto_scale": {
    },
  • "status": {
    },
  • "max_pods_per_node": 32,
  • "availability_zones": [
    ]
}

Patch node pool replicas by node_pool_id

Updates nodes from a node pool by nodepool_uuid.

Authorizations:
BearerAuthOAuth2
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

Content type
application/json
{
  • "replicas": 0,
  • "auto_scale": {
    }
}

Response samples

Content type
application/json
{
  • "id": "2cc6f625-7d67-4ed2-8c5e-24e5b40b951b",
  • "name": "nodepool-example",
  • "instance_template": {
    },
  • "replicas": 3,
  • "zone": [
    ],
  • "tags": [
    ],
  • "labels": {
    },
  • "taints": [
    ],
  • "securityGroups": [
    ],
  • "created_at": "2023-03-01T09:00:00Z",
  • "updated_at": "2023-03-01T09:10:00Z",
  • "auto_scale": {
    },
  • "status": {
    },
  • "max_pods_per_node": 32,
  • "availability_zones": [
    ]
}

Delete node pool by node_pool_id

Deletes a node pool in a Kubernetes cluster by nodepool_uuid.

Authorizations:
BearerAuthOAuth2
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

Content type
application/json
{
  • "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:
BearerAuthOAuth2
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

Content type
application/json
{
  • "results": [
    ]
}

V1alpha0 List node pools by cluster_id

V1alpha0 Gets a node pool from a Kubernetes cluster by cluster_uuid.

Authorizations:
BearerAuthOAuth2
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

Content type
application/json
{
  • "results": [
    ]
}

info

Endpoints related to listing available flavors (resource configurations) and Kubernetes versions for a Kubernetes cluster.

Lists all available flavors

Lists all available flavors.

Authorizations:
BearerAuthOAuth2

Responses

Response samples

Content type
application/json
{
  • "results": [
    ]
}

Lists all available versions

Lists all available Kubernetes versions.

Authorizations:
BearerAuthOAuth2

Responses

Response samples

Content type
application/json
{
  • "results": [
    ]
}

flavor

Endpoints related to listing available flavors for a Kubernetes cluster.

Lists all available flavors

Lists all available flavors.

Authorizations:
BearerAuthOAuth2

Responses

Response samples

Content type
application/json
{
  • "results": [
    ]
}

version

Endpoints related to listing available Kubernetes versions for a Kubernetes cluster.

Lists all available versions

Lists all available Kubernetes versions.

Authorizations:
BearerAuthOAuth2

Responses

Response samples

Content type
application/json
{
  • "results": [
    ]
}