Skip to content

Instantly share code, notes, and snippets.

@matthewpalmer
Created October 22, 2018 00:56
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save matthewpalmer/0f213028473546b14fd75b7ebf801115 to your computer and use it in GitHub Desktop.
Save matthewpalmer/0f213028473546b14fd75b7ebf801115 to your computer and use it in GitHub Desktop.
Example for NFS server in Kubernetes
# Note - an NFS server isn't really a Kubernetes
# concept. We're just creating it in Kubernetes
# for illustration and convenience. In practice,
# it might be run in some other system.
# Create a service to expose the NFS server
# to pods inside the cluster.
kind: Service
apiVersion: v1
metadata:
name: nfs-service
spec:
selector:
role: nfs
ports:
# Open the ports required by the NFS server
# Port 2049 for TCP
- name: tcp-2049
port: 2049
protocol: TCP
# Port 111 for UDP
- name: udp-111
port: 111
protocol: UDP
---
# Run the NFS server image in a pod that is
# exposed by the service.
kind: Pod
apiVersion: v1
metadata:
name: nfs-server-pod
labels:
role: nfs
spec:
containers:
- name: nfs-server-container
image: cpuguy83/nfs-server
securityContext:
privileged: true
args:
# Pass the paths to share to the Docker image
- /exports
@Benkler
Copy link

Benkler commented Jun 6, 2020

Could you please specify what you have done exactly? I run into the same problem and I am not able to solve it.

@larsonreever
Copy link

I came across this article while looking more into this issues but iam confused as of now https://redblink.com/setup-nfs-server-provisioner-kubernetes/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment