planetscale / planetscale/vitess-operator

VTAdmin fails on IPv6-only clusters

Open Beginner friendly
#739 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
372
Forks
102
Avg merge
3d 5h
Merged PRs (30d)
15

Description

VTAdmin fails to connect to vtctld on IPv6-only Kubernetes clusters due to improper address formatting.

Error:
W1219 23:35:57.273443  1 component.go:39] [core] [Channel #1 SubChannel #3]
grpc: addrConn.createTransport failed to connect to {
  Addr: "fd01:10:100:1a01::c0f0:15999",
  ServerName: "",
}. Err: connection error: desc = "transport: Error while dialing: dial tcp: address fd01:10:100:1a01::c0f0:15999: too many colons in address"
Root Cause:

The discovery config uses simple string formatting:

https://github.com/planetscale/vitess-operator/blob/839329a377838561029935a8cebfaa51884b6fc4/pkg/controller/vitesscluster/reconcile_vtadmin.go#L289-L303

"hostname": "%s:%d"

With an IPv6 ClusterIP and port, this produces:
fd01:10:100:1a01::c0f0:15999

Expected Behavior:

IPv6 addresses must be bracketed per RFC 2732:
[fd01:10:100:1a01::c0f0]:15999

Suggested Fix:

Use net.JoinHostPort() which handles both IPv4 and IPv6 correctly:

"hostname": net.JoinHostPort(vtctldServiceIP, strconv.Itoa(vtctldServiceGrpcPort))

Environment:
  • Kubernetes: IPv6-only (single-stack)
  • Operator image: planetscale/vitess-operator:latest
  • Digest: sha256:459c3570105bb7fa986b6049b733833def40aa47bc787d83d3f656d9082f9737

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/controller/vitesscluster/reconcile_vtadmin.go around lines 289-303, where the VTAdmin discovery hostname is assembled. Verify the address construction for IPv4 and IPv6 service IPs, then confirm the resulting configuration uses bracketed IPv6 host-port syntax and allows VTAdmin to connect on IPv6-only Kubernetes clusters.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, kubernetes
Domain
cloud, networking
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.