Skip to main content

clusters

Creates, updates, deletes, gets or lists a clusters resource.

Overview​

Nameclusters
TypeResource
Idovh.cloud_kube.clusters

Fields​

The following fields are returned by SELECT queries:

successful operation

NameDatatypeDescription
idstringCluster ID
namestringCluster name
load_balancers_subnet_idstring (uuid)OpenStack subnet ID that the load balancers will use. Optional, can be updated with endpoint /cloud/project/{serviceName}/kube/{kubeId}/updateLoadBalancersSubnetId, can only be set if privateNetworkId and nodesSubnetId are also set (wire: loadBalancersSubnetId)
nodes_subnet_idstringOpenStack subnet ID that the cluster nodes will use. Optional, can only be set on cluster creation or reset, can only be set if privateNetworkId is also set. If unspecified, it will be selected automatically when the first node is created. (wire: nodesSubnetId)
private_network_idstringOpenStack private network ID that the cluster will use. Optional, can only be set on cluster creation or reset. If unspecified, the cluster will use the public network. (wire: privateNetworkId)
audit_logs_subscribedbooleanTrue if cluster auditlogs forward has been subscribed (wire: auditLogsSubscribed)
control_plane_is_up_to_datebooleanTrue if control-plane is up to date (wire: controlPlaneIsUpToDate)
created_atstring (date-time)Cluster creation date (wire: createdAt)
customizationobjectKubernetes cluster customization
disable_public_networkingbooleanDisable public connectivity (wire: disablePublicNetworking)
ip_allocation_policyobjectIP allocation policy (wire: ipAllocationPolicy)
is_up_to_datebooleanTrue if all nodes and control-plane are up to date (wire: isUpToDate)
kube_proxy_modestringSelected mode for kube-proxy (iptables, ipvs) (wire: kubeProxyMode)
next_upgrade_versionsarrayKubernetes versions available for upgrade (wire: nextUpgradeVersions)
nodes_urlstringCluster nodes URL (wire: nodesUrl)
planstringThe cluster plan
private_network_configurationobjectThe private network configuration. This field is optional. (wire: privateNetworkConfiguration)
regionstringCluster region. Example: GRA11.
statusstringCluster status (DELETED, DELETING, ERROR, INSTALLING, MAINTENANCE, READY, REDEPLOYING, REOPENING, RESETTING, SUSPENDED, SUSPENDING, UNKNOWN, UPDATING, USER_ERROR, USER_QUOTA_ERROR, USER_WEBHOOK_PREVENTING_OPERATIONS_ERROR)
update_policystringCluster update policy (wire: updatePolicy)
updated_atstring (date-time)Cluster last update date (wire: updatedAt)
urlstringManagement URL of your cluster
versionstringKubernetes version of your cluster

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectkube_id, service_nameGet information about your managed Kubernetes cluster
listselectservice_namex_pagination_modeList your managed Kubernetes clusters
createinsertservice_name, regionCreate a new managed Kubernetes cluster
updateupdatekube_id, service_nameUpdate information about your managed Kubernetes cluster
deletedeletekube_id, service_nameDelete your managed Kubernetes cluster
audit_logsexeckubeId, service_nameGenerate a temporary URL to retrieve audit logs (Deprecated, will be removed)
kubeconfigexeckubeId, service_nameGenerate kubeconfig file
kubeconfig_resetexeckubeId, service_nameReset kubeconfig: Certificates will be regenerated, nodes will be reinstalled
log_urlexeckubeId, service_name, kindGenerates a temporary URL to read the logs of one kind. The URL expires.
resetexeckubeId, service_nameReset cluster: all Kubernetes data will be erased (pods, services, configuration, etc), nodes will be either deleted or reinstalled
restartexeckubeId, service_nameRestarting your control plane apiserver to invalidate cache without downtime (using force will create a slight downtime)
force_updateexeckubeId, service_nameForce cluster and node update to the latest patch within minor version or next minor version
update_load_balancers_subnet_idexeckubeId, service_nameUpdates the load balancers subnet ID
update_policyexeckubeId, service_name, updatePolicyChange the update policy of your cluster

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
api_hoststringThe OVHcloud API host. Selected by OVH_ENDPOINT (ovh-eu, ovh-ca or ovh-us; default ovh-eu). (default: api.eu.ovhcloud.com, x-stackQL-envVarSelector: {"envVar":"OVH_ENDPOINT","default":"ovh-eu","values":{"ovh-eu":"api.eu.ovhcloud.com","ovh-ca":"api.ca.ovhcloud.com","ovh-us":"api.us.ovhcloud.com"}})
kubeIdstringKube ID
kube_idstringKube ID (wire: kubeId)
service_namestringThe Public Cloud project ID. Resolved from OVH_CLOUD_PROJECT_SERVICE when set.
x_pagination_modestringSent as CachedObjectList-Pages by default so the list returns the full objects rather than their identifiers. (wire: X-Pagination-Mode)

