https://github.com/sky-big/csi-hostpath
csi hostpath
https://github.com/sky-big/csi-hostpath
Last synced: 17 days ago
JSON representation
csi hostpath
- Host: GitHub
- URL: https://github.com/sky-big/csi-hostpath
- Owner: sky-big
- License: apache-2.0
- Created: 2021-05-25T09:39:10.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-26T03:40:36.000Z (almost 4 years ago)
- Last Synced: 2024-06-21T17:51:25.776Z (10 months ago)
- Language: Go
- Size: 59.7 MB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kubernetes HostPath CSI Plugin
## Overview
HostPath CSI plugin implement an interface between CSI enabled Container Orchestrator, This is exactly the same as the native HostPath plugin.
This project purpose is to learn how to write CSI plugin.## Quick Start
### Deploy Plugin
1. Clone the project on your Kubernetes cluster master node:
```
$ git clone https://github.com/sky-big/csi-hostpath.git
$ cd csi-hostpath
```2. To deploy the Plugin on your Kubernetes cluster, need ` Helm `:
```
$ helm install csi-hostpath ./deploy
```3. Use command ```kubectl get pods -n kube-system```to check Plugin status like:
```
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system hostpath-csi-controller-0 1/1 Running 0 11m
kube-system hostpath-csi-node-97hzx 2/2 Running 0 11m
kube-system hostpath-csi-node-hdv6n 2/2 Running 0 11m
kube-system hostpath-csi-node-z4qc4 2/2 Running 0 11m
```### Start Example
1. PVC setup host path, like this:
```
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: csi-hostpath-pvc
annotations:
# setup host path
csi-hostpath-path: /var/log
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: csi-hostpath
```2. Run example
```
# install storageclass
$ kubectl apply -f ./examples/storageclass.yaml# install pvc
$ kubectl apply -f ./examples/pvc.yaml# install pod
$ kubectl apply -f ./examples/nginx.yaml
```### Undeploy
1. undeploy
```
$ helm uninstall csi-hostpath
```