Skip to Content
Kubernetes Cookbook - Second Edition
book

Kubernetes Cookbook - Second Edition

by Hideto Saito, Hui-Chuan Chloe Lee, Ke-Jou Carol Hsu
May 2018
Intermediate to advanced
554 pages
13h 51m
English
Packt Publishing
Content preview from Kubernetes Cookbook - Second Edition

hostPath

hostPath acts as data volume in Docker. The local folder on a node listed in hostPath will be mounted into the Pod. Since the Pod can run on any nodes, read/write functions happening in the volume could explicitly exist in the node on which the Pod is running. In Kubernetes, however, the Pod should not be node-aware. Please note that the configuration and files might be different on different nodes when using hostPath. Therefore, the same Pod, created by the same command or configuration file, might act differently on different nodes.

By using hostPath, you're able to read and write the files between containers and localhost disks of nodes. What we need for volume definition is for hostPath.path to specify the target mounted folder ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Kubernetes Cookbook

Kubernetes Cookbook

Sébastien Goasguen, Michael Hausenblas
DevOps with Kubernetes - Second Edition

DevOps with Kubernetes - Second Edition

Hideto Saito, Hui-Chuan Chloe Lee, Cheng-Yang Wu

Publisher Resources

ISBN: 9781788837606Supplemental Content