【问题标题】:Blue green change over strategies蓝绿改变策略
【发布时间】:2017-08-31 21:52:57
【问题描述】:

我正在 AWS 上运行的 k8s (1.7.4) 上测试蓝绿色更新,其中蓝绿色服务可从 k8s 外部访问。当前设置是一个蓝色 pod、一个绿色 pod 和一个服务路由器。路由器设置是 AWS ELB。该服务可通过指向 ELB 的 CNAME 访问。

问题出在切换期间。更新服务会产生新的 ELB,从而产生 CNAME 的新目标。等待 DNS 传播的时间是停机时间。避免停机的另一种方法是什么?服务yml如下:

##########
# ROUTER #
##########

# This blue green approach does not work because the AWS ELB must be created
# new on each changeoever. This results in a new DNS record and clients are
# lost while the new record propagates.

# Expose the container as a service to the outside via DNS record and port.
apiVersion: v1
kind: Service
metadata:
  name: helloworld
  annotations:
    # URL for the service
    external-dns.alpha.kubernetes.io/hostname: helloworld.k8s.example.net
spec:
  type: LoadBalancer
  ports:
    # Outside port mapped to deployed container port
  - port: 80
    targetPort: helloworldport
  selector:
    #  HOWTO change app name to point to blue or green then
    #  ubectl replace -f bluegreenrouter.yml --force
    app: helloworld-blue

【问题讨论】:

    标签: amazon-web-services kubernetes


    【解决方案1】:

    在更新 K8S LoadBalancer 类型的服务期间,底层 ELB 永远不会改变。你确定你确实更新了服务(kubectl apply)而不是重新创建(kubectl delete/kubectl create)?

    【讨论】:

      猜你喜欢
      • 2014-07-07
      • 1970-01-01
      • 1970-01-01
      • 2016-04-03
      • 2019-01-01
      • 2021-07-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多