pingcap / pingcap/tidb-operator

Clean up pods after initialization job is done

Open
#6,144 1 comment 1 reaction 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.