gpt4 book ai didi

kubernetes - 如何检查 "kubectl delete"何时因 "timeout waiting for ... to be synced"失败

转载 作者:行者123 更新时间:2023-12-03 11:19:10 24 4
gpt4 key购买 nike

我有一个 Kubernetes v1.10.2 集群和一个 cronjob。作业配置设置为:

   failedJobsHistoryLimit: 1
successfulJobsHistoryLimit: 3

但是它创造了十多个工作岗位,都是成功的,并没有自动移除。现在我尝试使用 kubectl delete job XXX 手动删除它们,但命令超时为:

$  kubectl delete job XXX
error: timed out waiting for "XXX" to be synced

我想知道这种情况怎么办。命令执行是否有日志文件?

我只知道kubectl logs命令,但不是针对这种情况。

“kubectl get”显示作业已经完成:

status:
active: 1
completionTime: 2018-08-27T21:20:21Z
conditions:
- lastProbeTime: 2018-08-27T21:20:21Z
lastTransitionTime: 2018-08-27T21:20:21Z
status: "True"
type: Complete
failed: 3
startTime: 2018-08-27T01:00:00Z
succeeded: 1

和“kubectl describe”输出为:

$ kubectl describe job test-elk-xxx-1535331600 -ntest
Name: test-elk-xxx-1535331600
Namespace: test
Selector: controller-uid=863a14e3-a994-11e8-8bd7-fa163e23632f
Labels: controller-uid=863a14e3-a994-11e8-8bd7-fa163e23632f
job-name=test-elk-xxx-1535331600
Annotations: <none>
Controlled By: CronJob/test-elk-xxx
Parallelism: 0
Completions: 1
Start Time: Mon, 27 Aug 2018 01:00:00 +0000
Pods Statuses: 1 Running / 1 Succeeded / 3 Failed
Pod Template:
Labels: controller-uid=863a14e3-a994-11e8-8bd7-fa163e23632f
job-name=test-elk-xxx-1535331600
Containers:
xxx:
Image: test-elk-xxx:18.03-3
Port: <none>
Host Port: <none>
Args:
--config
/etc/elasticsearch-xxx/xxx.yml
/etc/elasticsearch-xxx/actions.yml
Limits:
cpu: 100m
memory: 100Mi
Requests:
cpu: 100m
memory: 100Mi
Environment: <none>
Mounts:
/etc/elasticsearch-xxx from xxx-configs (ro)
Volumes:
xxx-configs:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: test-elk-xxx
Optional: false
Events: <none>

说明还有一个pod在运行,但是我不知道怎么弄出pod的名字。

最佳答案

检查是否kubectl describe pod <pod name> (作业的关联 pod)仍然会返回一些东西,这将:

在那个状态下,你可以考虑 a force deletion .

关于kubernetes - 如何检查 "kubectl delete"何时因 "timeout waiting for ... to be synced"失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52712622/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com