简体   繁体   English

如何删除已完成的Kubernetes作业中的Pod?

[英]How are pods in completed Kubernetes jobs deleted?

I'm running a Kubernetes job, and was trying to look at the logs for it hours after it had been completed. 我正在运行Kubernetes作业,并试图在完成后数小时查看它的日志。 However, when I did kubectl describe job [jobname] , no pods were listed ( Events came back as just <none> ), and when I did kubectl get pods , the pod for that job was not there. 但是,当我执行kubectl describe job [jobname] ,没有列出任何pod( Events返回为<none> ),当我进行kubectl get pods ,该工作的pod不在那儿。 How would the deletion of pods in completed jobs be configured, and how could I change that to let the pod stay up longer so I can read its logs? 如何配置已完成作业中的Pod删除,以及如何更改它以使Pod保持更长的时间以便我可以读取其日志?

Look at the properties below. 查看下面的属性。 Below setting would keep 3 jobs in the history that were successful. 低于设置将在历史记录中保留3个成功的工作。 You would have one failed job history. 您将有一个失败的工作历史记录。 You can change the count as per your need 您可以根据需要更改计数

successfulJobsHistoryLimit: 3
failedJobsHistoryLimit: 1

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

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