top of page

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

Updated: Apr 12





Summary


A software team usually has numerous predefined test environments for virtual machines and bare metal servers to test an application before it goes into production. At least three environments (QA/staging/production) are usual, but larger companies may have more. The "integration environment" setting collects all developer features after they are merged to the mainline branch. Feature isolation is the most important factor in the integration environment.




Single Integration Layer

When numerous developers merge features and something breaks, a single integration environment makes it difficult to identify the offending feature(s). If three devs merge their features on a staging environment and the deployment fails (build, integration tests, metrics explode), there are several scenarios pop up and it’s hard for the team to manage it efficiently.



Booking Paradigm


Companies usually use the "booking Paradigm" to fix this:

Each developer "books" the staging environment to try their feature alone.

Developers try features in the company's "staging" environments (as a single environment can quickly become a bottleneck).


Dynamic Staging


Developers must coordinate on environments and track their cleaning actions, making this scenario difficult. If multiple developers need a database changeset with their feature, they must ensure that each staging environment's database includes only their changes and not the previous developer's. Multiple permanent staging environments can also rapidly experience configuration drift, where environments are supposed to be the same but are not after several ad hoc changes.





Of course, dynamic environments that are created and destroyed on demand are the answer. Kubernetes simplifies this:

There are many approaches to this problem, but one minimum requirement is that each Open Pull Request generates its own unique, sandboxed environment. When a pull request is merged or closed, or after a certain period of time has passed, the environment is destroyed immediately.If you continue to use permanent environments for feature testing, you are making life difficult for your developers and wasting system resources when your environments are not in use.








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



8 views0 comments

Recent Posts

See All
bottom of page