Kubernetes Application Management — Upgrade (2)

Background

Blue-Green Release

Configuration Method

[...]
kind: Service
spec:
# The selector of the Service will choose the pod that has the matching app label and version label
selector:
app: spring-boot-probes
# Implement traffic switch by changing the version value. For example, change v2.0.0 to
version: v1.0.0
[...]
kind: Deployment
metadata:
name: spring-boot-probes-v1
spec:
selector:
matchLabels:
app: spring-boot-probes
version: v1.0.0
template:
metadata:
labels:
app: spring-boot-probes
# The version label of the Pod
version: v1.0.0
[...]
kind: Deployment
metadata:
name: spring-boot-probes-v2
spec:
selector:
matchLabels:
app: spring-boot-probes
version: v2.0.0
template:
metadata:
labels:
app: spring-boot-probes
# The version label of the Pod
version: v2.0.0
[...]

Procedure

Canary Release

Configuration Method

[...]
kind: VirtualService
metadata:
name: spring-boot-probes
spec:
hosts:
- spring-boot-probes.local
gateways:
- spring-boot-probes
http:
- route:
- destination:
host: spring-boot-probes-svc-v1
weight: 90
- destination:
host: spring-boot-probes-svc-v2
weight: 10
[...]
kind: Service
metadata:
name: spring-boot-probes-svc-v1
spec:
selector:
app: spring-boot-probes
version: v1.0.0
[...]
kind: Service
metadata:
name: spring-boot-probes-svc-v2
spec:
selector:
app: spring-boot-probes
version: v2.0.0
[...]

Procedure

A/B Testing

Configuration Method

[...]
kind: VirtualService
metadata:
name: spring-boot-probes
spec:
hosts:
- spring-boot-probes.local
gateways:
- spring-boot-probes
http:
- route:
- destination:
host: spring-boot-probes-svc-v1
match:
- headers:
user-agent:
exact: Andriod
- route:
- destination:
host: spring-boot-probes-svc-v2
match:
- headers:
user-agent:
exact: iPhone
[...]
kind: Service
metadata:
name: spring-boot-probes-svc-v1
spec:
selector:
app: spring-boot-probes
version: v1.0.0
[...]
kind: Service
metadata:
name: spring-boot-probes-svc-v2
spec:
selector:
app: spring-boot-probes
version: v2.0.0
[...]

Procedure

Summary

References

Original Source

--

--

--

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

How to Protect Your Business with Disaster Recovery as a Service

Keen + Sendgrid: Guide to Long-Term Email Data Storage and Email Marketing Dashboards

wk 1 — Sensory Environments & Design Frameworks

Overview of Ansible | Configuration Management with AnsibleOverview of Ansible

ApsaraDB RDS for PostgreSQL 12: Improved High Concurrency Performance for Large Partitioned Tables

Call for Open Source Contributors: Document History and Hold Companies Accountable with…

Zowe Explorer: Tips & Tricks

Apache Spark Quick Start Guide

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com

More from Medium

LEARN TO DEPLOY POSTGRES HA ON KUBERNETES IN 60 MINUTES

Problem DataBase PostgreSQL Hight Availability Postgres HA Issues

Install and configure Elastic Stack — II

Kubernetes: Ordered cleanup with OwnerReference