|
| 1 | +--- |
| 2 | +meta: |
| 3 | + title: Managing Block Storage volumes with Scaleway CSI |
| 4 | + description: Learn how to manage Block Storage volumes using Scaleway's CSI driver on Kubernetes Kapsule and Kosmos clusters. |
| 5 | +content: |
| 6 | + h1: Managing Block Storage volumes with Scaleway CSI |
| 7 | + paragraph: Learn how to manage Block Storage volumes using Scaleway's CSI driver on Kubernetes Kapsule and Kosmos clusters. |
| 8 | +tags: block-storage scaleway-csi kubernetes pvc |
| 9 | +dates: |
| 10 | + validation: 2024-09-25 |
| 11 | + posted: 2021-08-12 |
| 12 | +categories: |
| 13 | + - kubernetes |
| 14 | +--- |
| 15 | + |
| 16 | +The [Scaleway Block Storage volume](https://www.scaleway.com/en/block-storage/) Container Storage Interface (CSI) driver is an implementation of the [CSI interface](https://github.com/container-storage-interface/spec/blob/master/spec.md) to provide a way to manage Scaleway block volumes through a container orchestration system, like Kubernetes. It is installed by default on every Kubernetes Kapsule and Kosmos cluster. |
| 17 | + |
| 18 | +<Macro id="requirements" /> |
| 19 | + |
| 20 | +- A Scaleway account logged into the [console](https://console.scaleway.com) |
| 21 | +- [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization |
| 22 | +- A valid [API key](/identity-and-access-management/iam/how-to/create-api-keys/) |
| 23 | +- Your Scaleway Project or Organization ID |
| 24 | +- [Created](/containers/kubernetes/how-to/create-cluster/) a Kubernetes cluster running on Scaleway Instances (v1.21+) |
| 25 | + |
| 26 | +<Message type="tip"> |
| 27 | + Refer to our video tutorial [Getting Started with Kubernetes Part 4 - Storage](/containers/kubernetes/videos/) to view a visual presentation and step-by-step guidance of how to manage Block Storage volumes on Kubernetes with the Scaleway CSI. |
| 28 | +</Message> |
| 29 | + |
| 30 | +## Verification of CSI driver status |
| 31 | + |
| 32 | +To verify if the driver is running, use the following command: |
| 33 | + |
| 34 | +```bash |
| 35 | +kubectl get csidriver |
| 36 | +``` |
| 37 | + |
| 38 | +The output of this command provides a quick status update on the CSI plugin within your Kubernetes cluster. For the latest features and enhancements, consider upgrading to [release 0.3](https://github.com/scaleway/scaleway-csi/tree/release-0.3#block-storage-low-latency), which supports **[Block Storage low latency](/storage/block/quickstart/)** volumes. |
| 39 | + |
| 40 | +To identify your current CSI release version, navigate to the [Cockpit interface](/observability/cockpit/how-to/access-grafana-and-managed-dashboards/), specifically the **Kubernetes Cluster - Overview** dashboard. |
| 41 | + |
| 42 | +## Upgrading to CSI version 0.3 |
| 43 | + |
| 44 | +### Using the API with curl |
| 45 | + |
| 46 | +You can trigger the migration to SBS-CSI using the following `curl` command: |
| 47 | + |
| 48 | +```bash |
| 49 | +curl "https://api.scaleway.com/k8s/v1/regions/$REGION/clusters/$CLUSTER_ID/migrate-to-sbs-csi" \ |
| 50 | +-X POST \ |
| 51 | +-H "X-Auth-Token: $TOKEN" |
| 52 | +``` |
| 53 | + |
| 54 | +Replace the placeholders with the following: |
| 55 | + |
| 56 | +- `$REGION`: Your cluster's region (e.g., `fr-par`, `nl-ams`). |
| 57 | +- `$CLUSTER_ID`: Your cluster ID. |
| 58 | +- `$TOKEN`: Your Scaleway API token. |
| 59 | + |
| 60 | +This command will initiate the migration process for your cluster to the new SBS-CSI. |
| 61 | + |
| 62 | +### Using the Scaleway CLI |
| 63 | + |
| 64 | +Alternatively, you can use the Scaleway CLI to perform the migration. Ensure the CLI is installed and configured with your API credentials. |
| 65 | + |
| 66 | +1. Install and configure the Scaleway CLI, if you have not already: |
| 67 | + ```bash |
| 68 | + scw init |
| 69 | + ``` |
| 70 | + |
| 71 | +2. Run the migration command: |
| 72 | + |
| 73 | + ```bash |
| 74 | + scw k8s cluster migrate-to-sbs-csi $CLUSTER_ID --region=$REGION |
| 75 | + ``` |
| 76 | + |
| 77 | + Replace `$REGION` and `$CLUSTER_ID` with your cluster’s region and ID, respectively. |
| 78 | + |
| 79 | +### Post-migration verification |
| 80 | + |
| 81 | +After initiating the migration, the cluster status will change to _updating_. Once the migration completes, you can verify that the CSI driver has been updated and that the new driver properly handles Persistent Volume Claims (PVCs). |
| 82 | + |
| 83 | +```bash |
| 84 | +kubectl get csidriver |
| 85 | +``` |
| 86 | + |
| 87 | +This command will confirm that the migration was successful. |
| 88 | + |
| 89 | +## Going further |
| 90 | + |
| 91 | +* [Creating persistent volumes with Scaleway Block Storage](https://github.com/scaleway/scaleway-csi/tree/release-0.3/examples/kubernetes#pvc--deployment) |
| 92 | +* [Creating raw block volumes](https://github.com/scaleway/scaleway-csi/tree/release-0.3/examples/kubernetes#raw-block-volumes) |
| 93 | +* [Importing existing Scaleway volumes](https://github.com/scaleway/scaleway-csi/tree/release-0.3/examples/kubernetes#importing-existing-scaleway-volumes) |
| 94 | +* [Creating volume snapshots](https://github.com/scaleway/scaleway-csi/tree/release-0.3/examples/kubernetes#volume-snapshots) |
| 95 | +* [Importing volume snapshots](https://github.com/scaleway/scaleway-csi/tree/release-0.3/examples/kubernetes#importing-snapshots) |
| 96 | +* [How to crate a storage class](https://github.com/scaleway/scaleway-csi/tree/release-0.3/examples/kubernetes#different-storageclass) |
| 97 | +* [How to choose a zone for the volumes](https://github.com/scaleway/scaleway-csi/tree/release-0.3/examples/kubernetes#specify-in-which-zone-the-volumes-are-going-to-be-created) |
| 98 | +* [How to choose the number of IOPS](https://github.com/scaleway/scaleway-csi/tree/release-0.3/examples/kubernetes#choose-the-number-of-iops) |
| 99 | + <Message type="tip"> |
| 100 | + * `sbs-5k` and `sbs-15k` are pre-configured storage classes designed to meet your IOPS requirements. You can achieve the equivalent of setting `iops:5k` in your custom class. |
| 101 | + </Message> |
| 102 | +* [Encrypting volumes](https://github.com/scaleway/scaleway-csi/tree/release-0.3/examples/kubernetes#encrypting-volumes) |
0 commit comments