Skip to content

Commit

Permalink
chore(helm): Update README, add StorageClass parameters (#31)
Browse files Browse the repository at this point in the history
* Update helm chart, README, and paths-ignore in GitHub Actions
* Additional installation instructions

Signed-off-by: Niladri Halder <[email protected]>
  • Loading branch information
niladrih authored May 15, 2021
1 parent 3de6ca6 commit d86accc
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
- 'develop'
- 'v*'
paths-ignore:
- 'deploy/**'
- 'deploy/helm/**'
- 'MAINTAINERS'
- '*.md'
- 'LICENSE'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ name: ci
on:
pull_request:
paths-ignore:
- 'deploy/**'
- 'deploy/helm/**'
- 'MAINTAINERS'
- '*.md'
- 'LICENSE'
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: Helm chart for OpenEBS Dynamic NFS PV. For instructions to install
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.3.0
version: 0.3.1
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 0.3.0
Expand Down
105 changes: 76 additions & 29 deletions deploy/helm/charts/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# OpenEBS NFS PV Provisioner
# OpenEBS NFS Provisioner

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

A Helm chart for openebs dynamic nfs provisioner. This chart bootstraps OpenEBS Dynamic NFS PV provisioner deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
A Helm chart for openebs dynamic nfs provisioner. This chart bootstraps OpenEBS Dynamic NFS Provisioner deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.


**Homepage:** <http://www.openebs.io/>
Expand All @@ -28,13 +28,46 @@ _See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation

## Install Chart

Please visit the [link](https://openebs.github.io/dynamic-nfs-provisioner/) for install instructions via helm3.
Run the following command to install the OpenEBS Dynamic NFS Provisioner helm chart using the default StorageClass as the Backend StorageClass:

```console
# Helm
$ helm install [RELEASE_NAME] openebs-nfs/nfs-provisioner
helm install [RELEASE_NAME] openebs-nfs/nfs-provisioner --namespace [NAMESPACE] --create-namespace
```

The chart requires a StorageClass to provision the backend volume for the NFS share. You can use the `--set-string nfsStorageClass.backendStorageClass=<storageclass-name>` flag in the `helm install` command to specify the Backend StorageClass. If a StorageClass is not specified, the default StorageClass is used.

Use the command below to get the name of the default StorageClasses in your cluster:

```console
kubectl get sc -o=jsonpath='{range .items[?(@.metadata.annotations.storageclass\.kubernetes\.io/is-default-class=="true")]}{@.metadata.name}{"\n"}{end}'
```

Sample command to install the OpenEBS Dynamic NFS Provisioner helm chart using the default StorageClass as BackendStorageClass:

```console
helm install openebs-nfs openebs-nfs/nfs-provisioner --namespace openebs --create-namespace
```

If you do not have an available StorageClass, you can install the [OpenEBS Dynamic LocalPV Provisioner helm chart](https://openebs.github.io/dynamic-localpv-provisioner) and use the 'openebs-hostpath' StorageClass as Backend Storage Class. Sample commands:

```console
# Add openebs-localpv repo
helm repo add openebs-localpv https://openebs.github.io/dynamic-localpv-provisioner
helm repo update

# Install localpv-provisioner
helm install openebs-localpv openebs-localpv/localpv-provisioner -n openebs --create-namespace \
--set openebsNDM.enabled=false \
--set deviceClass.enabled=false

# Install nfs-provisioner
helm install openebs-nfs openebs-nfs/nfs-provisioner -n openebs \
--set-string nfsStorageClass.backendStorageClass="openebs-hostpath"
```

Please visit this [link](https://helm.sh/docs/) for helm 3 installation instructions.

_See [configuration](#configuration) below._

_See [helm install](https://helm.sh/docs/helm/helm_install/) for command documentation._
Expand All @@ -44,7 +77,7 @@ _See [helm install](https://helm.sh/docs/helm/helm_install/) for command documen

```console
# Helm
$ helm uninstall [RELEASE_NAME]
helm uninstall [RELEASE_NAME] --namespace [NAMESPACE]
```

This removes all the Kubernetes components associated with the chart and deletes the release.
Expand All @@ -55,39 +88,53 @@ _See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command doc

```console
# Helm
$ helm upgrade [RELEASE_NAME] [CHART] --install
helm upgrade [RELEASE_NAME] [CHART] --install --namespace [NAMESPACE]
```


## Configuration

The following table lists the configurable parameters of the OpenEBS NFS PV Provisioner chart and their default values.

| Parameter | Description | Default |
| ------------------------------------------- | --------------------------------------------- | ----------------------------------------- |
| `analytics.enabled` | Enable sending stats to Google Analytics | `true` |
| `imagePullSecrets` | Provides image pull secret | `""` |
| `nfsProvisioner.enabled` | Enable NFS PV Provisioner | `true` |
| `nfsProvisioner.image.registry` | Registry for NFS PV Provisioner image | `""` |
| `nfsProvisioner.image.repository` | Image repository for NFS PV Provisioner | `openebs/provisioner-nfs` |
| `nfsProvisioner.image.tag` | Image tag for NFS PV Provisioner | `0.2.0` |
| `nfsProvisioner.image.pullPolicy` | Image pull policy for NFS PV Provisioner | `IfNotPresent` |
| `nfsProvisioner.annotations` | Annotations for NFS PV Provisioner metadata | `""` |
| `nfsProvisioner.nodeSelector` | Nodeselector for NFS PV Provisioner pods | `""` |
| `nfsProvisioner.tolerations` | NFS PV Provisioner pod toleration values | `""` |
| `nfsProvisioner.securityContext` | Security context for container | `""` |
| `nfsProvisioner.healthCheck.initialDelaySeconds` | Delay before liveness probe is initiated | `30` |
| `nfsProvisioner.healthCheck.periodSeconds` | How often to perform the liveness probe | `60` |
| `nfsProvisioner.enableLeaderElection` | Enable leader election | `true` |
| `rbac.create` | Enable RBAC Resources | `true` |
| `rbac.pspEnabled` | Create pod security policy resources | `false` |
| `nfsProvisioner.affinity` | NFS PV Provisioner pod affinity | `{}` |
The following table lists the configurable parameters of the OpenEBS Dynamic NFS Provisioner chart and their default values. You can modify different parameters by specifying the desired value in the `helm install` command by using the `--set` and/or the `--set-string` flag(s).

In the following sample command we modify `nfsStorageClass.backendStorageClass` to specify the StorageClass to be used to provision the backend volume used for the NFS share. We also use `nfsStorageClass.isDefaultClass` to set an annotation such that the 'openebs-kernel-nfs' StorageClass is used as the default StorageClass for the cluster.

```console
helm install openebs-nfs openebs-nfs/nfs-provisioner --namespace openebs --create-namespace \
--set-string nfsStorageClass.backendStorageClass="openebs-hostpath" \
--set nfsStorageClass.isDefaultClass=true
```

| Parameter | Description | Default |
| ------------------------------------- | --------------------------------------------- | ------------------------------- |
| `analytics.enabled` | Enable sending stats to Google Analytics | `true` |
| `fullnameOverride` | Set custom Full Name for resources. Defaults to ( Release-name + `nfsProvisioner.name` ) | `""` |
| `imagePullSecrets` | Provides image pull secret | `""` |
| `nameOverride` | Set custom name for resources. Defaults to `nfsProvisioner.name` | `""` |
| `nfsProvisioner.affinity` | NFS Provisioner pod affinity | `{}` |
| `nfsProvisioner.enabled` | Enable NFS Provisioner | `true` |
| `nfsProvisioner.enableLeaderElection` | Enable leader election | `true` |
| `nfsProvisioner.healthCheck.initialDelaySeconds` | Delay before liveness probe is initiated | `30` |
| `nfsProvisioner.healthCheck.periodSeconds` | How often to perform the liveness probe | `60` |
| `nfsProvisioner.image.registry` | Registry for NFS Provisioner image | `""` |
| `nfsProvisioner.image.repository` | Image repository for NFS Provisioner | `openebs/provisioner-nfs` |
| `nfsProvisioner.image.tag` | Image tag for NFS Provisioner | `""` |
| `nfsProvisioner.image.pullPolicy` | Image pull policy for NFS Provisioner image | `IfNotPresent` |
| `nfsProvisioner.annotations` | Annotations for NFS Provisioner metadata | `""` |
| `nfsProvisioner.nodeSelector` | Nodeselector for NFS Provisioner pod | `""` |
| `nfsProvisioner.resources` | Resource request and limit for the container | `true` |
| `nfsProvisioner.securityContext` | Security context for container | `""` |
| `nfsProvisioner.tolerations` | NFS Provisioner pod toleration values | `""` |
| `nfsStorageClass.backendStorageClass` | StorageClass to be used to provision the backend volume. If not specified, the default StorageClass is used. | `""` |
| `nfsStorageClass.isDefaultClass` | Make 'openebs-kernel-nfs' the default StorageClass | `"false"` |
| `nfsStorageClass.reclaimPolicy` | ReclaimPolicy for NFS PVs | `"Delete"` |
| `rbac.create` | Enable RBAC Resources | `true` |
| `rbac.pspEnabled` | Create pod security policy resources | `false` |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`.

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

```bash
helm install <release-name> -f values.yaml ----namespace openebs nfs-provisioner
```console
helm install <release-name> -f values.yaml ----namespace openebs openebs-nfs/nfs-provisioner --create-namespace
```

> **Tip**: You can use the default [values.yaml](values.yaml)
7 changes: 7 additions & 0 deletions deploy/helm/charts/templates/kernel-nfs-storageclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,12 @@ metadata:
- name: BackendStorageClass
value: {{ .Values.nfsStorageClass.backendStorageClass }}
{{- end }}
{{- if .Values.nfsStorageClass.customServerConfig }}
- name: CustomServerConfig
value: {{ .Values.nfsStorageClass.customServerConfig }}
{{- end }}
{{- if .Values.nfsStorageClass.isDefaultClass }}
storageclass.kubernetes.io/is-default-class: "true"
{{- end }}
provisioner: openebs.io/nfsrwx
reclaimPolicy: {{ .Values.nfsStorageClass.reclaimPolicy }}
7 changes: 7 additions & 0 deletions deploy/helm/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,14 @@ nfsStorageClass:
name: openebs-kernel-nfs
reclaimPolicy: Delete
nfsServerType: kernel
isDefaultClass: false
backendStorageClass: ""
# The customServerConfig key passes a custom /etc/exports configuration to
# the NFS servers created using this StorageClass.
# The configuration settings are not validated, and can lead to security
# vulnerability.
# USING THIS IS NOT RECOMMENDED
customServerConfig: ""

nfsServer:
useClusterIP: "true"
Expand Down

0 comments on commit d86accc

Please sign in to comment.