Troubleshooting Kubernetes tutorial fine parallel

7/9/2019

I am attempting to work through the following tutorial https://kubernetes.io/docs/tasks/job/fine-parallel-processing-work-queue/ . My problem happens at the very first step, trying to start up redis. When I run

kubectl run -i --tty temp --image redis --command "/bin/sh"

I create a new pod, however running

redis-cli -h redis 

returns an error: Could not connect to Redis at redis:6379: Name or service not known

-- Morgan Gladden
kubernetes
rancher

1 Answer

7/10/2019

It looks like you don't have Kube DNS setup correctly and what you got it's just a simple problem with name resolution.

If you look again at the tutorial, they even mention you can encounter such problem:

Note: if you do not have Kube DNS setup correctly, you may need to change the first step of the above block to redis-cli -h $REDIS_SERVICE_HOST.

So just instead of using redis-cli -h redis use redis-cli -h $REDIS_SERVICE_HOST and everything should work.

-- mario
Source: StackOverflow