Kubernetes Volumes — INTRODUCTION

Figure - 1

Docker images are read-only…

Figure — 2

Why we need storage volumes in Kubernetes?

We know that containers in a pod get restarted ( either because the process died or Kubernetes find out that container wasn’t healthy any more) and new container will not see anything that was written to the filesystem by the previous container, even though newly started container runs in the same pod.

Storage Volumes

In the picture of container and pods we need a storage which is part of a pod and share the same lifecycle as the pod. And volume is exactly the thing we are looking for. Volume is created when the pod is started and is destroyed when the pod is deleted. Because of this, a volume’s contents will persist across container restarts. After the container is restarted, the new container can see all the files that were written to the volume by the previous container.

Figure — 3

Credits

  • Kubernetes in Action by Marko Luksa.
  • Learn Kubernetes in a month of lunches by Elton Stoneman.

Resources

  1. For more detail on other disk terminology

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store