- Notifications
You must be signed in to change notification settings - Fork 253
feat(k8s): use of sfs with k8s #5296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from 10 commits
Commits
Show all changes
16 commits Select commit Hold shift + click to select a range
04f8b28 feat(k8s): update sfs
bene2k1 8e6c98e feat(k8s): update sfs
bene2k1 19e6b9b feat(k8s): sfs
bene2k1 4c7c9b2 feat(k8s): use sfs
bene2k1 3ea6b60 feat(k8s): sfs
bene2k1 d61965e feat(k8s): update content
bene2k1 3747836 Update pages/kubernetes/how-to/use-sfs-with-kubernetes.mdx
bene2k1 6c5f91e Apply suggestions from code review
bene2k1 d3d78c4 Apply suggestions from code review
bene2k1 eaaf9c0 feat(k8s): update sfs
bene2k1 5f29e82 Apply suggestions from code review
bene2k1 92e0cb1 Update pages/kubernetes/how-to/use-sfs-with-kubernetes.mdx
bene2k1 65d3bd3 docs(k8s): update content
bene2k1 ddb04c4 Apply suggestions from code review
bene2k1 f4dd6ca Apply suggestions from code review
bene2k1 45acc9f docs(k8s): update warning
bene2k1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,267 @@ | ||
| --- | ||
| title: How to use SFS with Kubernetes Kapsule | ||
| description: This page explains how to use the Scaleway File Storage Container Storage Interface (CSI) driver to enable Kubernetes users to manage Scaleway File Storage volumes within their clusters. | ||
| tags: kubernetes kubernetes-kapsule kapsule sfs | ||
| dates: | ||
| validation: 2025-10-22 | ||
| posted: 2025-10-22 | ||
| categories: | ||
| - containers | ||
| - kubernetes | ||
| --- | ||
| import Requirements from '@macros/iam/requirements.mdx' | ||
| | ||
| The Scaleway File Storage Container Storage Interface (CSI) driver enables Kubernetes users to manage Scaleway File Storage file systems within their clusters. | ||
| The Scaleway File Storage CSI driver is designed to work with Kubernetes Kapsule and Kosmos clusters, providing a standardized interface to create, manage, and attach file storage volumes to your containerized workloads. For more details on Scaleway File Storage, refer to the [Scaleway File Storage documentation](https://www.scaleway.com/en/docs/file-storage/). | ||
| | ||
| ## Supported features | ||
| | ||
| The Scaleway File Storage CSI driver supports the following features: | ||
| | ||
| - Dynamic provisioning: Automatically create Scaleway File Storage volumes using PVCs and StorageClasses. | ||
| - Import of existing Volumes: Integrate pre-existing Scaleway File Storage volumes into Kubernetes. | ||
| - Volume upsizing: The size of the volume can be [increased](https://github.com/scaleway/scaleway-filestorage-csi/tree/main?tab=readme-ov-file#file-systems-resizing) without the need to detach the file system | ||
| - `ReadWriteOnce` access mode: The volume can be mounted as read-write by a single node. | ||
| - `ReadOnlyMany` access mode: The volume can be mounted read-only by many nodes. | ||
bene2k1 marked this conversation as resolved. Show resolved Hide resolved | ||
| - `ReadWriteMany` access mode: The volume can be mounted as read-write by many nodes. | ||
| | ||
bene2k1 marked this conversation as resolved. Show resolved Hide resolved | ||
| <Requirements /> | ||
| | ||
| - A Scaleway account logged into the [console](https://console.scaleway.com) | ||
| - [Owner](/iam/concepts/#owner) status or [IAM permissions](/iam/concepts/#permission) allowing you to perform actions in the intended Organization | ||
| - [Created](/kubernetes/how-to/create-cluster/) a Kubernetes Kapsule cluster | ||
bene2k1 marked this conversation as resolved. Show resolved Hide resolved | ||
| - Added the tag `scw-filestorage-csi` to your Kubernetes Kapsule cluster | ||
| - Access to the Scaleway File Storage API | ||
| | ||
| ## Installation | ||
bene2k1 marked this conversation as resolved. Show resolved Hide resolved | ||
| | ||
| The Scaleway File Storage CSI driver is preinstalled on Scaleway's managed Kubernetes. | ||
| | ||
| <Message type="note"> | ||
| This feature is currently in [Private Beta](https://www.scaleway.com/en/betas/), and available to selected testers only. | ||
bene2k1 marked this conversation as resolved. Outdated Show resolved Hide resolved bene2k1 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| </Message> | ||
| | ||
| You can run the following command to check that the CSI driver pods are running: | ||
| | ||
| ```bash | ||
| kubectl get pods -n kube-system -l app=scaleway-filestorage-csi | ||
bene2k1 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| ``` | ||
| | ||
| You should see the `scaleway-filestorage-csi-controller` and `scaleway-filestorage-csi-node` pods in a `Running` state. | ||
bene2k1 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
bene2k1 marked this conversation as resolved. Show resolved Hide resolved | ||
| ## Using the Scaleway File Storage CSI Driver | ||
| | ||
| The CSI driver supports dynamic provisioning of Persistent Volumes (PVs) and Persistent Volume Claims (PVCs). | ||
| | ||
| ### Creating a Persistent Volume Claim (PVC) | ||
| | ||
| 1. Create a file named `pvc.yaml`: | ||
| | ||
| ```yaml | ||
| apiVersion: v1 | ||
| kind: PersistentVolumeClaim | ||
| metadata: | ||
| name: my-pvc | ||
| spec: | ||
| accessModes: | ||
| - ReadWriteMany | ||
| resources: | ||
| requests: | ||
| storage: 100G | ||
bene2k1 marked this conversation as resolved. Show resolved Hide resolved | ||
| storageClassName: scw-fs | ||
| ``` | ||
| | ||
| <Message type="note"> | ||
| The minimum size for a File System is 100G. | ||
| </Message> | ||
| | ||
| Apply it: | ||
| | ||
| ```bash | ||
| kubectl apply -f pvc.yaml | ||
| ``` | ||
| | ||
| 2. Create a file named `pod.yaml`: | ||
| | ||
| ```yaml | ||
| apiVersion: v1 | ||
| kind: Pod | ||
| metadata: | ||
| name: my-app | ||
| spec: | ||
| containers: | ||
| - name: my-busybox | ||
| image: busybox | ||
| volumeMounts: | ||
| - name: my-volume | ||
| mountPath: "/data" | ||
| command: ["/bin/sh", "-c"] | ||
| args: ["tail -f /dev/null"] | ||
| volumes: | ||
| - name: my-volume | ||
| persistentVolumeClaim: | ||
| claimName: my-pvc | ||
| ``` | ||
| | ||
| Apply the pod configuration: | ||
| | ||
| ```bash | ||
| kubectl apply -f pod.yaml | ||
| ``` | ||
| | ||
| 3. Verify the mount: | ||
| | ||
| ```bash | ||
| kubectl get pods | ||
| kubectl exec -it my-app -- df -h /data | ||
| ``` | ||
| | ||
| ### Importing an existing File Storage volume | ||
| | ||
| 1. Create a `pv-import.yaml` file: | ||
| | ||
| ```yaml | ||
| apiVersion: v1 | ||
| kind: PersistentVolume | ||
| metadata: | ||
| name: test-pv | ||
| spec: | ||
| capacity: | ||
| storage: 100G | ||
| volumeMode: Filesystem | ||
| accessModes: | ||
| - ReadWriteMany | ||
| storageClassName: scw-fs | ||
| csi: | ||
| driver: filestorage.csi.scaleway.com | ||
| volumeHandle: fr-par/11111111-1111-1111-111111111111 | ||
| nodeAffinity: | ||
| required: | ||
| nodeSelectorTerms: | ||
| - matchExpressions: | ||
| - key: topology.filestorage.csi.scaleway.com/region | ||
| operator: In | ||
| values: | ||
| - fr-par | ||
| ``` | ||
| | ||
| Replace `volumeHandle` with the actual ID of your existing volume. | ||
| | ||
| Apply: | ||
| | ||
| ```bash | ||
| kubectl apply -f pv-import.yaml | ||
| ``` | ||
| | ||
| 2. Create `pvc-import.yaml`: | ||
| | ||
| ```yaml | ||
| apiVersion: v1 | ||
| kind: PersistentVolumeClaim | ||
| metadata: | ||
| name: my-imported-pvc | ||
| spec: | ||
| accessModes: | ||
| - ReadWriteMany | ||
| resources: | ||
| requests: | ||
| storage: 100G | ||
| storageClassName: scw-fs | ||
| volumeName: test-pv | ||
| ``` | ||
| | ||
| Apply: | ||
| | ||
| ```bash | ||
| kubectl apply -f pvc-import.yaml | ||
| ``` | ||
| | ||
| 3. Create the pod (reuse the example from earlier with `claimName: my-imported-pvc`): | ||
| | ||
| ```yaml | ||
| apiVersion: v1 | ||
| kind: Pod | ||
| metadata: | ||
| name: my-imported-app | ||
| spec: | ||
| containers: | ||
| - name: my-busybox | ||
| image: busybox | ||
| volumeMounts: | ||
| - name: my-volume | ||
| mountPath: "/data" | ||
| command: ["/bin/sh", "-c"] | ||
| args: ["tail -f /dev/null"] | ||
| volumes: | ||
| - name: my-volume | ||
| persistentVolumeClaim: | ||
| claimName: my-imported-pvc | ||
| ``` | ||
| | ||
| Apply: | ||
| | ||
| ```bash | ||
| kubectl apply -f pod.yaml | ||
| ``` | ||
| | ||
| 4. Verify: | ||
| | ||
| ```bash | ||
| kubectl get pods | ||
| kubectl exec -it my-imported-app -- ls /data | ||
| ``` | ||
| | ||
| ### Using a custom storage class | ||
| | ||
| 1. Create `storageclass.yaml`: | ||
| | ||
| ```yaml | ||
| apiVersion: storage.k8s.io/v1 | ||
| kind: StorageClass | ||
| metadata: | ||
| name: my-default-storage-class | ||
| annotations: | ||
| storageclass.kubernetes.io/is-default-class: "true" | ||
bene2k1 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| provisioner: filestorage.csi.scaleway.com | ||
| reclaimPolicy: Delete | ||
| ``` | ||
| | ||
| Apply: | ||
| | ||
| ```bash | ||
| kubectl apply -f storageclass.yaml | ||
| ``` | ||
| | ||
| 2. Update the PVC to use this storage class: | ||
| | ||
| ```yaml | ||
| apiVersion: v1 | ||
| kind: PersistentVolumeClaim | ||
| metadata: | ||
| name: my-pvc | ||
| spec: | ||
| accessModes: | ||
| - ReadWriteMany | ||
| resources: | ||
| requests: | ||
| storage: 100G | ||
| storageClassName: my-default-storage-class | ||
| ``` | ||
| | ||
| ### Specifying the region | ||
| | ||
| To specify a region explicitly for volume creation: | ||
| | ||
| ```yaml | ||
| apiVersion: storage.k8s.io/v1 | ||
| kind: StorageClass | ||
| metadata: | ||
| name: my-ams-storage-class | ||
bene2k1 marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| provisioner: filestorage.csi.scaleway.com | ||
| reclaimPolicy: Delete | ||
| allowedTopologies: | ||
| - matchLabelExpressions: | ||
| - key: topology.filestorage.csi.scaleway.com/region | ||
| values: | ||
| - fr-par | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.