Skip to content

Commit

Permalink
feat(k8s): re-add managing storage doc
Browse files Browse the repository at this point in the history
  • Loading branch information
bene2k1 committed Oct 30, 2024
1 parent 26719b3 commit 220e090
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 0 deletions.
102 changes: 102 additions & 0 deletions containers/kubernetes/api-cli/managing-storage.mdx
Original file line number Diff line number Diff line change
@@ -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 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.

<Macro id="requirements" />

- 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+)

<Message type="tip">
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.
</Message>

## 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)
<Message type="tip">
* `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.
</Message>
* [Encrypting volumes](https://github.com/scaleway/scaleway-csi/tree/release-0.3/examples/kubernetes#encrypting-volumes)
4 changes: 4 additions & 0 deletions menu/navigation.json
Original file line number Diff line number Diff line change
Expand Up @@ -1674,6 +1674,10 @@
"label": "Monitoring clusters",
"slug": "cluster-monitoring"
},
{
"label": "Managing storage",
"slug": "managing-storage"
},
{
"label": "Managing tags",
"slug": "managing-tags"
Expand Down

0 comments on commit 220e090

Please sign in to comment.