0

In Kubernetes, you can create a volume to mount into a with hostpath.

This hostPath should provide a directory on the node running the pod. It's useful when you are working in development environments using minikube, we use this hostPath to sync code (per example)

 ...
 volumes:
      - name: source
        hostPath:
          path: /Users/fermin/project/wopwop
 ...

That path could be different for each developer (path: /Users/<your-name)/project/wopwop).

My first approximation was a brute force method, replace with a shell script <WORK_DIR> by a ENV variable $WORK_DIR where its value could be like WORK_DIR=/Users/fermin/project.

Any ideas to do this in a better way? Thanks.

fermin
  • 103
  • 3
  • Have you looked into OpenShift? This kubernetes descendant provides much better separation between different users and projects. – Michael Hampton Jul 06 '20 at 21:16
  • Kubernetes fits with all the project, this is the only config pain in dev environments. Nowadays I don't consider other solutions. But I will study openshift for the future – fermin Jul 06 '20 at 21:44
  • take a look to skaffold – c4f4t0r Jul 06 '20 at 22:57
  • All developers are using a single minikube cluster or each dev has it's own minilube cluster? I'm asking because with minikube you can mount a local directory: `minikube start --mount-string="$HOME/go/src/github.com/nginx:/data"` – Mark Watney Jul 07 '20 at 08:14

0 Answers0