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:
|
"vtctlds": [ |
|
{ |
|
"host": { |
|
"fqdn": "%s:%d", |
|
"hostname": "%s:%d" |
|
} |
|
} |
|
], |
|
"vtgates": [ |
|
{ |
|
"host": { |
|
"hostname": "%s:%d" |
|
} |
|
} |
|
] |
"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
VTAdmin fails to connect to vtctld on IPv6-only Kubernetes clusters due to improper address formatting.
Error:
Root Cause:
The discovery config uses simple string formatting:
vitess-operator/pkg/controller/vitesscluster/reconcile_vtadmin.go
Lines 289 to 303 in 839329a
"hostname": "%s:%d"With an IPv6 ClusterIP and port, this produces:
fd01:10:100:1a01::c0f0:15999Expected Behavior:
IPv6 addresses must be bracketed per RFC 2732:
[fd01:10:100:1a01::c0f0]:15999Suggested Fix:
Use
net.JoinHostPort()which handles both IPv4 and IPv6 correctly:"hostname": net.JoinHostPort(vtctldServiceIP, strconv.Itoa(vtctldServiceGrpcPort))Environment:
planetscale/vitess-operator:latestsha256:459c3570105bb7fa986b6049b733833def40aa47bc787d83d3f656d9082f9737