Behavioural design patterns focus on the communication and interaction between objects and in Kubernetes land this means communication mechanisms and interactions between the Pods and the managing platform.
Depending on the type of managing controller, a Pod may run until completion, or be scheduled to run periodically. It can run as a Daemon Service or provide uniqueness guarantees to its replicas.
Communication and interaction within the controller system could include the distribution of pods to nodes, the scheduling of pods, or metadata distribution by the Kubernetes master and node components.
The are many standard patterns that can address desired behaviour including;
- Job – Kubernetes jobs represent an isolated work run until completion and are ideal for use cases that are required to only run once
- Scheduled Job – Kubernetes provides the CronJob resource for creating scheduled tasks, and it ensures that these jobs are running
- Daemon Service – designed for deploying ongoing background tasks that need to run on all or certain nodes such as metrics collection
- Singleton Service – ensures only one instance of a service is active at a time and still highly available
- Stateful Service – how to create and manage distributed stateful applications
- Service Discovery– explains how clients can access and discover the instances providing application services
- Self Awareness – mechanisms for using and injecting metadata
0

