-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to connect to redis that listening on IPv6 interface #512
Comments
Hi, thanks for the report. As a short recap from your tests/doings:
After theses steps its working... Base on this i can prepare a Change and push it this week. Please correct me if i'm wrong or missed something as i do not know if i can setup an test environment locally right now. And another note - since some time its not possible to update the dockerhub image anymore. Latest versions are available from Best regards, |
Yeap everything correct. I am waiting for patch to test it. I will use image from gcr.io registry, thanks for info. I also thought about create a test env in virtualbox, but there are some issues also with VB and IPv6 :/ |
latest Version from gcr.io should work. Can you please test it? Runing locally it can connect to IPv6 server. Using Docker you may set the env var Booth And thanks for VB/Vagrant info - used it to update my redis test vm for ipv6 connectivity. |
Hello, I have tested the latest version. Everything works. Thanks.
This doesn't look like a trivial task. The ENTRYPOINT script accept entry in REDIS_HOSTS as First we can check whether hostname looks like ipv4, then check first character (whether is equals to #!/bin/bash -e
IP_ADDRESSES=(
'2001:0db8:85a3:0000:0000:8a2e:0370:7334:PORTHERE'
'2001:0db8:85a3:0000:0000:8a2e:0370:7334'
'127.0.0.1:PORTHERE'
'127.0.0.1'
'[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:PORTHERE'
'[2001:0db8:85a3:0000:0000:8a2e:0370:7334]'
'dnsname'
'dnsname:PORTHERE'
)
for ip in ${IP_ADDRESSES[@]}; do
printf ">>> %52s" $ip
echo
if [[ $ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+ ]]; then
chunks=($(echo $ip | sed 's|\(.*\):|\1 |'))
elif [[ $ip =~ ^\[ ]]; then
chunks=($(echo $ip | sed 's|\(.*\)]:|\1] |'))
else
chunks=($(echo $ip | sed 's|\(.*\):|\1 |'))
fi
printf "IP: %52s PORT: %4s" ${chunks[0]:-''} ${chunks[1]:-6379}
echo
echo
done
Which gives results
|
Many thanks for this. And having multiple fields like label and so on i say using square brackets for ipv6 addresses will be required for these envs vars. Makes parsing a lot easier than. Port and/or db number might be given and using the shortened ipv6 writing with "fd00::1" it is indistinguishable... Writing "fd00::1:1024:1" means what?
And maybe i parse these in nodejs, a little helper script called from the docker-startup like other regular programs might be easier than a pure shell script... |
Hello,
The redis-commander has problem with connecting to redis that listening on IPv6 interface.
I deployed rediscommander using image rediscommander/redis-commander:latest (docker.io/rediscommander/redis-commander@sha256:19cd0c49f418779fa2822a0496c5e6516d0c792effc39ed20089e6268477e40a ). When I tried to connect to configured redis server (added by env variable) in logs I noticed errors:
I changed my deployment manifest. I added:
After this change I was able to exec to running pod with root privileges.
I installed redis.
Using
redis-cli -h redis
I was able to connect to redis instance and callping
command.I checked source code and i found this -
redis-commander/lib/util.js
Line 322 in 942142f
I changed the value of family property to 6.
I ran
ps -ef
to see running commands.I decided to ran a new instane of redis-commander on a different port:
/usr/bin/node ./bin/redis-commander --port 8082 --redis-port tcp://[fd2e:565e:ab48::XXXX]:6379
.I used
kubectl port-forward
to connect to a new redis-commander instance and everything worked - I connected to redis and I saw all my keys in db.At the moment neither minikube (https://minikube.sigs.k8s.io/docs/faq/#does-minikube-support-ipv6) nor microk8s (canonical/microk8s#1343) support IPv6 stack. So I cannot prepare example.
I have access to k8s cluster which run on ipv6 stack, so I am able to test fix.
The text was updated successfully, but these errors were encountered: