Git Product home page Git Product logo

umeq-csi's Introduction

CSI driver for qemu vm

DON'T USED FOR PRODUCTION!

Summary

use qemu-img create qcow2 format disk

use qmp protocol(for qemu) or use virsh command(for libvirt) attach disk to node

CSI: controller create volume
CSI: controller publish volume
CSI: node publish volume
CSI: node unpublish volume
CSI: controller unpublish volume
CSI: controller deleteVolume

agent the controller backend
plugin the csi implemention (should use csi sidecars to provide full stack csi driver)

Get Started

Requirements: a kubernetes cluster that running on qemu based vm like this:

> qemu-system-x86_64 -name k1 -enable-kvm -nographic -cpu host -drive format=qcow2,file=/fs/trust/vm/k1.qcow2,if=virtio -qmp unix:/run/k1.mon.sock,server,nowait -net bridge,br=br0 -m 8g -smp 8 -nic bridge,br=br0,model=virtio-net-pci,mac=52:54:00:00:00:01 -vnc :1

> qemu-system-x86_64 -name k2 -enable-kvm -nographic -cpu host -drive format=qcow2,file=/fs/trust/vm/k2.qcow2,if=virtio -qmp unix:/run/k2.mon.sock,server,nowait -net bridge,br=br0 -m 8g -smp 8 -nic bridge,br=br0,model=virtio-net-pci,mac=52:54:00:00:00:02 -vnc :2

> qemu-system-x86_64 -name k3 -enable-kvm -nographic -cpu host -drive format=qcow2,file=/fs/trust/vm/k3.qcow2,if=virtio -qmp unix:/run/k3.mon.sock,server,nowait -net bridge,br=br0 -m 8g -smp 8 -nic bridge,br=br0,model=virtio-net-pci,mac=52:54:00:00:00:01 -vnc :3
  1. Deploy csi agent to qemu host machine
> cat <EOF > config.yml
serverPort: 8080
socks:
- name: k1
  path: /run/k1.mon.sock
- name: k2
  path: /run/k2.mon.sock
- name: k3
  path: /run/k3.mon.sock
storage:
  default: /fs/trust/vm/csi/
EOF

> systemctl enable --now umeq-csi-agent
  1. Deploy csi to kubernetes

Tips: replace environment variable AGENT_SERVER as your correct host csi agent rest api address

kubectl create -f https://raw.githubusercontent.com/tasselsd/umeq-csi/master/distro/deployment.yml
  1. Create StorageClass use kind default
kubectl create -f https://raw.githubusercontent.com/tasselsd/umeq-csi/master/distro/storageclass.yml
  1. Try to create PersistentVolumeClaim
kubectl create -f https://raw.githubusercontent.com/tasselsd/umeq-csi/master/distro/pvc-test.yml

Contributing

This is a very early version, and you are very welcome to contribute.

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.