Code Monkey home page Code Monkey logo

k8s-nfs's Introduction

k8s-nfs

用于集群外部通过nfs访问容器存储的插件,采用daemonset + hostport的方式,目前只实现对容器csi存储的访问

使用方式

工作节点要开启以下服务

  • systemctl start rpcbind.socket
  • systemctl start rpcbind

使用方式

// 编译代码和创建docker镜像
make publish 
// 在各个工作节点下载镜像
// 进入deploy目录,用helm安装
helm install k8s-nfs ./k8s-nfs
// 创建带有csi存储的pod容器
// 这个pod容器需带有NFSShare标签指定哪些volume需要nfs共享,多个volume则逗号分隔,如下
kind: Pod
apiVersion: v1
metadata:
  name: my-app
  labels:
      NFSShare: my-volume
spec:
  containers:
    .....
    .....
  volumes:
    - name: my-volume
      persistentVolumeClaim:
        claimName: csi-pod-pvc
// 最后集群外部就可以通过nfs访问
mount -t nfs 节点ip:/共享目录 /挂载目录

k8s-nfs's People

Contributors

liuminjian avatar

Watchers

 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.