hostpath-provisioner

by rimusz

Helm chartv0.2.13App v0.2.5

hostpath-provisioner is an automatic provisioner creating Persistent Volumes from the hostpath.

About this chart

Hostpath Provisioner

This chart bootstraps a hostpath-provisioner deployment on a Kubernetes, which dynamically provisions Kubernetes HostPath Volumes, it is particularly handy to use on single-node Kubernetes cluster as kind.

Installing the Chart

To install the chart with the release name hostpath-provisioner:

$ helm upgrade --install hostpath-provisioner -n hostpath-provisioner rimusz/hostpath-provisioner

Note: On kind please delete the default storage class:

kubectl delete storageclass standard

The command deploys hostpath-provisioner on the Kubernetes cluster in the default configuration. The configuration section lists the parameters that can be configured during installation.

Deploying your own PersistentVolumeClaim

To deploy your own PVC, make sure that you have the correct storage-class as indicated by your values.yaml file.

For example:

kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: test-dynamic-volume-claim
spec:
  storageClassName: hostpath
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 100Mi

Uninstalling the Chart

To uninstall/delete the hostpath-provisioner deployment:

$ helm delete hostpath-provisioner

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the hostpath-provisioner chart and their default values.

ParameterDescriptionDefault
strategyTypePod recreation typeRecreate
image.repositoryThe image repository to pull fromquay.io/rimusz/hostpath-provisioner
image.tagThe image tag to use``
image.pullPolicyImage pull policyIfNotPresent
storageClass.createEnable creation of a StorageClass to consume this hostpath-provisioner instancetrue
storageClass.defaultClassEnable as default storage classtrue
storageClass.nameThe name to assign the created StorageClasshostpath
provisionerNameThe name to assign the created Provisionerhostpath
nodeHostPathSet the local HostPath to be used on the node/mnt/hostpath
reclaimPolicySet the reclaimPolicyDelete
rbac.createEnable RABCtrue
rbac.serviceAccountNameService account namedefault
resourcesResource limits for hostpath-provisioner pod{}
nodeSelectorNode Selector{}
tolerationsTolerations for pod assignment[]
affinityAffinity for pod assignment{}
$ helm upgrade -install hostpath-provisioner -n hostpath-provisioner rimusz/hostpath-provisioner \
  --set resources.limits.cpu=200m

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example,

$ helm upgrade -install hostpath-provisioner -n hostpath-provisioner rimusz/hostpath-provisioner -f values.yaml

Tip: You can use the default values.yaml as an example

Deploy hostpath-provisioner with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has hostpath-provisioner on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the charthostpath-provisioner is pinned at v0.2.13 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply