OpenShift Blue-Green Deployment

Kopei article

OpenShift的蓝绿部署

使用oc patch route切换路由

1
2
3
4
5
6
oc new-project bluegreen --display-name="Blue Green Deployments"  --description="Blue Green Deployments"
oc new-app https://github.com/devops-with-openshift/bluegreen#master --name=blue
oc expose service blue --name=bluegreen #注意route的名称
oc new-app https://github.com/devops-with-openshift/bluegreen#green --name=green
##切换
oc patch route/bluegreen -p '{"spec": {"to":{"name":"green"}}}'

蓝绿最佳适用场景

无状态的服务实现蓝绿部署较为轻松, 因为不需要考虑旧实例的长事务和数据的迁移和回滚。

  • Title: OpenShift Blue-Green Deployment
  • Author: Kopei
  • Created at : 2018-01-09 00:00:00
  • Updated at : 2025-08-13 18:15:58
  • Link: https://kopei.github.io/2018/01/08/openshift-2018-01-09-openshift-bg-deployment/
  • License: This work is licensed under CC BY-NC-SA 4.0.
Comments
On this page
OpenShift Blue-Green Deployment