Hi Sergei,
thanks a lot for your response!
Your first point:
To my wording:
“Services point to pods. Services do not point to deployments or replicasets.”
You said: “This is a potentially dangerous simplification.”
With this I try to ensure people use the label-selector of services correctly, because many mix those up with labels of deployments. I gave it a second thought but came to the conclusion nothing is wrong with saying “Services point to pods”. It’s true, they do, via labels.
If there is one or even are multiple bridges between Services and Pods (like Endpoints) it doesn’t matter for the purpose of simplification. I didn’t even want to mention Endpoints at all in this article to stay simple.
Your second point:
The words “I would like you to imagine” hint at the fact that this is NOT how things work, but I thing the post needs to be more explicit and directly state that this is NOT how things work in reality
I actually reflected quite a bit on this, because you have a valid point here. I thought about changing my phrasings from “NodePort creates ClusterIP” to “NodePort extends ClusterIP” etc. But then from looking at the k8s source code, also that doesn’t describe this correctly, as you also explained.
Though even the the official k8s docs use my exact phrasings:
NodePort: Exposes the Service on each Node’s IP at a static port (the NodePort). A ClusterIP Service, to which the NodePort Service routes, is automatically created.
LoadBalancer: Exposes the Service externally using a cloud provider’s load balancer. NodePort and ClusterIP Services, to which the external load balancer routes, are automatically created.
I see your concern here but I think for the sake of understanding and being able to use and create the correct service, the way I (and the official docs) describe services are a good compromise.
If one is going to dive deeper into various Kubernetes resources (or even the source code) they’ll probably find out many of the vague descriptions learned at the beginning are actually more complex to describe.
It’s like you read everywhere “a Pod can contain one or multiple containers”. But in reality (if using Docker like most commonly) a Pod always contains at least two containers. But for the sake of understanding what a Pod is and how it works it’s ok to leave that information out.
Sometimes, the best way to keep things simple is by leaving parts out.
Thanks so much for you concerns to explain topics correctly to readers!
Kim