SELECT examples​

Get information about your managed Kubernetes cluster

SELECT
id,
name,
load_balancers_subnet_id,
nodes_subnet_id,
private_network_id,
audit_logs_subscribed,
control_plane_is_up_to_date,
created_at,
customization,
disable_public_networking,
ip_allocation_policy,
is_up_to_date,
kube_proxy_mode,
next_upgrade_versions,
nodes_url,
plan,
private_network_configuration,
region,
status,
update_policy,
updated_at,
url,
version
FROM ovh.cloud_kube.clusters
WHERE kube_id = '{{ kube_id }}' -- required
AND service_name = '{{ service_name }}' -- required unless OVH_CLOUD_PROJECT_SERVICE is set
;

INSERT examples​

Create a new managed Kubernetes cluster

INSERT INTO ovh.cloud_kube.clusters (
customization,
disable_public_networking,
ip_allocation_policy,
kube_proxy_mode,
load_balancers_subnet_id,
name,
nodepool,
nodepools,
nodes_subnet_id,
plan,
private_network_configuration,
private_network_id,
region,
update_policy,
version,
service_name
)
SELECT
'{{ customization }}',
{{ disable_public_networking }},
'{{ ip_allocation_policy }}',
'{{ kube_proxy_mode }}',
'{{ load_balancers_subnet_id }}',
'{{ name }}',
'{{ nodepool }}',
'{{ nodepools }}',
'{{ nodes_subnet_id }}',
'{{ plan }}',
'{{ private_network_configuration }}',
'{{ private_network_id }}',
'{{ region }}' /* required */,
'{{ update_policy }}',
'{{ version }}',
'{{ service_name }}'
RETURNING
id,
name,
load_balancers_subnet_id,
nodes_subnet_id,
private_network_id,
audit_logs_subscribed,
control_plane_is_up_to_date,
created_at,
customization,
disable_public_networking,
ip_allocation_policy,
is_up_to_date,
kube_proxy_mode,
next_upgrade_versions,
nodes_url,
plan,
private_network_configuration,
region,
status,
update_policy,
updated_at,
url,
version
;

UPDATE examples​

Update information about your managed Kubernetes cluster

UPDATE ovh.cloud_kube.clusters
SET
name = '{{ name }}',
update_policy = '{{ update_policy }}'
WHERE
kube_id = '{{ kube_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set;

DELETE examples​

Delete your managed Kubernetes cluster

DELETE FROM ovh.cloud_kube.clusters
WHERE kube_id = '{{ kube_id }}' --required
AND service_name = '{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;

Lifecycle Methods​

EXEC variables use wire (API) names.

Generate a temporary URL to retrieve audit logs (Deprecated, will be removed)

EXEC ovh.cloud_kube.clusters.audit_logs
@kubeId='{{ kubeId }}' --required,
@service_name='{{ service_name }}' --required unless OVH_CLOUD_PROJECT_SERVICE is set
;