ByCloud Docs
GuidesCLIAPISDK

PHP SDK

Kubernetes

Kubernetes clusters and templates

12 methods

GET

listKubernetesClusters()

List Kubernetes clusters

Parameters

limit

integer

- Maximum number of items to return

marker

string

- ID of the last item from the previous page (for pagination)

name

string

- Filter by name (exact match or prefix with *)

status

string

- Filter by cluster status

Example

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->kubernetes->listKubernetesClusters();
print_r($result);
POST

createKubernetesCluster()

Create Kubernetes cluster

Parameters

name

string

required
cluster_template_id

string

required
keypair

string

- SSH keypair name

docker_volume_size

integer

- Docker volume size in GB

labels

object

master_flavor_id

string

flavor_id

string

master_count

integer

node_count

integer

create_timeout

integer

fixed_network

string

fixed_subnet

string

floating_ip_enabled

boolean

master_lb_enabled

boolean

Example

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->kubernetes->createKubernetesCluster([
'name' => 'production-cluster',
'cluster_template_id' => '550e8400-e29b-41d4-a716-446655440000'
]);
print_r($result);
GET

getKubernetesCluster()

Get Kubernetes cluster

Parameters

cluster_id

string

required

- Kubernetes Cluster ID

Example

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->kubernetes->getKubernetesCluster([
'cluster_id' => '550e8400-e29b-41d4-a716-446655440000'
]);
print_r($result);
PATCH

updateKubernetesCluster()

Update Kubernetes cluster

Parameters

cluster_id

string

required

- Kubernetes Cluster ID

node_count

integer

- New worker node count (for scaling)

Example

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->kubernetes->updateKubernetesCluster([
'cluster_id' => '550e8400-e29b-41d4-a716-446655440000'
]);
print_r($result);
DELETE

deleteKubernetesCluster()

Delete Kubernetes cluster

Parameters

cluster_id

string

required

- Kubernetes Cluster ID

Example

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->kubernetes->deleteKubernetesCluster([
'cluster_id' => '550e8400-e29b-41d4-a716-446655440000'
]);
print_r($result);
GET

getKubernetesClusterKubeconfig()

Get cluster kubeconfig

Parameters

cluster_id

string

required

- Kubernetes Cluster ID

Example

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->kubernetes->getKubernetesClusterKubeconfig([
'cluster_id' => '550e8400-e29b-41d4-a716-446655440000'
]);
print_r($result);
POST

resizeKubernetesCluster()

Resize Kubernetes cluster

Parameters

cluster_id

string

required

- Kubernetes Cluster ID

node_count

integer

required

- New worker node count

nodes_to_remove

array

- Specific nodes to remove (by name)

nodegroup

string

- Node group to resize

Example

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->kubernetes->resizeKubernetesCluster([
'cluster_id' => '550e8400-e29b-41d4-a716-446655440000',
'node_count' => 10
]);
print_r($result);
GET

listKubernetesTemplates()

List cluster templates

Parameters

limit

integer

- Maximum number of items to return

marker

string

- ID of the last item from the previous page (for pagination)

name

string

- Filter by name (exact match or prefix with *)

coe

string

- Filter by container orchestration engine

Example

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->kubernetes->listKubernetesTemplates();
print_r($result);
POST

createKubernetesTemplate()

Create cluster template

Parameters

name

string

required
coe

string

required
image_id

string

required
keypair_id

string

external_network_id

string

required
fixed_network

string

fixed_subnet

string

dns_nameserver

string

docker_storage_driver

string

docker_volume_size

integer

volume_driver

string

network_driver

string

http_proxy

string

https_proxy

string

no_proxy

string

labels

object

master_flavor_id

string

flavor_id

string

server_type

string

registry_enabled

boolean

insecure_registry

string

floating_ip_enabled

boolean

master_lb_enabled

boolean

Example

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->kubernetes->createKubernetesTemplate([
'name' => 'example-string',
'coe' => 'kubernetes',
'image_id' => '550e8400-e29b-41d4-a716-446655440000',
'external_network_id' => '550e8400-e29b-41d4-a716-446655440000'
]);
print_r($result);
GET

getKubernetesTemplate()

Get cluster template

Parameters

cluster_template_id

string

required

- Kubernetes Cluster Template ID

Example

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->kubernetes->getKubernetesTemplate([
'cluster_template_id' => '550e8400-e29b-41d4-a716-446655440000'
]);
print_r($result);
PATCH

updateKubernetesTemplate()

Update cluster template

Parameters

cluster_template_id

string

required

- Kubernetes Cluster Template ID

name

string

labels

object

Example

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->kubernetes->updateKubernetesTemplate([
'cluster_template_id' => '550e8400-e29b-41d4-a716-446655440000'
]);
print_r($result);
DELETE

deleteKubernetesTemplate()

Delete cluster template

Parameters

cluster_template_id

string

required

- Kubernetes Cluster Template ID

Example

<?php
use ByCloud\SDK\ByCloud;
$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);
$result = $client->kubernetes->deleteKubernetesTemplate([
'cluster_template_id' => '550e8400-e29b-41d4-a716-446655440000'
]);
print_r($result);