DEV Community

Cover image for Kubernetes Patterns : The Stateful Service Pattern
Ahmed Atef
Ahmed Atef

Posted on • Originally published at

Kubernetes Patterns : The Stateful Service Pattern

Stable Network Identity.
If you have a pet, you must give it a name so that you can call it. Similarly, a stateful application node must have a well-defined hostname and IP address so that other nodes in the same application knows how to reach it. A ReplicaSet does not offer this functionality as each Pod receives a random hostname and IP address when it starts or is restarted. In stateless applications, we use a Service that load-balances the Pods behind it and offers a URL through which you can reach any of the stateless Pods. In a stateful app, each node may want to connect to a specific node. A ReplicaSet cannot serve this purpose.
Learn more about Kubernetes Stateful Service Patterns:

Top comments (0)