简体   繁体   English

Google Cloud CDN和资产指纹与滚动部署

[英]Google cloud CDN and asset fingerprinting with rolling deployments

I have a kubernetes environment set up on GKE with 6 replicated pods and an ingress attached to a GCP load balancer with Google Cloud CDN enabled. 我在GKE上设置了一个kubernetes环境,其中包含6个复制的Pod,并在启用了Google Cloud CDN的情况下将入口连接到GCP负载均衡器。

How do rolling deployments work in regards to asset fingerprinting? 关于资产指纹识别,滚动部署如何工作? In the situation where a rolling deployment is in progress and a request for a new asset fingerprint is routed to a pod which doesn't yet have the new asset fingerprint? 在正在进行滚动部署并且将新资产指纹的请求路由到尚没有新资产指纹的Pod的情况下? How can this be mitigated? 如何缓解这种情况? or does Google Cloud CDN take care of this? 还是Google Cloud CDN会解决这个问题?

This article describes the situation I am thinking of: https://buildingvts.com/serving-assets-while-rolling-your-deploys-c656ce6a2123 本文介绍了我正在考虑的情况: https : //buildingvts.com/serving-assets-while-rolling-your-deploys-c656ce6a2123

Here the reply will be based on the shared link which is related to fingerprint hashing. 在这里,回复将基于与指纹哈希相关的共享链接 Please do clarify what you mean by asset fingerprinting and run-time (python, ruby, nodejs) which would help to answer the question better. 请说明资产指纹和运行时(python,ruby,nodejs)的含义,以帮助更好地回答该问题。

Based on the way this question is asked I suspect an anti-pattern with the way containers and Kubernetes is used. 基于这个问题的提出方式,我怀疑容器和Kubernetes的使用方式存在反模式。 As you have asked about assets and not paths to dynamic content I suspect that you are starting your pod and compiling all assets at start time. 当您询问资产而不是动态内容的路径时,我怀疑您是在启动Pod并在开始时编译所有资产。 Typically you would do all of this work at image creation time. 通常,您会在图像创建时完成所有这些工作。 So there should be no interruption in service as all of their assets are pre-generated before start time (as I assume the white screen on the shared link is meant to service interruption). 因此,服务不应中断,因为它们的所有资产都是在开始时间之前预先生成的(因为我假设共享链接上的白屏意味着服务中断)。

For the question at hand, Kubernetes does not do anything fancy that a normal load balancer doesn't do. 对于眼前的问题,Kubernetes并没有做任何普通负载均衡器无法做到的事情。 Kubernetes 5 tuple hash connections through the load balancer to the node and then the pod. Kubernetes 5元组哈希连接通过负载均衡器到达节点,再到Pod。 Once a connection is created from the web browser it will (probably) continue to be served by they pod until the connection is terminated. 通过网络浏览器创建连接后,(可能)他们将继续为他们服务,直到连接终止。

There is no mechanism in Google Cloud CDN to ensure there is no interruption. Google Cloud CDN中没有机制来确保不中断。 If there is no asset in the cache it will have to go to a pod and the pod may or may not have the asset in question. 如果缓存中没有资产,则它必须转到一个容器中,该容器可能有也可能没有资产。 If the asset is in the cache then it will serve it out without connecting to a pod. 如果资产在缓存中,则它将在不连接到吊舱的情况下将其用完。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM