在kubernetes集群中

在kubernetes集群中

本文介绍了如何启用"ttlAfterFinished = true"在kubernetes集群中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试所有可能的配置后,我在这里问是否有人知道如何启用ttlAfterFinished=true?

After trying all possible configurations I ask here if anyone knows how to enable ttlAfterFinished=true?

我使用K8S版本1.17.1.

I use the K8S version 1.17.1.

推荐答案

您需要通过kube控制器管理器和kube API服务器中的功能门启用它.如果将Kube控制器管理器和kube API服务器部署为静态容器,则可以在

You need to enable it via the feature gate in kube controller manager and kube API Server. If Kube controller manager and kube API Server is deployed as static pod then you can find the deployment yaml at

/etc/kubernetes/manifests/kube-controller-manager.yaml

etc/kubernetes/manifests/kube-apiserver.yaml

主控节点中.

编辑两个清单文件,并在命令部分的底部添加以下行:

Edit both manifests files and add this line at the bottom of the command section:

- --feature-gates=TTLAfterFinished=true

在编辑并保存Yaml后,启用此功能后,将自动自动创建kube控制器管理器和kube API Server pod.

After the yaml is edited and saved, the kube controller manager and the kube API Server pod will be automatically recreated with this feature enabled.

您可以通过检查kube控制器管理器pod的日志进行验证,并且应该在下面看到

You can verify by checking logs of kube controller manager pod and you should see below

I0308 06:04:43.886097       1 ttlafterfinished_controller.go:105] Starting TTL after finished controller

这篇关于如何启用"ttlAfterFinished = true"在kubernetes集群中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 20:44