https://github.com/kubernetes/kubernetes/pull/35652 broke mounting nfs volumes in pods:
apiVersion: v1
kind: Pod
metadata:
name: demo
spec:
containers:
- image: fedora:24
name: fedora
imagePullPolicy: Always
command:
- /usr/bin/sleep
- "3600"
volumeMounts:
- name: myvol
mountPath: /mnt
volumes:
- name: myvol
nfs:
path: /srv/share
server: localhost
terminationGracePeriodSeconds: 5
kubectl create -f nfspod.yaml
Stuck in ContainerCreating
kubectl describe pod demo
Events:
FirstSeen LastSeen Count From SubObjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
14s 14s 1 {default-scheduler } Normal Scheduled Successfully assigned demo to 127.0.0.1
14s 6s 5 {kubelet 127.0.0.1} Warning FailedMount MountVolume.SetUp failed for volume "kubernetes.io/nfs/3cc8bac7-9c77-11e6-ae11-fa163e815edd-myvol" (spec.Name: "myvol") pod "3cc8bac7-9c77-11e6-ae11-fa163e815edd" (UID: "3cc8bac7-9c77-11e6-ae11-fa163e815edd") with: mount failed: exit status 32
Mounting command: mount
Mounting arguments: /localhost:/srv/share /var/lib/kubelet/pods/3cc8bac7-9c77-11e6-ae11-fa163e815edd/volumes/kubernetes.io~nfs/myvol nfs []
Output: mount.nfs: Failed to resolve server /localhost: Name or service not known
Note the leading /
on the nfs server name.
@vishh @derekwaynecarr
https://github.com/kubernetes/kubernetes/pull/35349/commits/7fd03c4b6e132347cfa591abb263b92a53d004b1 should fix this. Sorry for the trouble.
@vishh ah yes, I had a PR with that fix ready to go but you beat me to it. Minus the whole else
case there since the if
before it ends in a return
. Thanks! I'll close when it merged
Hey there,
the NFS Mount still seams unable to resolve service host names (service.namespace) on GCE.
Is this issue fixed and merged or does it still take some time for it to be fixed on GCE?
MountVolume.SetUp failed for volume "kubernetes.io/nfs/***" (spec.Name: "***") pod "***" (UID: "***") with: mount failed: exit status 32 Mounting command: mount Mounting arguments: nfs-server:/exports/jenkins-master /var/lib/kubelet/pods/***/volumes/kubernetes.io~nfs/jenkins-master nfs [] Output: mount.nfs: Failed to resolve server nfs-server.storage: Name or service not known
The DNS seems to work properly as running containers are able to resolve the name. Also using the IP works as well but is no solution.
Most helpful comment
Hey there,
the NFS Mount still seams unable to resolve service host names (service.namespace) on GCE.
Is this issue fixed and merged or does it still take some time for it to be fixed on GCE?
The DNS seems to work properly as running containers are able to resolve the name. Also using the IP works as well but is no solution.