pingcap / pingcap/tidb-operator
Clean up pods after initialization job is done
Open
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1.3k
- Forks
- 540
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 18
Description
Feature Request
After the init job is done, the pod in kubernetes is kept forever. It could be deleted automatically, if the job had spec.ttlSecondsAfterFinished configured.
The solution would be to add TTLSecondsAfterFinished to batchv1.JobSpec in pkg/manager/member/tidb_init_manager.go#L400
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pkg/manager/member/tidb_init_manager.go around line 400, where the Kubernetes batchv1.JobSpec for the initialization job is built. Confirm the appropriate TTLSecondsAfterFinished value, then verify that completed initialization jobs are configured for automatic cleanup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- infrastructure
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100