nfs-subdir-external-provisioner
nfs-subdir-external-provisioner copied to clipboard
NFS mount within K8s pods failing
I am trying to get NFS share mounted into a k8s pod but its failing with the below error
mount.nfs: rpc.statd is not running but is required for remote locking. mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
My deployment yaml is as below
kind: Deployment
apiVersion: apps/v1
metadata:
name: nfs-client-provisioner
spec:
selector:
matchLabels:
app: nfs-client-provisioner
replicas: 1
strategy:
type: Recreate
template:
metadata:
labels:
app: nfs-client-provisioner
spec:
serviceAccountName: nfs-client-provisioner
containers:
- name: nfs-client-provisioner
image: gcr.io/k8s-staging-sig-storage/nfs-subdir-external-provisioner:v4.0.0
securityContext:
allowPrivilegeEscalation: true
privileged: true
volumeMounts:
- name: nfs-client-root
mountPath: /persistentvolumes
env:
- name: PROVISIONER_NAME
value: nfs-provisioner
- name: NFS_SERVER
value: NFS SERVER PATH
- name: NFS_PATH
value: /filesharepath
volumes:
- name: nfs-client-root
nfs:
server: <NFS IP>
path: /filesharepath
I get this error message in the k8s pods for the provisioner
MountVolume.SetUp failed for volume "nfs-client-root" : mount failed: exit status 32 Mounting command: mount Mounting arguments: -t nfs <serverIP>:
I tried mounting the NFS folder directly into my VM and it works fine. Only the k8s pods are not unable to mount.
Please assist.
You need to install the nfs client on your k8s nodes. On ubuntu/debian that is done by apt install nfs-common
You need to install the nfs client on your k8s nodes. On ubuntu/debian that is done by
apt install nfs-common
thanks, I have solved this problem. but why need node install nfs-common ?
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
You need to install the nfs client on your k8s nodes. On ubuntu/debian that is done by
apt install nfs-commonthanks, I have solved this problem. but why need node install nfs-common ?
Kubelet needs to mount the nfs in to the container. In order to do that he must have nfs client installed. The nfs-common package contain the tool mount.nfs that used as a client to mount nfs directories.
I am closing the issue as it is solved.
/close
@yonatankahana: Closing this issue.
In response to this:
You need to install the nfs client on your k8s nodes. On ubuntu/debian that is done by
apt install nfs-commonthanks, I have solved this problem. but why need node install nfs-common ?
Kubelet needs to mount the nfs in to the container. In order to do that he must have nfs client installed. The
nfs-commonpackage contain the toolmount.nfsthat used as a client to mount nfs directories.I am closing the issue as it is solved.
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.