- 新しい順
- 投票が多い順
- コメントが多い順
Hello,
With Kubernetes Jobs, when a Job completes, no more Pods are created, but the Pods are usually not deleted either. Keeping them around allows you to still view the logs of completed pods to check for errors, warnings, or other diagnostic output.
In EKS/Fargate the lifecyle of the Fargate node and costs are tied to the pod. As long as the pod is not removed the fargate node supporting it will be there. Given the pod is not deleted you are charged for it.
There are some tools in the Kubernetes ecosystem that can help with job cleanup. Some examples are below.
https://github.com/lwolf/kube-cleanup-operator
https://github.com/aramse/k8s-job-reaper
A fargate logging configuration should be leveraged to send the logs to a centralized location like Cloudwatch or OpenSearch before the pod is removed.
Hope that helps.
Kubectl get pods will show the pods associated with the job. Here's an example
kubectl get pods --selector=batch.kubernetes.io/job-name=examplejob
The documentation below outlines this.
https://kubernetes.io/docs/concepts/workloads/controllers/job/#running-an-example-job
関連するコンテンツ
- AWS公式更新しました 4ヶ月前
- AWS公式更新しました 1年前
- AWS公式更新しました 3年前
Thanks for the answer! Could you confirm if "kubeutil get pods" no longer lists created pods from a job confirm the pods are all deleted? In other words, is there a way I can confirm all pods are deleted after a job completed.