Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to enable "ttlAfterFinished=true" in the kubernetes cluster?

Tags:

kubernetes

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

I use the K8S version 1.17.1.

like image 524
Hanif Tadjik Avatar asked Oct 17 '25 14:10

Hanif Tadjik


1 Answers

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

and

/etc/kubernetes/manifests/kube-apiserver.yaml

in the master node.

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

- --feature-gates=TTLAfterFinished=true

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.

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

Tip: you can specify multiple feature gates using comma, for example:

--feature-gates=TTLAfterFinished=true,OtherFeature=true
like image 112
Arghya Sadhu Avatar answered Oct 20 '25 14:10

Arghya Sadhu