Açıklaması şöyle. İki farklı deployment yan yana çalışır. Yükün belli bir yüzdesi yeni sisteme verilir
Canary deployment strategy is used to carry out A/B testing and dark launches. It is similar to the blue-green approach but more controlled. We will see slow-moving traffic from version A to version B in this strategy. Think: canary in the coal mine!
Yüzde ile ilgili açıklam şöyle.
Finally, in a Canary deployment, a new application replica is added to the load balancer, and the load balancer is configured to pass only a specific percentage of the application traffic to the new replica. Once configured, a full analysis of the traffic volume, response times, or activity on the replica is performed. If the analysis is successful, this deployment generally continues as a Rolling deployment.
Örnek
Şöyle yaparız. Tek path var.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: sample-api-ing
namespace: default
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
rules:
- host: sample-api.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: sample-api-svc
port:
number: 8080apiVersion: v1
kind: Service
metadata:
name: sample-api-svc
namespace: default
labels:
app: sample-api
spec:
type: ClusterIP <----
selector:
app: sample-api
ports:
- port: 8080
name: "http"
protocol: TCPapiVersion: apps/v1
kind: Deployment
metadata:
name: sample-api-app <----
namespace: default
spec:
replicas: 4 <----
selector:
matchLabels:
app: sample-api
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 20%
template:
metadata:
labels:
version: "netcore6" <----
app: sample-api
spec:
containers:
- name: sample-api
image: localhost:5000/sample-api-netcore
imagePullPolicy: Always
ports:
- containerPort: 8080
env:
- name: ASPNETCORE_URLS
value: http://*:8080apiVersion: apps/v1
kind: Deployment
metadata:
name: sample-api-canary-app <----
namespace: default
spec:
replicas: 1 <----
selector:
matchLabels:
app: sample-api
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 20%
template:
metadata:
labels:
version: "golang" <----
app: sample-api
spec:
containers:
- name: sample-api
image: localhost:5000/sample-api-golang
imagePullPolicy: Always
ports:
- containerPort: 8080
Hiç yorum yok:
Yorum Gönder