[英]Adding a PodDisruptionBudget to fluentd-gcp pods in GKE
My fluentd-gcp
pods are like the following: 我的fluentd-gcp
豆荚如下所示:
apiVersion: v1
kind: Pod
metadata:
annotations:
scheduler.alpha.kubernetes.io/critical-pod: ""
creationTimestamp: 2019-08-06T23:41:17Z
generateName: fluentd-gcp-v3.1.1-
labels:
controller-revision-hash: 7cbbc7496
k8s-app: fluentd-gcp
kubernetes.io/cluster-service: "true"
pod-template-generation: "4"
version: v3.1.1
name: fluentd-gcp-v3.1.1-jpd5x
namespace: kube-system
I tried to add a Pod Disruption Budget like this 我试图添加一个这样的Pod破坏预算
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: fluentd-gcp
spec:
minAvailable: 1
selector:
matchLabels:
app: fluentd-gcp
However, the allowed disruptions
value is 0 但是, allowed disruptions
值为0
$ kubectl get pdb
NAME MIN AVAILABLE MAX UNAVAILABLE ALLOWED DISRUPTIONS AGE
fluentd-gcp 1 N/A 0 9s
which indicates that there is no matching pod with that label as mentioned here https://kubernetes.io/docs/tasks/run-application/configure-pdb/#check-the-status-of-the-pdb 这表明没有匹配的吊舱具有此处提到的标签https://kubernetes.io/docs/tasks/run-application/configure-pdb/#check-the-status-of-the-pdb
Am I missing something? 我想念什么吗?
ALLOWED DISRUPTIONS
describes pods that are candidates for eviction rather than the number of pods the PDB
has seen. ALLOWED DISRUPTIONS
描述的是可以驱逐的豆荚,而不是PDB
看到的豆荚数量。
If you do $ kubectl describe pdb NAME
, you'll see the current
field, which describes accurately how many pods are being matched by the PDB
using the mentioned labels. 如果您执行$ kubectl describe pdb NAME
,则会看到current
字段,该字段使用上述标签准确地描述了PDB
匹配了多少个$ kubectl describe pdb NAME
。
Although is not specified in your question, consider that by default in GKE fluentd-gcp
is run as a DaemonSet
, this means that the number of replicas depends on the number of nodes in the cluster . 尽管您的问题中未指定,但请注意,默认情况下,在GKE中fluentd-gcp
是作为DaemonSet
运行的,这意味着副本数取决于集群中的节点数 。
This would prevent the PDB
to mark these pods as evictable, as they depend on the nodes rather than the number in the ReplicaSet
. 这将防止PDB
将这些吊舱标记为可收回,因为它们取决于节点而不是ReplicaSet
中的ReplicaSet
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.