We have a kubernetes cluster with one linux master node and two windows worker nodes. To make this work we are using flannel. The nfs is running on the linux master node (but not inside kubernetes). Kubernetes version is v.1.25.5. When creating a pod with the nfs mounted into the pod, the pods does not start. The kubectl describe pod <pod-id>
tells that the following events happened:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedMount 5m8s (x108 over 5h13m) kubelet Unable to attach or mount volumes: unmounted volumes=[nfs-volume], unattached volumes=[nfs-volume kube-api-access-vrmw7]: timed out waiting for the condition
Warning FailedMount 9s (x163 over 5h15m) kubelet MountVolume.SetUp failed for volume "nfs-volume" : mount options("") should have at least 2 options, current number:0, source:"<master node ip>:/mnt/data", target:"c:\\var\\lib\\kubelet\\pods\\a65dcb6f-5497-4f0b-98c7-85ef3381df27\\volumes\\kubernetes.io~nfs\\nfs-volume"
This happens for both linux containers and windows containers. The manifests for the deployments look roughly like this (I roughly followed this tutorial):
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: fedora-mount-test
name: fedora-mount-test
namespace: fedora-mount-test
spec:
selector:
matchLabels:
app: fedora-mount-test
template:
metadata:
labels:
app: fedora-mount-test
name: fedora-mount-test
spec:
containers:
- image: registry.fedoraproject.org/fedora:35
name: fedora
command: ["/bin/bash", "-c", "--"]
args: ["while true; do sleep 30; done;"]
volumeMounts:
- name: nfs-vol
mountPath: /opt/nfs
volumes:
- name: nfs-vol
nfs:
server: <master node ip>
path: /mnt/data
What I tried so far:
- googling the error and variations of it - but I did not find anything which looked related, except the code that throws this error
- Comparing the manifest to working example manifests - but no difference and especially no additional arguments/options were found
- look into mount options, but again I could not find anything that appeared related