Kubectl port-forward has no effect

12/17/2021

I'm trying to forward my redis pod to my local redis client. I checked pods, services, replica sets, deployments.

The command that I'm running on my cluster:

$ kubectl port-forward svc/redis 7000:6379

The response of it:

Forwarding from 127.0.0.1:7000 -> 6379
Forwarding from [::1]:7000 -> 6379

Even though, I can not connect from my terminal with $ redis-cli -p 7000.

It turns me an error and nothing happens in Kubernetes:

Could not connect to Redis at 127.0.0.1:7000: Connection refused
not connected>

Note: I've also tried --address option, sudo, different ports and to forward with pod/<pod_name>.

Is there anything that I missed?

-- enesgurdamar
kubectl
kubernetes
portforwarding
redis
redis-cli

0 Answers