Skip to content

Instantly share code, notes, and snippets.

@ryanhay
Last active August 27, 2024 06:02
Show Gist options
  • Save ryanhay/a5f0933bf24cdb1c6222ee9f5d9d8533 to your computer and use it in GitHub Desktop.
Save ryanhay/a5f0933bf24cdb1c6222ee9f5d9d8533 to your computer and use it in GitHub Desktop.
PVC and Pod for testing an NFS Auto Provisioner Storage Class
# Apply this file
# Get a bash prompt in the container with: kubectl exec -it pod/ubuntu-test-nfs -- /bin/bash
# Navigate to /nfs directory
# Create some files and confirm everything is as expected on the NFS Server
#
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: test-nfs-provisioner
namespace: default
spec:
storageClassName: managed-nfs-storage
accessModes:
- ReadWriteMany
resources:
requests:
storage: 10Mi
---
apiVersion: v1
kind: Pod
metadata:
labels:
run: ubuntu
name: ubuntu-test-nfs
namespace: default
spec:
containers:
- image: ubuntu
name: ubuntu
resources: {}
command: ["sleep", "3600"]
volumeMounts:
- mountPath: /nfs
name: nfs-vol
volumes:
- name: nfs-vol
persistentVolumeClaim:
claimName: test-nfs-provisioner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment