https://github.com/kube-land/hostpath-provisioner
Provision hostPath persistent volumes controller.
https://github.com/kube-land/hostpath-provisioner
hostpath-provisioner kubernetes volume
Last synced: about 2 months ago
JSON representation
Provision hostPath persistent volumes controller.
- Host: GitHub
- URL: https://github.com/kube-land/hostpath-provisioner
- Owner: kube-land
- Created: 2019-04-02T09:41:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-06T23:50:28.000Z (over 3 years ago)
- Last Synced: 2024-06-21T18:53:10.232Z (about 2 years ago)
- Topics: hostpath-provisioner, kubernetes, volume
- Language: Go
- Size: 11.5 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# hostpath-provisioner
The `hostpath-provisioner` will provision HostPath Persistent Volumes using Persistent Volumes Claims. It support setting size using storage requests. It uses disk project quota for both XFS and EXT4.
## Install
To install `hostpath-provisioner` controller:
```bash
kubectl apply -k install/
```
or by reference in your overlay as:
```yaml
# kustomization.yaml
bases:
- github.com/appspero/hostpath-provisioner//install?ref=master
```
The previous command will install the controller and it RBAC.
### Enabling quota on non-root partition
To enable quota on the non-root partition edit the configuration file `/etc/fstab`. For example:
```
# /etc/fstab
/dev/mapper/centos-disk /mnt/disk xfs defaults,pquota 0 0
```
To check current quota:
```bash
xfs_quota -xc 'report -h' /mnt/disk
```
### Enabling quota on the `/` (root) partition
To enable quota on the `/` (root) partition edit the grub configuration file `/etc/default/grub`. Search for the line that starts with `GRUB_CMDLINE_LINUX` and add `rootflags=uquota,gquota` to the command line parameters. Then
```bash
cp /boot/grub2/grub.cfg /boot/grub2/grub.cfg_bak
grub2-mkconfig -o /boot/grub2/grub.cfg
reboot
```
## Configuration
You can configure the host directory where the `hostpath-provisioner` will create the persistent volumes using the flag:
```
-pv-directory=/path/to/directory
```
Then create a storage class with `provisioner: appspero.com/hostpath` (check examples).
**Warning:** The default value of `-pv-directory` is `/tmp/hostpath-provisioner`. Using `/tmp/...` directory could be risky for persisting volume; it will be auto-cleaned by the OS.
## Build
To build `hostpath-provisioner`:
```bash
docker build -t abdullahalmariah/hostpath-provisioner:latest .
docker push abdullahalmariah/hostpath-provisioner:latest
```