OVHcloud Managed Kubernetes service provides you with production-ready Kubernetes clusters without the hassle of installing or operating them. This guide will cover one of the first steps after ordering a cluster: managing nodes and node pools.
Depending on your preferred workflow, you can manage them through:
- The OVHcloud Control Panel.
- The OVHcloud API.
- The
NodePoolsCustom Resource Definition (CRD) viakubectl.
We will walk you through each method to help you efficiently scale and manage your Kubernetes infrastructure.
Requirements
- You have an OVHcloud Managed Kubernetes cluster
- If you plan to manage node pools using the
NodePoolsCRD, make sure you have the kubectl command-line tool installed.
You can find detailed installation instructions on the official Kubernetes website
On nodes and node pools
In your OVHcloud Managed Kubernetes cluster, nodes are grouped into node pools (groups of nodes sharing the same configuration).
When you order a new cluster, it is created with a default node pool. Refer to our guide on creating a cluster for more information.
In this guide, we explain how to do some basic operations with nodes and node pools using the Public Cloud section of the OVHcloud Control Panel.
In your OVHcloud Managed Kubernetes cluster, nodes are grouped into node pools (groups of nodes sharing the same configuration).
In the cluster creation call, you can specify the specs of the first node pool that will be created with it. Then, you can update this node pool or add additional node pools of different sizes and types.
Upon creation, a node pool is defined by its name (name), the type of instance within our available catalog (flavorName), the number of identical nodes that you want in that node pool (desiredNodes), and potentially self-defined boundaries to limit the value of desired nodes (minNodes and maxNodes).
You can also enable the autoscale feature, and the desiredNodes will be automatically updated at runtime within the minNodes and maxNodes boundaries, depending on the resource reservations of your workload (see Using the cluster autoscaler).
Setting the antiAffinity boolean ensures that nodes in that node pool will be created on different hypervisors (bare metal machines), ensuring the best availability for your workload. The maximum number of nodes is set to 5 if this feature is activated on a node pool (you can create multiple node pools, each with 5 anti-affinity nodes max).
Setting the template property will allow you to define some specs (annotations, finalizers, labels, taints, and schedulability) that will be applied to each node under this node pool.
You can enable the creation of Floating IPS with the attachFloatingIps parameter. If the enabled boolean is true, a Floating IP will be attached to each node.
Finally, the boolean monthlyBilled ensures that all nodes in a node pool will be spawned in monthly billing mode and therefore benefit from the monthly discount.
After creation, the desiredNodes, minNodes, maxNodes, autoscale, and template properties can also be edited at any time.
In this guide, we explain how to do some basic operations with nodes and node pools using the OVHcloud API: adding nodes to an existing node pool, creating a new node pool, etc.
In your OVHcloud Managed Kubernetes cluster, nodes are grouped into node pools (groups of nodes sharing the same configuration).
When you create your cluster, it's created with a default node pool. Then, you can modify the size of this node pool or add additional node pools of different sizes and types.
In this guide, we explain how to do some basic operations with nodes and node pools using the NodePools CRD: adding nodes to an existing node pool, creating a new node pool, etc.
Instructions
Accessing your cluster
Access our administration UI for your OVHcloud Managed Kubernetes clusters by clicking on Managed Kubernetes Service in the left-hand menu in the Public Cloud section of the OVHcloud Control Panel. In the table, select a cluster by clicking on the cluster name.
In this administration UI, you have several tabs:
-
Service: Here, you will have a global view of your cluster with important information like the status, the API URL, or the
kubectlconfiguration file. - Node pools: Here you will find the active node pools of your cluster. You will be able to add, resize, or remove node pools.
- APIServer access: You can add IPv4 ranges to restrict access to your cluster’s APIServer.
- Logs: Here you will find the logs for your Kubernetes cluster’s control plane.
From the OVHcloud API, click the Authentication button and log in to your account through SSO.
Choose the /cloud section, which you can filter with the term kube, to see all of the Kubernetes-related API calls.
Kubernetes Custom Resources are extensions of the Kubernetes API. Like the default Kubernetes resources, the Custom Resources are endpoints in the Kubernetes API that store collections of API objects of a certain kind. Custom Resources allows you to easily extend Kubernetes by adding new features and behaviors.
The simplest way to add a Custom Resource to Kubernetes is to define a CustomResourceDefinition (CRD) with the resource schema.
One of our targets in developing the node pools for OVHcloud Managed Kubernetes was to give our users the capability to fully manage node pools (and by extension nodes themselves) from within Kubernetes, so the logical way to do it was to propose them as Custom Resources in your Kubernetes cluster, by developing the NodePools CRD.
To verify that the NodePools CRD is available in your cluster, do:
You get the list of installed CRDs and, inside it, the nodepools.kube.cloud.ovh.us
You can get the details of the NodePools CRD by doing:
The most interesting part is the spec of the CRD, describing the NodePool object and its properties:
After creation:
- The
desiredNodescan be edited, and the node pool will automatically be resized to accommodate this new value. -
minNodes,maxNodes,autoscale, andautoscalingcan also be edited at any time. -
flavor,name, andantiAffinityare not editable.
Be aware that maxNodes is set by default to 5 when antiAffinity is enabled.
To configure cluster autoscaling based on node pools, follow the documentation Configuring the cluster autoscaler and Cluster autoscaler example. To customers developing their own autoscaling scripts, we strongly encourage you to define minNodes and maxNodes.
Getting your cluster information
Go to your Public Cloud project in the OVHcloud Control Panel and click on the Managed Kubernetes Service section. Click the name of your cluster.
Get the IDs of your clusters:
To list the details of a particular cluster:
Listing node pools
Go to your Public Cloud project in the OVHcloud Control Panel and click on the Managed Kubernetes Service, then click on the name of the relevant cluster.
On the following screen, choose the Node pools tab.
List your Public Cloud projects:
List your OVHcloud Managed Kubernetes clusters:
List the node pools in a cluster:
To list node pools, you can use:
In this case, we have one node pool in the cluster, called my-node-pool, with 2 B2-7 nodes:
You can see the state of the node pool, how many nodes you want in the pool (DESIRED), how many actually are (CURRENT), how many of them are up-to-date (UP-TO-DATE), and how many are available to be used (AVAILABLE).
Getting node pool details
Go to your Public Cloud project in the OVHcloud Control Panel and click on the Managed Kubernetes Service, then click on the name of the relevant cluster.
On the following screen, choose the Node pools tab and select the name of your pool.
List the details of a node pool in a cluster:
Use this command:
Creating a node pool
In the Node pools tab, click on the button Add a node pool.
Fill the fields to create a new node pool.
NOTE: The name of node pool should be in lowercase. The “_” and “.” characters are not allowed. The node pool name cannot begin with a number.
The subsequent node pool configuration steps are described in Creating a cluster.
To learn more about the flavors of the current OVHcloud range, refer to this page.
To create a node pool:
You will need to give it a flavorName parameter, with the flavor of the instance you want to create. For this tutorial, choose a general purpose node, like the b2-7 flavor.
If you want your node pool to have at least one node, set the desiredNodes to a value above 0.
To create a new node pool, you simply need to create a new node pool manifest.
Copy the next YAML manifest in a new-nodepool.yaml file:
antiAffinity, flavor, and name fields will not be editable after creation. You cannot change the monthlyBilled field from true to false.
Then apply it to your cluster:
Your new node pool will be created:
At the beginning, the new node pool is empty, but if you wait a few seconds, you will see how the nodes are progressively created and made available (one after another).
Updating a node pool
Configuring a node pool
To access the nodes' configuration, switch to the Node pools tab. Click on the more options ... button in the row of the node pool concerned, then select See nodes.
Here you can delete a node by clicking on the more options ... button to the right of the node.
Adding nodes to an existing node pool
In the Node pools tab, click on the more options ... button in the row of the node pool concerned, then select Configure node pool size.
In the pop-up window, you can resize your node pool by adding nodes. Alternatively, you can enable the autoscaling feature, which allows you to set the minimum and maximum pool size instead.
To upsize or downsize your node pool and set the desiredNodes to the new pool size:
You can also modify some other properties, through it is not possible to update/change the following parameters: antiAffinity, flavorName and name.
To upsize or downsize your node pool, you can simply edit the YAML file and reapply it.
For example, raise the desiredNodes to 5 in new-nodepool.yaml and apply the file:
antiaffinity, flavor and name fields can't be edited.
The DESIRED number of nodes has changed, and the two additional nodes will be created.
Then, after a few minutes:
You can also use kubectl scale —replicas=X to change the number of desired nodes. For example, let's resize it back to 2 nodes:
Then, after a few minutes:
Deleting a node pool
In the Node pools tab, click the more options ... button in the row of the node pool concerned, then select Delete pool.
Confirm the decision by typing DELETE into the field. Then, click the Delete button.
To delete a node pool:
You can simply use kubectl to delete a node pool, as any other Kubernetes resource:
After executing this command, Kubernetes will change the state of the nodes to Ready,SchedulingDisabled. After a little time, Nodes will be deleted.
Go further
To have an overview of the OVHcloud Managed Kubernetes service, visit the OVHcloud Managed Kubernetes page.
To deploy your first application on your Kubernetes cluster, we invite you to follow our guides to configure default settings for kubectl and to deploy a Hello World application.
For more information and tutorials, please see our other Managed Kubernetes or Platform as a Service guides. You can also explore the guides for other OVHcloud products and services.
If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for a custom analysis of your project.