Skip to content

Commit

Permalink
chore(helm-chart): helm changes for v0.6.1 release (#96)
Browse files Browse the repository at this point in the history
Changes:
- updating appVersion to 0.6.1 in helm chart
- helm changes to configure resource requirements on NFS server
* tutorial for configuring resource requirements on NFS server

Signed-off-by: mittachaitu <[email protected]>
  • Loading branch information
sai chaithanya authored Aug 31, 2021
1 parent ab20fd2 commit 7f02304
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 6 deletions.
4 changes: 2 additions & 2 deletions deploy/helm/charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.6.0
version: 0.6.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.6.0
appVersion: 0.6.1
icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/openebs/icon/color/openebs-icon-color.png
home: http://www.openebs.io/
keywords:
Expand Down
5 changes: 3 additions & 2 deletions deploy/helm/charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,13 @@ helm install openebs-nfs openebs-nfs/nfs-provisioner --namespace openebs --creat
| `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 | `0.6.0` |
| `nfsProvisioner.image.tag` | Image tag for NFS Provisioner | `0.6.1` |
| `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 | `0.6.0` |
| `nfsProvisioner.nfsServerAlpineImage.tag` | Image tag for nfs-server-alpine | `0.6.1` |
| `nfsProvisioner.resources` | Resource request and limit for the container | `true` |
| `nfsProvisioner.securityContext` | Security context for container | `""` |
| `nfsProvisioner.tolerations` | NFS Provisioner pod toleration values | `""` |
Expand All @@ -135,6 +135,7 @@ helm install openebs-nfs openebs-nfs/nfs-provisioner --namespace openebs --creat
| `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` |
| `nfsStorageClass.nfsServerResources` | Resource requests and limits of NFS Server | `""` |
| `rbac.create` | Enable RBAC Resources | `true` |
| `rbac.pspEnabled` | Create pod security policy resources | `false` |

Expand Down
12 changes: 12 additions & 0 deletions deploy/helm/charts/templates/kernel-nfs-storageclass.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ metadata:
- name: GraceTime
value: {{ .Values.nfsStorageClass.graceTime }}
{{- end }}
{{- if .Values.nfsStorageClass.nfsServerResources }}
{{- if .Values.nfsStorageClass.nfsServerResources.requests }}
- name: NFSServerResourceRequests
value: |-
{{ toYaml .Values.nfsStorageClass.nfsServerResources.requests | indent 10 }}
{{- end }}
{{- if .Values.nfsStorageClass.nfsServerResources.limits }}
- name: NFSServerResourceLimits
value: |-
{{ toYaml .Values.nfsStorageClass.nfsServerResources.limits | indent 10 }}
{{- end }}
{{- end }}
{{- if .Values.nfsStorageClass.isDefaultClass }}
storageclass.kubernetes.io/is-default-class: "true"
{{- end }}
Expand Down
11 changes: 10 additions & 1 deletion deploy/helm/charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,16 @@ nfsStorageClass:
# 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:

# nfsServerResources defines the NFS server resource requests and limits
# Usually, below request and limits are good enough for NFS Server to work
# seamlessly(IOs will be taken care by kerner space process i.e nfsd).
nfsServerResources: {}
# requests:
# memory: 50Mi
# cpu: 50m
# limits:
# memory: 100Mi
# cpu: 100m

nfsServer:
useClusterIP: "true"
Expand Down
70 changes: 70 additions & 0 deletions docs/tutorial/configure-nfs-server-resource-requirements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Configure NFS Server Resource Requirements

Resource requirements([requests & limits](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits)) are required to improve the quality of service of a process. For more information about resource requirements refer following docs:
- [CPU requests & limits](https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/#motivation-for-cpu-requests-and-limits)
- [Memory requests & limits](https://kubernetes.io/docs/tasks/configure-pod-container/assign-memory-resource/#motivation-for-memory-requests-and-limits)


**How to configure NFS server with resource requirements**?

- Create a NFS StorageClass by specifying resource requests & limits under `.metadata.annotations` as shown below:
```yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: openebs-rwx-resource-req
annotations:
openebs.io/cas-type: nfsrwx
cas.openebs.io/config: |
- name: NFSServerType
value: kernel
- name: BackendStorageClass
value: openebs-hostpath
- name: NFSServerResourceRequests
value: |-
cpu: 50m
memory: 50Mi
- name: NFSServerResourceLimits
value: |-
cpu: 100m
memory: 100Mi
provisioner: openebs.io/nfsrwx
reclaimPolicy: Delete
```
save above YAML into `openebs-rwx-resource-req.yaml` and create StorageClass in the cluster using below command:
```sh
kubectl apply -f openebs-rwx-resource-req.yaml
```
- Create a NFS PVC refering to above StorageClass
```yaml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: nfs-pvc
spec:
storageClassName: openebs-rwx-resource-req
accessModes:
- ReadWriteMany
resources:
requests:
storage: 5G
```
save above YAML into `nfs-pvc.yaml` and create PersistentVolumeClaim in the cluster using below command:
```sh
kubectl apply -f nfs-pvc.yaml
```
- Check for NFS server pod
```sh
kubectl get po -n openebs
NAME READY STATUS RESTARTS AGE
nfs-pvc-a970946b-aad5-47b3-93ff-ac238691dce0-5d9df94974-x6zxk 1/1 Running 0 38s
openebs-localpv-provisioner-b8d8d6967-8pxf7 1/1 Running 0 25m
openebs-nfs-provisioner-778b7f46d9-gslwv 1/1 Running 0 16m
```
- Verify whether NFS server pod contains resource requirements(requests & limits)
```sh
kubectl get po nfs-pvc-a970946b-aad5-47b3-93ff-ac238691dce0-5d9df94974-x6zxk -n openebs -ojsonpath='{.spec.containers[0].resources}'
{"limits":{"cpu":"100m","memory":"100Mi"},"requests":{"cpu":"50m","memory":"50Mi"}}
```
9 changes: 8 additions & 1 deletion tests/nfs_backend_sc_retain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,20 +154,24 @@ var _ = Describe("TEST BACKEND PV EXISTENCE WITH BACKEND SC HAVING RETAIN POLICY

When(fmt.Sprintf("pvc with storageclass %s is deleted", scName), func() {
It("should delete the pvc", func() {
var pvcObj *corev1.PersistentVolumeClaim
By(fmt.Sprintf("pvc with storageclass %s is deleted", scName))
err := Client.deletePVC(applicationNamespace, pvcName)
Expect(err).To(BeNil(), "while deleting pvc %s/%s", applicationNamespace, pvcName)

maxRetryCount := 10
isPvcDeleted := false
for retries := 0; retries < maxRetryCount; retries++ {
_, err := Client.getPVC(applicationNamespace, pvcName)
pvcObj, err = Client.getPVC(applicationNamespace, pvcName)
if err != nil && k8serrors.IsNotFound(err) {
isPvcDeleted = true
break
}
time.Sleep(time.Second * 5)
}
if !isPvcDeleted {
dumpK8sObject(pvcObj)
}
Expect(isPvcDeleted).To(BeTrue(), "pvc should be deleted")

isBackendPvcDeleted := false
Expand All @@ -179,6 +183,9 @@ var _ = Describe("TEST BACKEND PV EXISTENCE WITH BACKEND SC HAVING RETAIN POLICY
}
time.Sleep(time.Second * 5)
}
if !isPvcDeleted {
dumpK8sObject(pvcObj)
}
Expect(isBackendPvcDeleted).To(BeTrue(), "backend pvc should be deleted")
})
})
Expand Down

0 comments on commit 7f02304

Please sign in to comment.