Code Monkey home page Code Monkey logo

ploop-flexvol's Introduction

ploop-flexvol

A FlexVolume driver for kubernetes which allows you to mount Ploop volumes to your kubernetes pods.

Status

Kubernetes FlexVolumes are currently in Alpha state, so this plugin is as well. Use it at your own risk.

Using

Build

This project uses glide so the easiest way to install your dependencies is using that.

Run glide up to install your dependencies.

$ glide up
[INFO]  Downloading dependencies. Please wait...
[INFO]  --> Fetching updates for github.com/dustin/go-humanize.
[INFO]  --> Fetching updates for github.com/urfave/cli.
[INFO]  --> Fetching updates for github.com/kolyshkin/goploop-cli.
[INFO]  --> Fetching updates for github.com/jaxxstorm/flexvolume.
[INFO]  --> Detected semantic version. Setting version for github.com/urfave/cli to v1.19.1.
[INFO]  Resolving imports
[INFO]  Downloading dependencies. Please wait...
[INFO]  Setting references for remaining imports
[INFO]  Exporting resolved dependencies...
[INFO]  --> Exporting github.com/dustin/go-humanize
[INFO]  --> Exporting github.com/jaxxstorm/flexvolume
[INFO]  --> Exporting github.com/kolyshkin/goploop-cli
[INFO]  --> Exporting github.com/urfave/cli
[INFO]  Replacing existing vendor dependencies
[INFO]  Versions did not change. Skipping glide.lock update.
[INFO]  Project relies on 4 dependencies.

Then build the binary:

go build -o ploop main.go

Installing

In order to use the flexvolume driver, you'll need to install it on every node you want to use ploop on in the kubelet volume-plugin-dir. By default this is /usr/libexec/kubernetes/kubelet-plugins/volume/exec/

You need a directory for the volume driver vendor, so create it:

mkdir -p /usr/libexec/kubernetes/kubelet-plugins/volume/exec/jaxxstorm~ploop

Then drop the binary in there:

mv ploop /usr/libexec/kubernetes/kubelet-plugins/volume/exec/jaxxstorm~ploop/ploop

You can now use ploops as usual!

Pod Config

An example pod config would look like this:

apiVersion: v1
kind: Pod
metadata:
  name: nginx-ploop
spec:
  containers:
  - name: nginx
    image: nginx
    volumeMounts:
    - name: test
      mountPath: /data
    ports:
    - containerPort: 80
  nodeSelector:
    os: parallels # make sure you label your nodes to be ploop compatible 
  volumes:
  - name: test
    flexVolume:
      driver: "jaxxstorm/ploop" # this must match your vendor dir
      options:
        volumeId: "golang-ploop-test"
        size: "10G"
        volumePath: "/vstorage/storage_pool/kubernetes"

This will create a ploop volume /vstorage/storage_pool/kubernetes/golang-ploop-test. The block device which will be mounted will be at /vstorage/storage_pool/kubernetes/golang-ploop-test/golang-ploop-test and the DiskDescriptor.xml will be located at /vstorage/storage_pool/kubernetes/golang-ploop-test/DiskDescriptior.xml`

You can verify the ploop volume was created by finding the node where your pod was scheduled by running ploop list:

# ploop list
ploop18115  /vstorage/storage_pool/kubernetes/golang-ploop-test/golang-ploop-test

ploop-flexvol's People

Contributors

avagin avatar jaxxstorm avatar kolyshkin avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

kolyshkin

ploop-flexvol's Issues

Update build to use glide

Currently the build uses a rather crude go get method. Update it to use glide to install the deps

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.