Giter Club home page Giter Club logo

fastcfs-csi's Introduction

FastCFS-CSI

English | 简体中文

Overview

The FastCFS Container Storage Interface (CSI) Driver provides a CSI interface used by Container Orchestrators to manage the lifecycle of FastCFS volumes.

Project status

Status: beta

Features

  • Static Provisioning - create a new or migrating existing FastCFS volumes, then create persistence volume (PV) from the FastCFS volume and consume the PV from container using persistence volume claim (PVC).
  • Dynamic Provisioning - uses persistence volume claim (PVC) to request the Kuberenetes to create the FastCFS volume on behalf of user and consumes the volume from inside container.
  • Mount Option - mount options could be specified in persistence volume (PV) to define how the volume should be mounted.
  • Volume Resizing - expand the volume size. The corresponding CSI feature (ExpandCSIVolumes) is beta since Kubernetes 1.16.

Note fastcfs-csi does not supports deletion for static PV. persistentVolumeReclaimPolicy in PV spec must be set to Retain to avoid PV delete attempt in csi-provisioner.

FastCFS CSI Driver on Kubernetes

Following sections are Kubernetes specific. If you are Kubernetes user, use followings for driver features, installation steps and examples.

Kubernetes Version Compatibility Matrix

FastCFS CSI Driver \ Kubernetes Version v1.17 v1.18+
master branch ? yes
v0.2.0 ? yes
v0.1.0 ? yes

Prerequisites

  • FastCFS v2.2.0 or later
  • Enable FastCFS Auth auth_enabled = true
  • Configuration files such as FastCFS client, auth module and cluster need to provide HTTP or HTTPS access. You can copy all configuration files of FastCFS to the root directory of the web server:
    • e.g: cp -r /etc/fastcfs /path/www && cd /path/www && python3 -m http.server 8080.
  • Get yourself familiar with how to setup Kubernetes and have a working Kubernetes cluster:
    • Enable flag --allow-privileged=true for kubelet and kube-apiserver
    • Enable kube-apiserver feature gates --feature-gates=CSINodeInfo=true,CSIDriverRegistry=true
    • Enable kubelet feature gates --feature-gates=CSINodeInfo=true,CSIDriverRegistry=true

Installation

Set up driver permission

The driver requires FastCFS secret to talk to FastCFS to manage the volume on user's behalf. There is a method to grant driver permission:

  • Using secret object - create an admin and user with proper permission, put that user's credentials (The default directory of FastCFS credentials is /etc/fastcfs/auth/keys) in secret manifest then deploy the secret.
curl https://raw.githubusercontent.com/happyfish100/fastcfs-csi/master/deploy/kubernetes/secret.yaml > secret.yaml
# Edit the secret with user credentials
kubectl apply -f secret.yaml

Then reference this key in your storage class.

Config node toleration settings

By default, driver tolerates taint CriticalAddonsOnly and has tolerationSeconds configured as 300, to deploy the driver on any nodes, please set helm Value.node.tolerateAllTaints to true before deployment

Deploy driver

Please see the compatibility matrix above before you deploy the driver

kubectl apply -k "github.com/happyfish100/fastcfs-csi/deploy/kubernetes/overlays/dev/?ref=main"

Edit the configmap and replace the cluster config. ConfigMap example

curl https://raw.githubusercontent.com/happyfish100/fastcfs-csi/master/deploy/kubernetes/base/csiplugin-configmap.yaml > csiplugin-configmap.yaml
kubectl replace -f csiplugin-configmap.yaml

Verify driver is running:

kubectl get pods

Alternatively, you could also install the driver using helm:

Add the fastcfs-csi Helm repository:

helm repo add fastcfs-csi https://happyfish100.github.io/fastcfs-csi
helm repo update

Then install a release of the driver using the chart

helm upgrade --install fastcfs-csi fastcfs-csi/fcfs-csi-driver

Deploy driver with debug mode

To view driver debug logs, run the CSI driver with -v=5 command line option

Examples

Make sure you follow the Prerequisites before the examples:

CSI spec and Kubernetes version compatibility

Please refer to the matrix in the Kubernetes documentation.

Development

Please go through CSI Spec and General CSI driver development guideline to get some basic understanding of CSI driver before you start.

Requirements

  • Golang 1.15.+
  • Ginkgo in your PATH for end-to-end testing
  • Docker 17.05+ for releasing

Dependency

Dependencies are managed through go module. To build the project, first turn on go mod using export GO111MODULE=on, then build the project using: make

Testing

  • To execute e2e tests, run: make test-e2e-single-nn and make test-e2e-multi-nn (Now it can only be executed locally, and you can connect to the FastCFS cluster locally)

Build Container Image

  • Build image : make image-csi

Helm and manifests

The helm chart for this project is in the charts/fcfs-csi-driver directory. The manifests for this project are in the deploy/kubernetes directory. All the manifests except kustomize patches are generated by running helm template. This keeps the helm chart and the manifests in sync.

When updating the helm chart:

  • Generate manifests: make generate-kustomize
  • There are values files in deploy/kubernetes/values used for generating some manifests
  • When adding a new resource template to the helm chart please update the generate-kustomize make target, the deploy/kubernetes/values files, and the appropriate kustomization.yaml file(s).

fastcfs-csi's People

Contributors

vazmin avatar happyfish100 avatar sungness avatar

Watchers

James Cloos 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.