0

Can anyone shed some light on why this might not work? I can access redis just fine using the pod's IP address,

$ rdcli -h 10.152.183.65
10.152.183.65:6379> 

but when I try to use the DNS name, I cannot connect.

$ rdcli -h dbbackupd.default.cluster.local
dbbackupd.default.cluster.local:6379> (error) Redis connection to dbbackupd.default.cluster.local:6379 failed - getaddrinfo ENOTFOUND dbbackupd.default.cluster.local dbbackupd.default.cluster.local:6379

Inside the pod that is trying to contact redis, I get the right-looking output when using the host command, so name resolution looks good:

$ host dbbackupd.default.svc.cluster.local

dbbackupd.default.svc.cluster.local has address 10.152.183.65

My theory is that because redis is in a multi-container pod, that dns is not routing it to the container properly. Here is my Service's definition in case that sheds light:

apiVersion: v1
kind: Service
metadata:
  name: dbbackupd
  labels:
    app: dbbackupd
spec:
  selector:
    app: dbbackupd
  type: NodePort
  ports:
    - name: redis-mq
      protocol: TCP
      port: 6379
      targetPort: 6379
    - name: sql-comm
      protocol: TCP
      port: 1433
      targetPort: 1433

1 Answer 1

3

You're using two different host names:

$ rdcli -h dbbackupd.default.cluster.local
$ host dbbackupd.default.svc.cluster.local

The one used with rdcli is missing .svc.

2
  • Wow, I feel dumb. I have had a long day, and can't believe I missed something that simple. Anyway, I did confirm that this was the only issue. DNS is working fine, and I can connect to Redis. Thanks for the keen eye. Aug 12, 2020 at 7:32
  • 1
    I've been there myself more times than I'm willing to admit. :) Glad that's all it was.
    – bradym
    Aug 12, 2020 at 20:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.