# Local-Path-Provisioner

## Overview

The source code and default configuration of the Building Block is available in our [GitLab](<https://code.syseleven.de/syseleven/building-blocks/helmfiles/local-path-provisioner>).

### Local-Path-Provisioner

The Local-Path-Provisioner supports an easy way to handle persistent volumes on your kubernetes nodes.

#### Recommended Setup

A recommended resource overview is listed in the table below.

| CPU / vCPU | Memory |
| --- | --- |
| 1 | 128MiB |

No further activities need to be carried out in advance.

### Adding The Building Block

Add the directory `syseleven-local-path-provisioner` to your control repository. Add a `.gitlab-ci.yml` to the directory with the following content:

```yaml
include:
  - project: syseleven/building-blocks/helmfiles/local-path-provisioner
    file: JobDevelopment.yaml
    ref: { { site.building_blocks.local_path_provisioner.version|e } }
  - project: syseleven/building-blocks/helmfiles/local-path-provisioner
    file: JobStaging.yaml
    ref: { { site.building_blocks.local_path_provisioner.version|e } }
  - project: syseleven/building-blocks/helmfiles/local-path-provisioner
    file: JobProduction.yaml
    ref: { { site.building_blocks.local_path_provisioner.version|e } }
```

Remove environments you are not using by removing their include.

### Required Configuration

No configuration is required.

### Usage

### Node Deployment

This example assumes that you have another node deployment without taints, and you want to deploy [pxc-operator](<https://documentation.syseleven.de/en/prior-docs/metakube-accelerator/building-blocks/database-cache/pxc-operator/index.md>). If you haven't, please ensure that the PCX operator, and the local-path provisioner have matching taints as well.

1. Create a deployment with the following configuration:
2. Select a local storage [flavor](<https://documentation.syseleven.de/en/prior-docs/openstack-cloud/reference/compute/#local-ssd-storage-instance-types-l1>)
3. Replica count depending on your database cluster requirements (we recommend at least 3)
4. Node labels

   - Key: `pxc-cluster`
   - Value: `true`
5. Node taints

   - Key: `pxc-cluster`
   - Value: `true`
   - Effect: `NoSchedule`
6. [Deploy](<#adding-the-building-block>) the local storage provisioner

### PVC Deployment

Local Path Provisioner will create storageClass `local-path` that can be used for creating PVCs. See [Usage](<https://github.com/rancher/local-path-provisioner/#usage>) for examples.

### Monitoring

### Additional Alert-Rules

- None

### Additional Grafana Dashboards

None

### Scaling Setup

no need for scaling setup necessary nor make any sense.

### Limitations

- No support for the volume capacity limit
- No volume quotas - PV will always be the size to the entire disk
- The underlying VM will break when you hit 100% usage
- Pods may get evicted from the VM and will loose data in the process (because the data is only local to the VM)
- No resizing
- Data is not automatically migrated to other VMs

### Release-Notes

Please find more infos on release notes and new features [release notes](<https://code.syseleven.de/syseleven/building-blocks/helmfiles/local-path-provisioner/-/blob/main/RELEASE-NOTES.md>)
