lapwat's blog

How to Configure a Multi Cloud Kubernetes Cluster With Scaleway Kosmos

Scalway’s Kosmos multi-cloud solution offers you the possibility to handle the control-plane of your Kubernetes cluster for 100e / month. You can rent a server from any cloud provider and add it as a worker node to the cluster. It is great if you cannot find a server that suits you in Scaleway’s instances catalogue.

In this post we will configure an external server to act as a worker in the multi-cloud cluster. We will also install OpenEBS to handle the creation of ReadWriteMany volumes on the node itself.

There are some limitations with this setup.

Create a new multi-cloud cluster on Scaleway console.

Create a new multi-cloud pool on Scaleway console.

Add a node (server) to the pool, you should have:

Connect to your server as root

The server may not allow you to connect as root. If so, it will ask you to connect as ubuntu user instead. In the later case, you will need to execute the script multicloud-init with sudo.

Retrieve the multicloud-init script

wget https://scwcontainermulticloud.s3.fr-par.scw.cloud/multicloud-init.sh
chmod +x multicloud-init.sh

Export the required environment variables. Replace the values where needed.

export POOL_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx REGION=xx-xxx SCW_SECRET_KEY=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Execute the script to attach the node to the Multi-Cloud pool

./multicloud-init.sh -p $POOL_ID -r $REGION -t $SCW_SECRET_KEY

The node should appear on the Scaleway console. Wait for the blinking dot to become steady green.

When the node is ready, you can download kubectl config from the Scaleway console and configure your local kubectl with it.

Install OpenEBS Helm chart

Set nfs-provisioner flag to enable nfs.

helm repo add openebs https://openebs.github.io/charts
helm repo update
helm install --namespace openebs openebs openebs/openebs --create-namespace --set nfs-provisioner.enabled=true

Update default storage class

Disable scaleway as default storage class.

kubectl patch storageclass scw-bssd -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"false"}}}'

Set openebs-kernel-nfs as default storage class.

kubectl patch storageclass openebs-kernel-nfs -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'

Well done. Your cluster is now ready to create persistent volumes.