From 74bb61bb0077538a781b249194d47d90dbaee934 Mon Sep 17 00:00:00 2001 From: Garrybest Date: Mon, 13 Jun 2022 23:07:00 +0800 Subject: [PATCH] add ttl-after-finished controller Signed-off-by: Garrybest --- artifacts/deploy/kube-controller-manager.yaml | 2 +- docs/userguide/configure-controllers.md | 21 +++++++++++++++++-- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/artifacts/deploy/kube-controller-manager.yaml b/artifacts/deploy/kube-controller-manager.yaml index f59753462..d75f8b301 100644 --- a/artifacts/deploy/kube-controller-manager.yaml +++ b/artifacts/deploy/kube-controller-manager.yaml @@ -42,7 +42,7 @@ spec: - --cluster-name=karmada - --cluster-signing-cert-file=/etc/karmada/pki/server-ca.crt - --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 - --leader-elect=true - --node-cidr-mask-size=24 diff --git a/docs/userguide/configure-controllers.md b/docs/userguide/configure-controllers.md index 74b98dad5..7bcec05ef 100644 --- a/docs/userguide/configure-controllers.md +++ b/docs/userguide/configure-controllers.md @@ -6,10 +6,12 @@ - [Karmada Controllers](#karmada-controllers) - [Configure Karmada Controllers](#configure-karmada-controllers) - [Kubernetes Controllers](#kubernetes-controllers) - - [Recommended Controllers](#recommended-controllers) + - [Required Controllers](#required-controllers) - [namespace](#namespace) - [garbagecollector](#garbagecollector) - [serviceaccount-token](#serviceaccount-token) + - [Optinal Controllers](#optinal-controllers) + - [ttl-after-finished](#ttl-after-finished) @@ -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 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 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 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/ [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