Coder Social home page Coder Social logo

masquerade0097 / azurefile-csi-driver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kubernetes-sigs/azurefile-csi-driver

0.0 2.0 0.0 64.39 MB

Azure file Container Storage Interface (CSI) Storage Plugin

License: Apache License 2.0

Makefile 1.83% Shell 9.46% Go 84.58% Dockerfile 0.44% Smarty 0.47% Python 3.22%

azurefile-csi-driver's Introduction

azurefile CSI driver for Kubernetes

Travis Coverage Status FOSSA Status

About

This driver allows Kubernetes to use azure file volume, csi plugin name: file.csi.azure.com

Project Status

Status: Beta

Container Images & CSI Compatibility:

Azure File CSI Driver Version Image v1.0.0
master branch mcr.microsoft.com/k8s/csi/azurefile-csi:latest yes
v0.3.0 mcr.microsoft.com/k8s/csi/azurefile-csi:v0.3.0 yes
v0.2.0 mcr.microsoft.com/k8s/csi/azurefile-csi:v0.2.0 yes

Kubernetes Compatibility

Azure File CSI Driver\Kubernetes Version 1.13+
master branch yes
v0.3.0 yes
v0.2.0 yes

Driver parameters

Please refer to file.csi.azure.com driver parameters

storage class file.csi.azure.com parameters are compatible with built-in azurefile plugin

Prerequisite

if cluster is based on Managed Service Identity(MSI), make sure all agent nodes have Contributor role for current resource group

Install azurefile CSI driver on a kubernetes cluster

Please refer to install azurefile csi driver

E2E Usage example

1. create a pod with csi azurefile driver mount on linux

Option#1: Azurefile Dynamic Provisioning
  • Create an azurefile CSI storage class
kubectl create -f https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/storageclass-azurefile-csi.yaml
  • Create an azurefile CSI PVC
kubectl create -f https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/pvc-azurefile-csi.yaml
Option#2: Azurefile Static Provisioning(use an existing azure file share)
  • Use kubectl create secret to create azure-secret with existing storage account name and key
kubectl create secret generic azure-secret --from-literal accountname=NAME --from-literal accountkey="KEY" --type=Opaque
  • Create an azurefile CSI PV, download pv-azurefile-csi.yaml file and edit shareName in volumeAttributes
wget https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/pv-azurefile-csi.yaml
vi pv-azurefile-csi.yaml
kubectl create -f pv-azurefile-csi.yaml
  • Create an azurefile CSI PVC which would be bound to the above PV
kubectl create -f https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/pvc-azurefile-csi-static.yaml

2. validate PVC status and create an nginx pod

  • make sure pvc is created and in Bound status finally
watch kubectl describe pvc pvc-azurefile
  • create a pod with azurefile CSI PVC
kubectl create -f https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/nginx-pod-azurefile.yaml

3. enter the pod container to do validation

  • watch the status of pod until its Status changed from Pending to Running and then enter the pod container
$ watch kubectl describe po nginx-azurefile
$ kubectl exec -it nginx-azurefile -- bash
root@nginx-azurefile:/# df -h
Filesystem                                                                Size  Used Avail Use% Mounted on
overlay                                                                   30G   19G  11G   65%  /
tmpfs                                                                     3.5G  0    3.5G  0%   /dev
...
//f571xxx.file.core.windows.net/pvc-54caa11f-9e27-11e9-ba7b-0601775d3b69  1.0G  64K  1.0G  1%   /mnt/azurefile
...

In the above example, there is a /mnt/azurefile directory mounted as cifs filesystem.

Kubernetes Development

Please refer to development guide

Links

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.