Shadow Deployment Strategy
Shadow Deployment in Kubernetes tests new versions or changes to an application in a production-like environment without impacting the existing production workload. It involves running parallel deployment of the new version alongside existing production deployment, allowing users to observe and compare behavior and performance of new version without affecting users or disrupting service.
- The following YAML can be used to implement this kind of deployment:
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app-shadow
spec:
replicas: 3
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-app-container
image: my-image:latest
---
apiVersion: v1
kind: Service
metadata:
name: my-app-shadow-service
spec:
ports:
- port: 80
targetPort: 8080
selector:
app: my-app
Use Case For Shadow Deployment: Sometimes, we want to validate the behavior and performance of a new version in a real-world scenario before fully deploying it. Hence, Shadow deployment is useful for such cases. It can easily identify differences between the new and existing versions before they impact users.
What Are The Kubernetes Deployment Stratagies ?
Traditionally, applications used to be deployed on the Physical Servers. However, it was not very efficient as multiple instances of the applications running on the server used to consume a lot of resources. Although Virtual Machines running on the Servers tried to solve the issue, resource allocation and slow boot times were still problems. Due to this, Containerization Technologies like Kubernetes came into the picture.
In this article, we will learn in detail about the deployment strategies in Kubernetes that will help us to understand why it is one of the most popular choices among Software Experts. So, let us start without any delay.