Coder Social home page Coder Social logo

ggaaooppeenngg / juicefs-csi-driver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juicedata/juicefs-csi-driver

0.0 2.0 0.0 293 KB

JuiceFS CSI Driver

Home Page: https://github.com/juicedata/juicefs

License: Apache License 2.0

Dockerfile 3.87% Makefile 5.47% Go 79.57% Shell 7.90% Smarty 3.19%

juicefs-csi-driver's Introduction

JuiceFS CSI Driver

Build Status

The JuiceFS Container Storage Interface (CSI) Driver implements the CSI specification for container orchestrators to manage the lifecycle of JuiceFS file system.

Installation

Deploy the driver:

kubectl apply -f https://raw.githubusercontent.com/juicedata/juicefs-csi-driver/master/deploy/k8s.yaml

If the CSI driver couldn't be discovered by Kubernetes and the error like this: driver name csi.juicefs.com not found in the list of registered CSI drivers , check the kubelet path for kubernetes deployment from the kubelet process running with --root-dir . Run the following command:

ps -ef | grep kubelet | grep root-dir

on any non-master node of you Kubernetes cluster. If the result isn't empty, modify the CSI driver deployment k8s.yaml file with the new path and redeploy the CSI Storage Plugin again.

curl -sSL https://raw.githubusercontent.com/juicedata/juicefs-csi-driver/master/deploy/k8s.yaml | sed 's@/var/lib/kubelet@{{KUBELET_DIR}}@g' | kubectl apply -f -

Replace {{KUBELET_DIR}} with your own --root-dir value in above command.

Installation with Helm

Prerequisites

  • Kubernetes 1.14+
  • Helm 3.1.0

Install Helm

Helm is a tool for managing Kubernetes charts. Charts are packages of pre-configured Kubernetes resources.

To install Helm, refer to the Helm install guide and ensure that the helm binary is in the PATH of your shell.

Using Helm To Deploy

  1. Prepare a values.yaml file with access infomation about redis and object storage
storageClasses:
- name: juicefs-sc
  enabled: true
  reclaimPolicy: Delete
  backend:
    name: "<name>"
    metaurl: "<redis-url>"
    storage: "<storage-type>"
    accessKey: "<access-key>"
    secretKey: "<secret-key>"
    bucket: "<bucket>"
  1. Install
helm repo add juicefs-csi-driver https://juicedata.github.io/juicefs-csi-driver/
helm repo update
helm upgrade juicefs-csi-driver juicefs-csi-driver/juicefs-csi-driver --install -f ./values.yaml
  1. After above steps, juicefs-sc storage class is created

Upgrade CSI Driver

  1. Stop all pods using this driver.
  2. Upgrade driver:
    • If you're using latest tag, simple run kubectl rollout restart -f k8s.yaml and make sure juicefs-csi-controller and juicefs-csi-node pods are restarted.
    • If you have pinned to a specific version, modify your k8s.yaml to a newer version, then run kubectl apply -f k8s.yaml. Alternatively, if juicefs-csi-driver is installed using helm, we can also use helm to upgrade it.

Visit here for more versions.

Examples

Before the example, you need to:

  • Get yourself familiar with how to setup Kubernetes and how to use JuiceFS file system.
  • Make sure JuiceFS is accessible from Kuberenetes cluster. It is recommended to create the file system inside the same region as Kubernetes cluster.
  • Install JuiceFS CSI driver following the Installation steps.

Example links

Notes:

  • Since JuiceFS is an elastic file system it doesn't really enforce any file system capacity. The actual storage capacity value in persistence volume and persistence volume claim is not used when creating the file system. However, since the storage capacity is a required field by Kubernetes, you must specify the value and you can use any valid value e.g. 10Pi for the capacity.
  • kustomize 3.x is required to build some examples.

CSI Specification Compatibility

JuiceFS CSI Driver \ CSI Version v0.3 v1.0
master branch no yes

Interfaces

The following CSI interfaces are implemented:

  • Node Service: NodePublishVolume, NodeUnpublishVolume, NodeGetCapabilities, NodeGetInfo, NodeGetId
  • Identity Service: GetPluginInfo, GetPluginCapabilities, Probe

JuiceFS CSI Driver on Kubernetes

The following sections are Kubernetes specific. If you are a Kubernetes user, use this for driver features, installation steps and examples.

Kubernetes Version Compatibility

JuiceFS CSI Driver is compatible with Kubernetes v1.14+

Container Images

JuiceFS CSI Driver Version Image
master branch juicedata/juicefs-csi-driver:latest

Features

  • Static provisioning - JuiceFS file system needs to be created manually first, then it could be mounted inside container as a persistent volume (PV) using the driver.
  • Mount options - CSI volume attributes can be specified in the persistence volume (PV) to define how the volume should be mounted.
  • Read write many - Support ReadWriteMany access mode
  • Sub path - provision persisten volume with subpath in JuiceFS file system
  • Dynamic provisioning - allows storage volumes to be created on-demand

Validation

JuiceFS CSI driver has been validated in the following Kubernetes version

Kubernetes master
v1.19.2 / minikube v1.16.0 Yes
v1.20.2 / minikube v1.16.0 Yes

Known issues

JuiceFS CSI volumes can NOT reconcile #14

When juicefs-csi-node is killed, existing JuiceFS volume will become inaccessible. It will not recover automatically even after juicefs-csi-node reconcile.

Delete the pods mounting JuiceFS volume and recreate them to recover.

Develop

See DEVELOP document.

License

This library is licensed under the Apache 2.0 License.

juicefs-csi-driver's People

Contributors

rogerz avatar chnliyong avatar tonicmuroq avatar yujunz avatar davies avatar xiaogaozi avatar wph95 avatar suave avatar camper42 avatar swartz-k avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.