From 5c3c0afa365f346562c4920278316f8343edae98 Mon Sep 17 00:00:00 2001 From: Mayank <33252549+mynktl@users.noreply.github.com> Date: Wed, 16 Jun 2021 17:36:54 +0530 Subject: [PATCH] chore(chart): updating helm chart to configure LeaseTime, GraceTime and nfsServerAlpineImage (#35) * Updating helm chart to use nfsServerAlpineImage for nfs-server-alpine image name * Updating helm chart to set LeaseTime and GraceTime value in storageclass * updating app version to 0.4.0 * Update deploy/helm/charts/README.md Signed-off-by: mayank --- README.md | 6 ++++++ deploy/helm/charts/Chart.yaml | 4 ++-- deploy/helm/charts/README.md | 7 +++++++ deploy/helm/charts/templates/deployment.yaml | 8 ++++++-- .../charts/templates/kernel-nfs-storageclass.yaml | 8 ++++++++ deploy/helm/charts/values.yaml | 13 +++++++++++++ 6 files changed, 42 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 608f4ca..a7a8367 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,12 @@ metadata: value: "kernel" - name: BackendStorageClass value: "openebs-hostpath" + # LeaseTime defines the renewal period(in seconds) for client state + #- name: LeaseTime + # value: 30 + # GraceTime defines the recovery period(in seconds) to reclaim locks + #- name: GraceTime + # value: 30 provisioner: openebs.io/nfsrwx reclaimPolicy: Delete ``` diff --git a/deploy/helm/charts/Chart.yaml b/deploy/helm/charts/Chart.yaml index da65336..f7d8cf5 100644 --- a/deploy/helm/charts/Chart.yaml +++ b/deploy/helm/charts/Chart.yaml @@ -4,10 +4,10 @@ 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.2 +version: 0.4.0 # 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 +appVersion: 0.4.0 icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/openebs/icon/color/openebs-icon-color.png home: http://www.openebs.io/ keywords: diff --git a/deploy/helm/charts/README.md b/deploy/helm/charts/README.md index b8ac428..c011e5c 100644 --- a/deploy/helm/charts/README.md +++ b/deploy/helm/charts/README.md @@ -121,14 +121,21 @@ helm install openebs-nfs openebs-nfs/nfs-provisioner --namespace openebs --creat | `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.nfsServerAlpineImage.registry` | Registry for nfs-server-alpine | `""` | +| `nfsProvisioner.nfsServerAlpineImage.repository` | Image repository for nfs-server-alpine | `openebs/nfs-server-alpine` | +| `nfsProvisioner.nfsServerAlpineImage.tag` | Image tag for nfs-server-alpine | `""` | | `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"` | +| `nfsStorageClass.leaseTime` | Renewal period(in seconds) for NFS client state | `90` | +| `nfsStorageClass.graceTime` | Recovery period(in seconds) to reclaim locks for NFS client | `90` | | `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, diff --git a/deploy/helm/charts/templates/deployment.yaml b/deploy/helm/charts/templates/deployment.yaml index 756c1e0..6bdcbbe 100644 --- a/deploy/helm/charts/templates/deployment.yaml +++ b/deploy/helm/charts/templates/deployment.yaml @@ -75,8 +75,12 @@ spec: value: "{{ .Values.nfsServer.useClusterIP }}" - name: OPENEBS_IO_INSTALLER_TYPE value: "charts-helm" - # LEADER_ELECTION_ENABLED is used to enable/disable leader election. By default - # leader election is enabled. + # OPENEBS_IO_NFS_SERVER_IMG defines the nfs-server-alpine image name to be used + # while creating nfs volume + - name: OPENEBS_IO_NFS_SERVER_IMG + value: "{{ .Values.nfsProvisioner.nfsServerAlpineImage.registry }}{{ .Values.nfsProvisioner.nfsServerAlpineImage.repository }}:{{ default .Chart.AppVersion .Values.nfsProvisioner.nfsServerAlpineImage.tag }}" + # LEADER_ELECTION_ENABLED is used to enable/disable leader election. By default + # leader election is enabled. - name: LEADER_ELECTION_ENABLED value: "{{ .Values.nfsProvisioner.enableLeaderElection }}" # Process name used for matching is limited to the 15 characters diff --git a/deploy/helm/charts/templates/kernel-nfs-storageclass.yaml b/deploy/helm/charts/templates/kernel-nfs-storageclass.yaml index 45b26ff..abdfcab 100644 --- a/deploy/helm/charts/templates/kernel-nfs-storageclass.yaml +++ b/deploy/helm/charts/templates/kernel-nfs-storageclass.yaml @@ -17,6 +17,14 @@ metadata: - name: CustomServerConfig value: {{ .Values.nfsStorageClass.customServerConfig }} {{- end }} +{{- if .Values.nfsStorageClass.leaseTime }} + - name: LeaseTime + value: {{ .Values.nfsStorageClass.leaseTime }} +{{- end }} +{{- if .Values.nfsStorageClass.graceTime }} + - name: GraceTime + value: {{ .Values.nfsStorageClass.graceTime }} +{{- end }} {{- if .Values.nfsStorageClass.isDefaultClass }} storageclass.kubernetes.io/is-default-class: "true" {{- end }} diff --git a/deploy/helm/charts/values.yaml b/deploy/helm/charts/values.yaml index 47f2723..d45ecc2 100644 --- a/deploy/helm/charts/values.yaml +++ b/deploy/helm/charts/values.yaml @@ -40,6 +40,13 @@ nfsProvisioner: tag: pullPolicy: IfNotPresent enableLeaderElection: "true" + # Specify image name of nfs-server-alpine used for creating nfs server deployment + # If not mentioned, default value openebs/nfs-server-alpine:tag will be used where + # the tag will be the same as a provisioner-nfs image tag + nfsServerAlpineImage: + registry: + repository: openebs/nfs-server-alpine + tag: resources: # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little @@ -72,6 +79,12 @@ nfsStorageClass: # vulnerability. # USING THIS IS NOT RECOMMENDED customServerConfig: "" + # leaseTime defines the renewal period(in seconds) for client state + leaseTime: + # graceTime defines the recovery period(in seconds) to reclaim locks + # setting graceTime and leaseTime lower will reduce the io pause time during nfs server restart + graceTime: + nfsServer: useClusterIP: "true"