I’ve been playing around with Kubernetes for a few days now and I don’t know if I missed this part somewhere along the way but I really need to understand this.
I hope someone with a better understanding could spare a few minutes to explain. Here we go!
I understand that pods are copies of your containerized app and all network traffic will be balanced throughout all the available pods. I also see that I can shell into each pod and do whatever I want inside the pod.
So does it mean that each pod is copy / paste of all the files in the image and are built using all the process described in YAML files and if app total size would be 1gb than each pod size would be 1gb? Also, if you access the shell of a particular pod and make some changes inside then those changes will be active only on that pod as long as it will stay alive?
Let’s say I have 2 pods (pod A and pod B). I go to the website and I get assigned to pod A, pod B is unused. The website itself is a SPA (Single Page Application), meaning that I don’t need to reload the page to keep using it as I only load data through API endpoints.
Since pod B is unused, I understand that it would update without a problem and new visitors would be assigned to this pod.
But what would happen with pod A? Would I still see the old version without changes until I refresh the website and only then would the pod A be updated or replaced with new pod? Or rather pod A would be updated at the same time as pod B and the website would basically crash for me unless I have some sort of code-change detection inside my website that would reload the page?