top of page

K8s Design Pattern Series: Behavioral Patterns - Blog #4

Updated: Apr 12





Introduction


The management platform assures the Pods' lifecycle in these ways. A Pod may be run indefinitely as a batch job or at regular intervals, both of which depend on the workload. This component might function as a daemon or a singleton. When running a Pod, getting the necessary assurances depends on using the correct life-cycle management primitive.


  1. Batch job patterns

  2. Stateful Service patterns

  3. Service Discovery patterns

  4. Periodic job

  5. Daemon Service

  6. Self Awareness


Batch Job Patterns


Batch job patterns define the atomic unit of work.. This pattern works well in a distributed setting when small, independent tasks need to be coordinated.




Stateful Service Patterns


Stateful Service explains how to use Kubernetes to make and manage distributed stateful applications. For these kinds of apps to work, they need features like persistent identity, networking, storage, and knowing the order of things. The StatefulSet primitive gives these building blocks strong guarantees that are perfect for managing applications that keep track of state.




Service Discovery Pattern


Service Discovery tells clients how to find and connect to the instances that provide application services. Kubernetes has a number of ways to do this, depending on whether the service consumers and service providers are on or off the cluster.




Periodic Job Pattern


Periodic job pattern is used to run a piece of work when an event or a certain time comes up. The cronjob primitive is used to set up jobs that run at regular intervals. You can think of a cronjob as one line in a unix crontab. Kubernetes cronjob is different from Unix cron in that it is highly available and can run based on both time and events. This method is useful when an application needs to do something specific, like send a file or check on another service.


Daemon Service Pattern


Daemons are processes that run programmes automatically and in the background. Running a daemonset on each node to collect cluster logs is an example of how a daemonset may be used to gain insight into a Kubernetes cluster or application, both of which are dispersed by their very nature.


Self Awareness Pattern


Kubernetes apps can use the self-awareness notion, which is implemented as a downward API, to learn more about themselves. It makes it easy to insert metadata and perform introspection on Kubernetes apps. The pod's environment variables (such POD IP) and files can be used by the containers and the cluster to access the pod's metadata.


When you consider that Kubernetes is inherently dispersed, the capacity of an application to be aware of its own surroundings becomes extremely potent.








Continuous Blog Series :

Blog #1 : Kubernetes Design Pattern Series - An Overview

Blog #2 : K8s Design Pattern Series - Fundamental Pattern

Blog #3 : K8s Design Pattern Series - Structural Pattern

Blog #4: K8s Design Pattern Series: Behavioral Patterns

Blog #5: K8s Design Pattern Series: Higher Level Patterns

Blog #6: K8s Design Pattern Series: Summary

Blog #7: K8s Anti-Design Pattern Series

Blog #8: K8s Anti-Design Pattern Series - Putting the Configuration into the Images of the Containers

Blog #9: K8s Anti-Design Pattern Series - Connecting Applications to Kubernetes Features/Services without Justification

Blog #10: K8s Anti-Design Pattern Series - Mixing Infrastructure and Application Deployment

Blog #11: K8s Anti-Design Pattern Series - Deploying without Memory and CPU Limits

Blog #12: K8s Anti-Design Pattern Series - Understanding Health Probes In Kubernetes

Blog #13: K8s Anti-Design Pattern Series - The Pitfall of ignoring Helm in Kubernetes Package Management

Blog #14: K8s Anti-Design Pattern Series - Why Deployment Metrics matter in Kubernetes

Blog #15: K8s Anti-Design Pattern Series - To Kubernetes or not to Kubernetes weighing Pros and Cons

Blog #16:K8s Anti-Design Pattern Series - Connecting Applications to Kubernetes Features/Services

Blog #17: K8s Anti-Design Pattern Series - Manual Kubectl Edit/Patch Deployments

Blog #18: K8s Anti-Design Pattern Series - Kubernetes Deployments with Latest-Tagged Containers

Blog #19: K8s Anti-Design Pattern Series - Kubectl Debugging

Blog #20: K8s Anti-Design Pattern Series - Misunderstanding Kubernetes Network Concepts

Blog #21: K8s Anti-Design Pattern Series - Dynamic Environments in Kubernetes why Fixed Staging is an Anti-Design

Blog #22: K8s Anti-Design Pattern Series - Combining Clusters of Production and Non-Production

9 views0 comments

Recent Posts

See All
bottom of page