[英]Kubernetes RC wait until pod is ready before scaling down
I have a ruby on rails app on kubernetes.我在 kubernetes 上有一个 ruby on rails 应用程序。
Here's what I do这就是我所做的
kubernetes rolling-update new_file
kubernetes 滚动更新
new_file
Kubernetes began to create new pods Kubernetes 开始创建新的 Pod
When the new pods are ready, Kubernetes kills the old pod.当新的 pod 准备好时,Kubernetes 会杀死旧的 pod。
However, although my new pod are in ready state, they are actually doing rails assets build/compressing.然而,尽管我的新 pod 处于就绪状态,但它们实际上是在进行 Rails 资产构建/压缩。 They aren't ready yet.
他们还没有准备好。 How can I let kubernetes know that it's not ready yet?
我如何让 kubernetes 知道它还没有准备好?
This sounds like a prime example for a readiness probe: It tells Kubernetes to not take a pod into load balancing until a certain condition holds, often an HTTP endpoint that returns positively.这听起来像是准备就绪探测的一个主要示例:它告诉 Kubernetes 在特定条件成立之前不要将 pod 纳入负载平衡,通常是一个 HTTP 端点返回积极。 Here's an example probe defined along a Deployment specification:
以下是根据部署规范定义的示例探针:
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx
spec:
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
ports:
- containerPort: 80
readinessProbe:
httpGet:
path: /index.html
port: 80
initialDelaySeconds: 30
timeoutSeconds: 1
See the user guide for a starter and follow-up links contained.请参阅用户指南以获取包含的入门和后续链接。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.