【发布时间】:2021-05-29 18:08:26
【问题描述】:
每个 CPU 运行 2 个 pod:0.2 Core 和 Mi:1 Gi 我的节点限制为 0.4 Core 和 2 Gi。我无法增加节点限制。
为了实现零停机,我已经完成了以下配置 -
apiVersion: apps/v1
kind: Deployment
metadata:
name: abc-deployment
spec:
selector:
matchLabels:
app: abc
replicas: 2
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 2
maxUnavailable: 0
template:
metadata:
labels:
app: abc
collect_logs_with_filebeat: "true"
annotations:
sidecar.istio.io/rewriteAppHTTPProbers: "false"
spec:
containers:
- name: abc
image: abc-repository:latest
ports:
- containerPort: 8087
readinessProbe:
httpGet:
path: /healthcheck
port: 8087
initialDelaySeconds: 540
timeoutSeconds: 10
periodSeconds: 10
failureThreshold: 20
successThreshold: 1
imagePullPolicy: Always
resources:
limits:
cpu: 0.2
memory: 1000Mi
requests:
cpu: 0.2
memory: 1000Mi
在新的构建部署中,在一个新节点上创建了两个新 pod(因为 node1 没有足够的 内存和 cpu 以容纳新的 pod)说 node2。一旦新容器处于运行状态,这些新创建的 node2 pod。旧 pod(在 node1 上运行) 被销毁,现在 node1 有一些可用空间和内存。
现在我面临的问题是,由于 node1 有空闲内存和 cpu,Kubernetes 正在销毁新创建的 pod(在 node2 上运行) 然后在 node1 上创建 pod 并在其上启动应用程序容器,这会导致停机。
所以,基本上在我的情况下,即使在使用滚动更新策略和运行状况检查点之后,我也无法实现零停机时间。
请在这里帮忙!
【问题讨论】:
标签: kubernetes