蓝绿色对策略的改变



我是在AWS上运行的K8S(1.7.4)上的蓝色绿色更新,该更新可从k8室外到达蓝色绿色服务。当前设置是蓝色吊舱,绿色吊舱和服务路由器。路由器设置是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

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

最新更新