What I Have:
A Kubernetes Deployment on a Cluster with Googles Container Optimized OS as Node OS
Further the deployment.yaml
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: my-app
spec:
replicas: 1
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-app
image: eu.gcr.io/my-project/my-app
ports:
- containerPort: 8013
volumeMounts:
- mountPath: /my/cache/
name: cache
volumes:
- name: cache
nfs:
server: cache
path: /cache/my-app/
readOnly: false
The problem is that the nfs-mount works when I explicitly enter the IP-Address but for whatever reason it is not possible to resolve the hostname.
volumes:
- name: cache
nfs:
server: 192.168.1.1 # this example would work
path: /cache/my-app/
readOnly: false
However with the hostname entered mount.nfs exits with
Mount failed: exit status 32 ... Output: mount.nfs: Failed to resolve server cache
However I am able to ping the server by hostname from the Node. It also works when I use a normal Container-VM indicating it might be a problem with Googles Container Optimized OS...
How can I tell Kubernetes to resolve the server of the nfs-mount by hostname?