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"}}}'

蓝绿最佳适用场景

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

  • Post title:OpenShift Blue-Green Deployment
  • Post author:Kopei
  • Create time:2018-01-09 00:00:00
  • Post link:https://kopei.github.io/2018/01/08/openshift-2018-01-09-openshift-bg-deployment/
  • Copyright Notice:All articles in this blog are licensed under BY-NC-SA unless stating additionally.
 Comments
On this page
OpenShift Blue-Green Deployment