Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added nfs-client-provisioner app #127

Merged
merged 1 commit into from
Jun 19, 2020
Merged

Conversation

kadern0
Copy link
Contributor

@kadern0 kadern0 commented Jun 17, 2020

Signed-off-by: kadern0 kaderno@gmail.com

Fixes #121

Description

Motivation and Context

  • I have raised an issue to propose this change (required)

How Has This Been Tested?

Installed helm chart directly against minikube to test the installation. After that I installed it using arkade:

./arkade install nfs-client-provisioner --nfs-server=192.168.0.116 --nfs-path=/exports/
2020/06/17 19:00:46 Client: x86_64, Linux
2020/06/17 19:00:46 User dir established as: /home/pcaderno/.arkade/
"stable/nfs-client-provisioner" has been added to your repositories

VALUES values.yaml
Command: /home/pcaderno/.arkade/bin/helm3/helm [upgrade --install nfs-client-provisioner stable/nfs-client-provisioner --namespace default --values /tmp/charts/nfs-client-provisioner/values.yaml --set nfs.server=192.168.0.116 --set nfs.path=/exports/]
Release "nfs-client-provisioner" does not exist. Installing it now.
NAME: nfs-client-provisioner
LAST DEPLOYED: Wed Jun 17 19:00:53 2020
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
=======================================================================
= nfs-client-provisioner has been installed.                                   =
=======================================================================

# Test your NFS provisioner:

cat <<EOF | kubectl apply -f -
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: test-claim
  annotations:
    volume.beta.kubernetes.io/storage-class: "nfs-client"
spec:
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 1Mi
EOF

# Create pod:

cat <<EOF | kubectl apply -f -
kind: Pod
apiVersion: v1
metadata:
  name: test-pod
spec:
  containers:
  - name: test-pod
    image: gcr.io/google_containers/busybox:1.24
    command:
      - "/bin/sh"
    args:
      - "-c"
      - "touch /mnt/SUCCESS && exit 0 || exit 1"
    volumeMounts:
      - name: nfs-pvc
        mountPath: "/mnt"
  restartPolicy: "Never"
  volumes:
    - name: nfs-pvc
      persistentVolumeClaim:
        claimName: test-claim
EOF

# Now check your NFS Server for the file SUCCESS.

kubectl delete -f deploy/test-pod.yaml -f deploy/test-claim.yaml

# Now check the folder has been deleted.

Thanks for using arkade!

kubectl get storageclass

NAME                 PROVISIONER                            RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
nfs-client           cluster.local/nfs-client-provisioner   Delete          Immediate           true                   9s
standard (default)   k8s.io/minikube-hostpath               Delete          Immediate           false                  69m

Manually created the PVC

cat <<EOF | kubectl apply -f -
> kind: PersistentVolumeClaim
> apiVersion: v1
> metadata:
>   name: test-claim
>   annotations:
>     volume.beta.kubernetes.io/storage-class: "nfs-client"
> spec:
>   accessModes:
>     - ReadWriteMany
>   resources:
>     requests:
>       storage: 1Mi
> EOF
persistentvolumeclaim/test-claim created

# verify the PVC
kubectl get pvc
NAME         STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   AGE
test-claim   Pending                                      nfs-client     6s

# Describe the PVC
kubectl describe pvc test-claim
Name:          test-claim
Namespace:     default
StorageClass:  nfs-client
Status:        Pending
Volume:        
Labels:        <none>
Annotations:   kubectl.kubernetes.io/last-applied-configuration:
                 {"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"annotations":{"volume.beta.kubernetes.io/storage-class":"nfs-client"},"name...
               volume.beta.kubernetes.io/storage-class: nfs-client
               volume.beta.kubernetes.io/storage-provisioner: cluster.local/nfs-client-provisioner
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Filesystem
Mounted By:    <none>
Events:
  Type    Reason                Age                From                         Message
  ----    ------                ----               ----                         -------
  Normal  ExternalProvisioning  14s (x7 over 82s)  persistentvolume-controller  waiting for a volume to be created, either by external provisioner "cluster.local/nfs-client-provisioner" or manually created by system administrator

I reached exactly the same status as I did with the helm chart itself. I guess the permissions on the nfs share I have don't allow clients to create folders, but didn't want to expend much time messing with NFS.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have tested this on arm, or have added code to prevent deployment

@kadern0 kadern0 changed the title Added nfs-client-provisioner app WIP: Added nfs-client-provisioner app Jun 17, 2020
Copy link
Contributor

@Waterdrips Waterdrips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could of small changes requested. Otherwise looks good. Ill try and give this a test too

cmd/apps/nfs_app.go Outdated Show resolved Hide resolved
cmd/apps/nfs_app.go Outdated Show resolved Hide resolved
@alexellis
Copy link
Owner

@kadern0 FYI you'll need a rebase now as I've just merged #126

@alexellis
Copy link
Owner

One more thing re the commit messages:

Signed-off-by: kadern0 kaderno@gmail.com

Please do git commit user.name "Your Full Name" so that the sign-off is with a real-name rather than a pseudonym.

Signed-off-by: Pablo Caderno <kaderno@gmail.com>
@kadern0 kadern0 changed the title WIP: Added nfs-client-provisioner app Added nfs-client-provisioner app Jun 18, 2020
Copy link
Contributor

@Waterdrips Waterdrips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this can go in provided this has been tested (If so, please update the PR body)

Im actually playing with a new setup and will find this useful so thanks :)

@kadern0
Copy link
Contributor Author

kadern0 commented Jun 18, 2020

I haven't tested it on ARM, but on x86 I was getting same result as installing the helm chart manually. ARM testing plus a test with a proper NFS share could be useful (although both should work).

@alexellis
Copy link
Owner

Thanks for working through the feedback.

For future reference, please work on your commit message - it should have a body almost all of the time.

https://github.com/openfaas/faas/blob/master/CONTRIBUTING.md#commit-messages

@alexellis alexellis merged commit 877b5e2 into alexellis:master Jun 19, 2020
@alexellis
Copy link
Owner

Merged 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[App] NFS provisioner
3 participants