2017-08-31 520 views
0

我正在測試在AWS上運行的k8s(1.7.4)上的藍綠色更新,其中可以從k8s外部訪問藍綠色服務。當前的設置是藍色的吊艙,綠色的吊艙和服務路由器。路由器設置是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 

回答

1

在更新K8S LoadBalancer類型服務期間,底層的ELB不應該改變。您確定您確實更新了服務(kubectl apply)而不是重新創建(kubectl delete/kubectl create)?

相關問題