Giter VIP home page Giter VIP logo

k8s-hostpath-provisioner's Introduction

Kubernetes hostPath PV provisioner

This is temporary workaround for Kubernetes local volume management until this feature will be implemented.

Usage

This provisioner requires custom kube-scheduler to be running in your cluster. You should edit your scheduler manifest and change container image there:

# ...
containers:
- image: image: nailgun/kube-scheduler-amd64:v1.6.2_hostpath.0
  command:
  - kube-scheduler
  - # your args here
# ...

After you have running custom scheduler, install the provisioner:

$ cd example
$ kubectl create -f sa.yaml -f cluster-roles.yaml -f cluster-role-bindings.yaml -f ds.yaml

Label all nodes that can provision hostPath volumes:

$ kubectl label node --all nailgun.name/hostpath=enabled

Now you can test it. You should annotate your nodes with information of available storage:

$ kubectl annotate node NODE_NAME hostpath.nailgun.name/ssd=/tmp/ssd

Then create test StorageClass, PVC and Pod:

$ kubectl create -f sc.yaml -f pvc.yaml -f test-pod.yaml

The test-pod will be always scheduled on the same node where the PVC has been provisioned.

Note StorageClass has hostPathName parameter equal to ssd which means that provisioner will search for a node having hostpath.nailgun.name/ssd annotation and it will use hostPath specified in the annotation. If you have more than one node with this annotation, node will be selected randomly.

You can also explicity specify node for PVC by adding nailgun.name/hostpath-node annotation to the PVC with the node name. But the node should also match StorageClass.

Limitations

This provisioner doesn't support any kind of storage isolation nor quotas. This is temporary solution to have working PVCs with local storage.

If a pod uses more then one PVC, they can be scheduled to different nodes and Pod will be failed to be scheduled.

Thanks

Thanks to @TamalSaha for the idea and first implementation.

k8s-hostpath-provisioner's People

Contributors

nailgun avatar

Watchers

 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.