Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sharing hostpath #163

Open
schollii opened this issue Jan 3, 2021 · 3 comments
Open

sharing hostpath #163

schollii opened this issue Jan 3, 2021 · 3 comments

Comments

@schollii
Copy link

schollii commented Jan 3, 2021

IINM, sharing the PV as done in shared-volume will only work if the pods are run on the same node. If the pods are on different nodes, you will find the passwd file missing when you go to second pod.

One way to ensure this would be to set nodeName property in second pod, to have same value as first pod (determined by scheduler). This overrides the scheduler and will always work even if the reader is running this in a cluster with multiple worker nodes.

@schollii
Copy link
Author

schollii commented Jan 3, 2021

Just noticed your note about this when you expand the solution:

If you need to access the same files in a multi-node cluster, you need a volume type that is independent of a specific node.

It might be worth mentioning that an extra method is using the nodeName property.

Other approach could be to use a nodeSelector property on both pods instead, and label one of the nodes accordingly.

It may also be possible with node affinity, although this does not constrain just "hint".

@dgkanatsios
Copy link
Owner

thanks, would you like to create a PR with the proposed changes?

@schollii
Copy link
Author

Sure I'll try to

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants