How to manage a Kubernetes Kosmos cluster
You can add nodes and pools to your Kosmos cluster from the Scaleway console or by using the API. Here, we show you how to edit from the console.
Before you start
To complete the actions presented below, you must have:
- A Scaleway account logged into the console
- Owner status or IAM permissions allowing you to perform actions in the intended Organization
- Created a Kubernetes Kosmos cluster
- External machines (
arm64
oramd64
) you want to add to your cluster that are running on Ubuntu or Debian
How to add a multi-cloud pool to your Kosmos cluster
A multi-cloud pool allows you to attach external Instances and servers to your cluster. Instances added to the same pool do not need to share the same configuration, nor do they have to be managed by the same Cloud provider.
- Click Kubernetes in the Containers section of the side menu. The Kubernetes creation page displays.
- From the drop-down menu, select the geographical region you want to manage.
- Click the cluster you want to add a pool to.
- Click the Pools tab.
- Click the + Add pool button. The pool creation wizard displays.
- Complete the following steps of the wizard:
- Choose a pool type. This can be a Scaleway Kubernetes Kapsule pool or a Kubernetes multi-cloud pool. This document concerns the addition of a multi-cloud pool.
- A name for the pool and, optionally, a description and tags.
- Click Add pool to finish.
How to add external nodes to your multi-cloud pool
In order to add external nodes to your multi-cloud cluster, you must first create a multi-cloud pool. For security reasons, it is recommended to configure an API key with the KubernetesExternalNodeRegister
IAM permission set.
- Click IAM & API keys on the top-right drop-down menu of the Scaleway console. The Identity and Access Management dashboard displays.
- Create an IAM Policy with the
KubernetesExternalNodeRegister
PermissionSet only. - Create an IAM Application linked with the policy created in the previous step.
- Create a new API key linked to the IAM application created in the previous step.
- Click Kubernetes in the Compute section of the side menu. The Kubernetes creation page displays.
- Click the cluster you want to add external nodes to.
- Click Nodes on the tab.
- Click + Add external node. The instructions for adding an external node display.
How to configure external nodes to join the cluster
-
Get your server's public IP and SSH to the server:
ssh <user>@<server_ip>
-
Download the
node-agent
program:wget https://scwcontainermulticloud.s3.fr-par.scw.cloud/node-agent_linux_amd64 && chmod +x node-agent_linux_amd64
-
Export the required environment variables:
export POOL_ID=<pool_id> POOL_REGION=<cluster_region> SCW_SECRET_KEY=<secret_key>
-
Execute the program to attach the node to the multi-cloud pool:
sudo -E ./node-agent_linux_amd64 -loglevel 0 -no-controller
How to detach nodes from your multi-cloud pool
- Click Kubernetes in the Compute section of the side menu. The Kubernetes creation page displays.
- From the drop-down menu, select the geographical region you want to manage.
- Click the cluster in question.
- Click the Nodes tab.
- Click more icon next to the node you want to edit, then click Delete on the menu. A pop-up asks you to confirm the action.
- Click Delete node.
How to upgrade nodes in a multi-cloud pool in your Kosmos cluster
The Kubernetes version of the existing nodes in your multi-cloud pool can be upgraded in place. Your workload will theoretically keep running during the upgrade, but it is best to drain the node before the upgrade.
- In the Pools section of your Kosmos cluster, click Upgrade next to the node pool. This will not cause any of your existing nodes to upgrade, but will instead ensure that any new nodes added to the pool will start up with the newer version.
- Run the installer program as you would do for a fresh node install, with the additional option
-self-update
. If the option is not available, download the program again from the Object Storage bucket. - Now the node will register itself with the Apiserver. Once it is ready, you will see the same node with two kubelet versions. The older node should end up
NotReady
after 5m, you can safely delete it withkubectl
. - Detach the older node in Scaleway API.