Every pod has unique IP address. And this IP address is reachable from all other pods in the cluster.
One challenge in distributed services architecture is , how to allocate ports without getting conflicts
When a pod is created on a node, it gets its own virtual namespace and an ethernet connection to connect to the underlaying network.
Pod can be considered as host just like in a network. Pod is having IP addresses and a range of ports to allocate to its containers.
This helps to manage he containers ip and ports within the container itself.
There may be one or maximum upto six containers in a pod. But only 1 main container.
The pod architecture allows to have 10 micro services running in port 8080 inside 10 different pods without any port conflict. Because they all run on self contained isolated machines
The pod architecture also allows to change the container runtime without really changing the kubernetes configurations. Because runtime is really within the pods.
The side car container
Containers can communicate each other within a pod using localhost.
When pod dies, it get recreated and get a new IP address. To mitigate this, Service is introduced. Service will have a permanent IP address .Life cycle of pod and service is not connected.
Service is a static or dynamic IP address that can be attached to a pod
External service is the one which allows access from outside application It opens communication from external sources.
Internal service is the one which does not allow external communication
The type of service is specified at the time of creation.
ConfigMap contains external configurations of application. Pods can read the config map properties
Secrets are similar to ConfigMap but the difference is that it is used to store secret data. IT is stored in B64 encoded format.
The secret mechanism is not enabled by default.
The contents of config map is accessed via properties file or environment variables
No comments:
Post a Comment