Question-106: How does data affected when you delete a Pod?
Answer: When you delete a Pod, it would delete any data which is stored in the containers as well. So, if you want to persist data across multiple instances of a Pod, you have to use PersistentVolumes.
Question-107: What below command do?
“kubectl pot-forward hePod 8080:8080”
Answer: Above command create a secure tunnel from your local machine, through Kubernetes master, to the instance of the Pod running on one of the Worker Nodes. And you can access your Pod using web interface http://localhost:8080 . However, you can access until above command is running.
Question-108: How can you get the logs from previously running container?
Answer: When you use “logs” command it would download the logs from container and show you. If you use -f flag the it will continuously stream the logs. And if you use the --previous flag, it would give you the logs from a previous container.
Question-109: Why you should avoid copying file into a container?
Answer: In Kubernetes world we always want that containers are immutable. But in some cases you may want to copy some configuration file then you can use “cp” option to copy the file in container. But this is not a good practice and should be avoided.
Question-110: How Kubernetes make sure your process is running in Kubernetes?
Answer: When we run your application as a container in Kubernetes and that would be kept alive using a process called “health check” . And this “health check” process make sure that the main process of your application is always running. And if it is found as part of health check that this process is not running then Kubernetes would restart it.