2021年3月3日星期三

hostpath on kubernetes running on Docker-desktop vm

I am running kubernetes on Docker-desktop for windows. I am connecting to the cluster from my WSL. all my pods are running correctly. I am trying to mount a volume on my jupyterlab (pod) using hostpath. below is my config

apiVersion: apps/v1  kind: Deployment  metadata:    name: jupyter    labels:      app: jupyter  spec:    replicas: 1    selector:      matchLabels:        app: jupyter    template:      metadata:        labels:          app: jupyter      spec:        containers:        - name: jupyter          image: jupyter:1.1          ports:          - containerPort: 8888          securityContext:            runAsNonRoot: true            runAsUser: 1000          volumeMounts:            - name: mydir              mountPath: /notebooks        volumes:          - name: mydir            hostPath:              # directory location on host              path: /home/<myuser>/data              # this field is optional              type: DirectoryOrCreate  

The pod starts without any issues. but i dont see the notbooks which i have kept in my hostpath onto my jupyter labs and vice versa( if i save a notebook in jupyter lab it does not get saved to my hostpath).

i followed the tutorial on https://kubernetes.io/docs/concepts/storage/volumes/#hostpath

https://stackoverflow.com/questions/66467131/hostpath-on-kubernetes-running-on-docker-desktop-vm March 04, 2021 at 09:04AM

没有评论:

发表评论