diff --git a/containers/kubernetes/api-cli/managing-storage.mdx b/containers/kubernetes/api-cli/managing-storage.mdx new file mode 100644 index 0000000000..44a7797004 --- /dev/null +++ b/containers/kubernetes/api-cli/managing-storage.mdx @@ -0,0 +1,102 @@ +--- +meta: + title: Managing Block Storage volumes with Scaleway CSI + description: Learn how to manage Block Storage volumes using Scaleway's CSI driver on Kubernetes Kapsule and Kosmos clusters. +content: + h1: Managing Block Storage volumes with Scaleway CSI + paragraph: Learn how to manage Block Storage volumes using Scaleway's CSI driver on Kubernetes Kapsule and Kosmos clusters. +tags: block-storage scaleway-csi kubernetes pvc +dates: + validation: 2024-09-25 + posted: 2021-08-12 +categories: + - kubernetes +--- + +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. + + + +- A Scaleway account logged into the [console](https://console.scaleway.com) +- [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 +- A valid [API key](/identity-and-access-management/iam/how-to/create-api-keys/) +- Your Scaleway Project or Organization ID +- [Created](/containers/kubernetes/how-to/create-cluster/) a Kubernetes cluster running on Scaleway Instances (v1.21+) + + + 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. + + +## Verification of CSI driver status + +To verify if the driver is running, use the following command: + +```bash +kubectl get csidriver +``` + +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. + +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. + +## Upgrading to CSI version 0.3 + +### Using the API with curl + +You can trigger the migration to SBS-CSI using the following `curl` command: + +```bash +curl "https://api.scaleway.com/k8s/v1/regions/$REGION/clusters/$CLUSTER_ID/migrate-to-sbs-csi" \ +-X POST \ +-H "X-Auth-Token: $TOKEN" +``` + +Replace the placeholders with the following: + +- `$REGION`: Your cluster's region (e.g., `fr-par`, `nl-ams`). +- `$CLUSTER_ID`: Your cluster ID. +- `$TOKEN`: Your Scaleway API token. + +This command will initiate the migration process for your cluster to the new SBS-CSI. + +### Using the Scaleway CLI + +Alternatively, you can use the Scaleway CLI to perform the migration. Ensure the CLI is installed and configured with your API credentials. + +1. Install and configure the Scaleway CLI, if you have not already: + ```bash + scw init + ``` + +2. Run the migration command: + + ```bash + scw k8s cluster migrate-to-sbs-csi $CLUSTER_ID --region=$REGION + ``` + + Replace `$REGION` and `$CLUSTER_ID` with your cluster’s region and ID, respectively. + +### Post-migration verification + +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). + +```bash +kubectl get csidriver +``` + +This command will confirm that the migration was successful. + +## Going further + +* [Creating persistent volumes with Scaleway Block Storage](https://github.com/scaleway/scaleway-csi/tree/release-0.3/examples/kubernetes#pvc--deployment) +* [Creating raw block volumes](https://github.com/scaleway/scaleway-csi/tree/release-0.3/examples/kubernetes#raw-block-volumes) +* [Importing existing Scaleway volumes](https://github.com/scaleway/scaleway-csi/tree/release-0.3/examples/kubernetes#importing-existing-scaleway-volumes) +* [Creating volume snapshots](https://github.com/scaleway/scaleway-csi/tree/release-0.3/examples/kubernetes#volume-snapshots) +* [Importing volume snapshots](https://github.com/scaleway/scaleway-csi/tree/release-0.3/examples/kubernetes#importing-snapshots) +* [How to crate a storage class](https://github.com/scaleway/scaleway-csi/tree/release-0.3/examples/kubernetes#different-storageclass) +* [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) +* [How to choose the number of IOPS](https://github.com/scaleway/scaleway-csi/tree/release-0.3/examples/kubernetes#choose-the-number-of-iops) + + * `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. + +* [Encrypting volumes](https://github.com/scaleway/scaleway-csi/tree/release-0.3/examples/kubernetes#encrypting-volumes) diff --git a/menu/navigation.json b/menu/navigation.json index 41b4b8da53..13acef88fe 100644 --- a/menu/navigation.json +++ b/menu/navigation.json @@ -1802,6 +1802,10 @@ "label": "Monitoring clusters", "slug": "cluster-monitoring" }, + { + "label": "Managing storage", + "slug": "managing-storage" + }, { "label": "Deploying External Secrets on Kubernetes Kapsule", "slug": "external-secrets-kubernetes"