I'm trying to mount a windows local directory to a docker container in the Kubernetes pod but have encountered errors when specifying the mounting path. I'm a newbie to Kubernetes and not sure if I'm following the correct way to mount a Windows directory.
my .yaml
file looks something like this,
apiVersion: v1
kind: Pod
metadata:
name: two-containers-local
labels:
name: app
spec:
containers:
- image: nginx
name: nginx-container
volumeMounts:
- mountPath: /usr/share/nginx/html
name: test-volume
ports:
- containerPort: 8080
volumes:
- name: test-volume
hostPath:
path: 'C:\test'
type: Directory
---
apiVersion: v1
kind: Service
metadata:
name: my-two-container-nginx-local
spec:
type: NodePort
ports:
- port: 8080
targetPort: 8080
nodePort: 30002
protocol: TCP
selector:
name: app
MountVolume.SetUp failed for volume "test-volume" : hostPath type check failed: C:\test is not a directory