pingcap / pingcap/tidb-operator

Target port is hard coded to 4000 in tidb service

Open
#4,748 4 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?

Client Version: version.Info{Major:"1", Minor:"22", GitVersion:"v1.22.14", GitCommit:"bccf857df03c5a99a35e34020b3b63055f0c12ec", GitTreeState:"clean", BuildDate:"2022-09-14T22:35:04Z", GoVersion:"go1.16.15", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"20+", GitVersion:"v1.20.15-airbnb0", GitCommit:"8eb9c23f7e14a78e67cd8e3eb7853fa794e0bc4f", GitTreeState:"clean", BuildDate:"2022-07-12T23:05:33Z", GoVersion:"go1.15.15", Compiler:"gc", Platform:"linux/amd64"}
WARNING: version difference between client (1.22) and server (1.20) exceeds the supported minor version skew of +/-1
What version of TiDB Operator are you using?

we maintain a local folk.

What storage classes exist in the Kubernetes cluster and what are used for PD/TiKV pods?

What's the status of the TiDB cluster pods?

What did you do?

Trying to change the tidb container port, but from the operator code https://github.com/pingcap/tidb-operator/blob/master/pkg/manager/member/tidb_member_manager.go#L599 it seems the tidb service's target port is hard coded to 4000.

What did you expect to see?
I expected this port should be the value I specified in tidb-config?

What did you see instead?
tidb container port is hardcoded to 4000 in tidb operator

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_member_manager.go around line 599 and trace how the tidb-config port is read when the TiDB Service is built. Verify whether the generated Service targetPort follows the configured container port rather than 4000, and confirm the resulting Kubernetes resources behave correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
infrastructure
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.