This document concerns the management of a Kosmos cluster. For a Kapsule cluster, refer to the corresponding documentation for Kapsule
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.
Nodes from multi-cloud pools cannot benefit from the autohealing and autoscaling features of Scaleway Kapsule pool. Since Scaleway does not have access to your other providers’ accounts, it is not possible to carry out actions such as automatic deletion, creation, and reboot of external nodes.
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.
- 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 Identity and Access Management (IAM) from the top-right of your Organization Dashboard in 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.
Tip
Identity and Access Management (IAM) allows you to share access to the management of your Scaleway resources and Organization settings, in a controlled and secure manner. For more information, refer to our dedicated IAM documentation.
- 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-controllerNoteThere is also an ARM binary (named
node-agent_linux_arm64
) for ARM-based nodes.
How to detach nodes from your multi-cloud pool
- Click Kubernetes in the Compute section of the side menu. The Kubernetes creation page displays.
- Click the cluster in question.
- Click the Nodes tab.
- Click «See 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.
Note
This action will remove your node from the cluster. Your external node will not be deleted from your other cloud provider account(s).
How to upgrade nodes in a multi-cloud pool in your Kosmos cluster
Note that the node will reappear with a different node ID. If your automation uses this ID (for instance when you use local PVCs), it will be broken.
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, redownload the program 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.