Merge pull request #1996 from Garrybest/pr_ttl

add ttl-after-finished controller
This commit is contained in:
karmada-bot 2022-06-22 18:54:15 +08:00 committed by GitHub
commit 59219f4b6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 3 deletions

View File

@ -42,7 +42,7 @@ spec:
- --cluster-name=karmada - --cluster-name=karmada
- --cluster-signing-cert-file=/etc/karmada/pki/server-ca.crt - --cluster-signing-cert-file=/etc/karmada/pki/server-ca.crt
- --cluster-signing-key-file=/etc/karmada/pki/server-ca.key - --cluster-signing-key-file=/etc/karmada/pki/server-ca.key
- --controllers=namespace,garbagecollector,serviceaccount-token - --controllers=namespace,garbagecollector,serviceaccount-token,ttl-after-finished
- --kubeconfig=/etc/kubeconfig - --kubeconfig=/etc/kubeconfig
- --leader-elect=true - --leader-elect=true
- --node-cidr-mask-size=24 - --node-cidr-mask-size=24

View File

@ -6,10 +6,12 @@
- [Karmada Controllers](#karmada-controllers) - [Karmada Controllers](#karmada-controllers)
- [Configure Karmada Controllers](#configure-karmada-controllers) - [Configure Karmada Controllers](#configure-karmada-controllers)
- [Kubernetes Controllers](#kubernetes-controllers) - [Kubernetes Controllers](#kubernetes-controllers)
- [Recommended Controllers](#recommended-controllers) - [Required Controllers](#required-controllers)
- [namespace](#namespace) - [namespace](#namespace)
- [garbagecollector](#garbagecollector) - [garbagecollector](#garbagecollector)
- [serviceaccount-token](#serviceaccount-token) - [serviceaccount-token](#serviceaccount-token)
- [Optinal Controllers](#optinal-controllers)
- [ttl-after-finished](#ttl-after-finished)
<!-- END doctoc generated TOC please keep comment here to allow auto update --> <!-- END doctoc generated TOC please keep comment here to allow auto update -->
@ -66,7 +68,7 @@ Kubernetes. These controllers run as part of `kube-controller-manager` and are m
Users are recommended to deploy the `kube-controller-manager` along with Karmada components. And the installation Users are recommended to deploy the `kube-controller-manager` along with Karmada components. And the installation
methods list in [installation guide][2] would help you deploy it as well as Karmada components. methods list in [installation guide][2] would help you deploy it as well as Karmada components.
### Recommended Controllers ### Required Controllers
Not all controllers in `kube-controller-manager` are necessary for Karmada, if you are deploying Not all controllers in `kube-controller-manager` are necessary for Karmada, if you are deploying
Karmada using other tools, you might have to configure the controllers by `--controllers` flag just like what we did in Karmada using other tools, you might have to configure the controllers by `--controllers` flag just like what we did in
@ -114,6 +116,21 @@ More details please refer to:
- [service account token controller](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/#token-controller) - [service account token controller](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/#token-controller)
- [service account tokens](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#service-account-tokens) - [service account tokens](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#service-account-tokens)
### Optinal Controllers
#### ttl-after-finished
The `ttl-after-finished` controller runs as part of `kube-controller-manager`.
It watches `Job` updates and limits the lifetime of finished `Jobs`.
The TTL timer starts when the Job finishes, and the finished Job will be cleaned up after the TTL expires.
For the Karmada control plane, we also provide the capability to clean up finished `Jobs` automatically by
specifying the `.spec.ttlSecondsAfterFinished` field of a Job, which will be a relief for the control plane.
More details please refer to:
- [ttl after finished controller](https://kubernetes.io/docs/concepts/workloads/controllers/ttlafterfinished/#ttl-after-finished-controller)
- [clean up finished jobs automatically](https://kubernetes.io/docs/concepts/workloads/controllers/job/#clean-up-finished-jobs-automatically)
[1]: https://kubernetes.io/docs/concepts/architecture/controller/ [1]: https://kubernetes.io/docs/concepts/architecture/controller/
[2]: https://github.com/karmada-io/karmada/blob/master/docs/installation/installation.md [2]: https://github.com/karmada-io/karmada/blob/master/docs/installation/installation.md
[3]: https://github.com/karmada-io/karmada/blob/master/artifacts/deploy/kube-controller-manager.yaml [3]: https://github.com/karmada-io/karmada/blob/master/artifacts/deploy/kube-controller-manager.yaml