PHP SDK
Kubernetes
Kubernetes clusters and templates
12 methods
listKubernetesClusters()
List Kubernetes clusters
Parameters
limitinteger
- Maximum number of items to return
markerstring
- ID of the last item from the previous page (for pagination)
namestring
- Filter by name (exact match or prefix with *)
statusstring
- Filter by cluster status
Example
<?phpuse ByCloud\SDK\ByCloud;$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);$result = $client->kubernetes->listKubernetesClusters();print_r($result);
createKubernetesCluster()
Create Kubernetes cluster
Parameters
namestring
requiredcluster_template_idstring
requiredkeypairstring
- SSH keypair name
docker_volume_sizeinteger
- Docker volume size in GB
labelsobject
master_flavor_idstring
flavor_idstring
master_countinteger
node_countinteger
create_timeoutinteger
fixed_networkstring
fixed_subnetstring
floating_ip_enabledboolean
master_lb_enabledboolean
Example
<?phpuse 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);
getKubernetesCluster()
Get Kubernetes cluster
Parameters
cluster_idstring
required- Kubernetes Cluster ID
Example
<?phpuse ByCloud\SDK\ByCloud;$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);$result = $client->kubernetes->getKubernetesCluster(['cluster_id' => '550e8400-e29b-41d4-a716-446655440000']);print_r($result);
updateKubernetesCluster()
Update Kubernetes cluster
Parameters
cluster_idstring
required- Kubernetes Cluster ID
node_countinteger
- New worker node count (for scaling)
Example
<?phpuse ByCloud\SDK\ByCloud;$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);$result = $client->kubernetes->updateKubernetesCluster(['cluster_id' => '550e8400-e29b-41d4-a716-446655440000']);print_r($result);
deleteKubernetesCluster()
Delete Kubernetes cluster
Parameters
cluster_idstring
required- Kubernetes Cluster ID
Example
<?phpuse ByCloud\SDK\ByCloud;$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);$result = $client->kubernetes->deleteKubernetesCluster(['cluster_id' => '550e8400-e29b-41d4-a716-446655440000']);print_r($result);
getKubernetesClusterKubeconfig()
Get cluster kubeconfig
Parameters
cluster_idstring
required- Kubernetes Cluster ID
Example
<?phpuse ByCloud\SDK\ByCloud;$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);$result = $client->kubernetes->getKubernetesClusterKubeconfig(['cluster_id' => '550e8400-e29b-41d4-a716-446655440000']);print_r($result);
resizeKubernetesCluster()
Resize Kubernetes cluster
Parameters
cluster_idstring
required- Kubernetes Cluster ID
node_countinteger
required- New worker node count
nodes_to_removearray
- Specific nodes to remove (by name)
nodegroupstring
- Node group to resize
Example
<?phpuse 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);
listKubernetesTemplates()
List cluster templates
Parameters
limitinteger
- Maximum number of items to return
markerstring
- ID of the last item from the previous page (for pagination)
namestring
- Filter by name (exact match or prefix with *)
coestring
- Filter by container orchestration engine
Example
<?phpuse ByCloud\SDK\ByCloud;$client = new ByCloud(["token" => "YOUR_ACCESS_TOKEN"]);$result = $client->kubernetes->listKubernetesTemplates();print_r($result);
createKubernetesTemplate()
Create cluster template
Parameters
namestring
requiredcoestring
requiredimage_idstring
requiredkeypair_idstring
external_network_idstring
requiredfixed_networkstring
fixed_subnetstring
dns_nameserverstring
docker_storage_driverstring
docker_volume_sizeinteger
volume_driverstring
network_driverstring
http_proxystring
https_proxystring
no_proxystring
labelsobject
master_flavor_idstring
flavor_idstring
server_typestring
registry_enabledboolean
insecure_registrystring
floating_ip_enabledboolean
master_lb_enabledboolean
Example
<?phpuse 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);
getKubernetesTemplate()
Get cluster template
Parameters
cluster_template_idstring
required- Kubernetes Cluster Template ID
Example
<?phpuse 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);
updateKubernetesTemplate()
Update cluster template
Parameters
cluster_template_idstring
required- Kubernetes Cluster Template ID
namestring
labelsobject
Example
<?phpuse 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);
deleteKubernetesTemplate()
Delete cluster template
Parameters
cluster_template_idstring
required- Kubernetes Cluster Template ID
Example
<?phpuse 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);