Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-20796

Redis unable to start in IPv6 single stack cluster

XMLWordPrintable

    • Sprint 7, Sprint 8
    • 2
    • Moderate

      Redis unable to start in IPv6 single stack cluster

      We are currently trying to get Designate set up in an OpenStack K8S Operators environment within a SingleStack IPv6 OpenShift cluster. We already came across several Issues regarding IPv6 single stack and were also warned that there will be more issues to come. Now regarding the redis server to be set up for Designate.

      Redis fails to start with the following issue: 

       

      1:M 13 Oct 2025 13:34:09.585 # Warning: Could not create server TCP listening socket designate-redis-redis-0.designate-redis-redis.openstack.svc.cluster.local:6379: Name or service not known
      1:M 13 Oct 2025 13:34:09.585 # Failed listening on port 6379 (TLS), aborting.

       

      The problem here seems to be that redis does not correctly handle the case of the hostname in the 'bind' statement of the redis config only resolving to an AAAA record. Redis handles establishing a connection in the listenToPort function within src/server.c (GitHub).
      The problematic point is the check if (strchr(addr,':')). Redis requires a : in the bind address to determine whether to connect via IPv6 or IPv4. This will not work when we bind to a hostname, as redis sets an AF_INET hint to getaddrinfo unless the addr contains an : (thus forcing IPv4).

      Possible fix

      A possible fix / workaround without touching the codebase of redis itself (the issue persists in newer versions than 6.2 anyway) would be to resolve the hostname to its IP within the startup script of the redis container. Alternatively using the {SVCNAME}_SERVICE_HOST environment variable to avoid installing DNS tool for hostname resolving. The address contains the Service IP that we want to bind to (see: Kubernetes Docs). This should happen before the generate_configs call in start_redis_replication.sh.

      Then instead of using the FQDN for replacement of the { POD_FQDN } within the redis.conf.in template use the resolved IP address instead, to avoid running into the issue mentioned before.

              rhn-support-aromito Antonio Romito
              uncle.iroh Alexander Kaeb
              Damien Ciabrini, Luca Miccini
              rhos-dfg-pidone
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: