ByCloud Docs
GuidesCLIAPISDK

PHP SDK

Kubernetes

Kubernetes clusters

7 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);