yasin lachini
yasin lachini

Reputation: 5976

How to use HostPath in kubernetes baremetal?

For persistant volume in kubernetes i can use HostPath . But my problem is if one of my pods is restarted and created in other node.

How can i handle this? I am in baremetal envinroment.

should i use NFS?

Upvotes: 0

Views: 59

Answers (2)

Nick_Kh
Nick_Kh

Reputation: 5243

As @P Ekambaram has already commented in the last comment below his answer, you might consider to use nodeSelector within your Pods by specifying the corresponded label to achieve scheduling Pods on specific Nodes, or via more comprehesive method by adapting nodeAffinity which conceptually brings the same approach but with more flexible options: like requiredDuringSchedulingIgnoredDuringExecution and preferredDuringSchedulingIgnoredDuringExecution. You can find out more relative information in the official Kubernetes documentation.

Upvotes: 1

P Ekambaram
P Ekambaram

Reputation: 17625

Yes, use nfs shares for your baremetal cluster.

Upvotes: 0

Related Questions