pingcap / pingcap/tidb-operator

Doesn't work on K8s version 1.27 due to out of date KubeSchedulerConfiguration

Open
#5,355 2 comments 0 reactions 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

Bug Report

What version of Kubernetes are you using?
1.27.3

What version of TiDB Operator are you using?
1.5.1

What storage classes exist in the Kubernetes cluster and what are used for PD/TiKV pods?
Rook: ceph-block/ceph-filesystem

What's the status of the TiDB cluster pods?

NAME                                      READY   STATUS             RESTARTS        AGE   IP             NODE         NOMINATED NODE   READINESS GATES
tidb-controller-manager-58f8f675b-6whgc   1/1     Running            0               18h   10.255.0.252   enkubea001   <none>           <none>
tidb-scheduler-7f6d7b4b84-6l6xp           1/2     CrashLoopBackOff   7 (2m50s ago)   13m   10.255.0.74    enkubea001   <none>           <none>

What did you do?
Clean install.

What did you expect to see?
All pods working

What did you see instead?
In logs for: tidb-scheduler-7f6d7b4b84-6l6xp:kube-scheduler
│ E1024 08:52:14.638974 1 run.go:74] "command failed" err="no kind "KubeSchedulerConfiguration" is registered for version "kubescheduler.config.k8s.io/v1beta2" in scheme "pkg/sched │
│ Stream closed EOF for {$namespace}/tidb-scheduler-7f6d7b4b84-6l6xp (kube-scheduler)

The error is because https://github.com/pingcap/tidb-operator/blob/91fbecb52222a46cda2803996b781e0520332a2c/charts/tidb-operator/templates/config/_scheduler-config-yaml.tpl#L2 creates:
kubescheduler.config.k8s.io/v1beta2 which is now deprecated. The fix is to use just kubescheduler.config.k8s.io/v1 which has been about some time.
beta2 was deprecated in kubernetes1.25, when v1 was released (https://sysdig.com/blog/kubernetes-1-25-whats-new/)

The fix is probably another "if semverCompare" where for version 1.25 or later use v1 of the API.

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 with charts/tidb-operator/templates/config/_scheduler-config-yaml.tpl at the referenced line and inspect how the Kubernetes version is selected. Verify the rendered scheduler configuration for Kubernetes 1.25 and later, then confirm that a clean TiDB Operator install on Kubernetes 1.27 starts the scheduler without the reported registration error.

Written by the indexing model from the issue text.

Assessment

Tech stack
helm, kubernetes
Domain
infrastructure
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.