- We know that containers in Openshift or Kubernetes don’t persist data. Every time we start an application, it is started in a new container with an immutable Docker image.
Hence, any persisted data in the file systems is lost when the container stops. Hence if an application or container is rebuilt or restarted than we can’t view previous logs or if we are using containers with mysql or any other database then schema, tables, and all data will be lost, if using any messaging broker than if there is journal file than it will also not persist.
Hence, these ephemeral containers cannot be used in production environment. In a production environment, we must configure a shared storage.
- But what about the development environment, because we might not always have enough labs and VM’s available. To rescue we have volume type hostPath, which can be easily set up with Minishift and Minikube.
- This article will provide details how to setup hostPath volume type.
Continue reading “How to configure persistent storage with OpenShift or Kubernetes for development environment”