Skip to main content

How to config file system settings in Kubernetes


This feature requires JuiceFS CSI Driver version 0.13.3 and above.

JuiceFS CSI Driver support setting juicefs format (Community Edition) or juicefs auth (Cloud Service Edition) command line options to initialize the file system or modify file system settings. This document shows how to apply file system settings to JuiceFS in Kubernetes. The command line options are different for the community edition and cloud service edition, but are used in the same way in the CSI Driver.

When creating a Secret (either "Static Provisioning" or "Dynamic Provisioning"), add the format-options option, and fill in the configuration items that need to be set with the , connection, as follows (take the community edition command line options as an example):

apiVersion: v1
kind: Secret
name: juicefs-secret
namespace: kube-system
type: Opaque
name: <NAME>
storage: s3
metaurl: redis://[:<PASSWORD>]@<HOST>:6379[/<DB>]
bucket: https://<BUCKET>.s3.<REGION>
access-key: <ACCESS_KEY>
secret-key: <SECRET_KEY>
format-options: trash-days=1,block-size=4096

In Secret, format-options has higher priority than other options. For example, Secret sets access-key, and format-options also sets access-key, then in when executing the juicefs format command, the value set in format-options will be used first.

For the specific configuration options of the community edition, please refer to the document, and for the specific configuration options of the cloud service edition, please refer to the document.