Kubernetes: port-forward for service object getting timed out

1/26/2022

I am trying to port-forward to k8s service object which is getting timed out. I am using the k8s cluster in my docker desktop.

Is that some additional setting required for this?

$ kubectl get service
NAME            TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)          AGE
kubernetes      ClusterIP      10.96.0.1       <none>        443/TCP          205d
springboot-ms   LoadBalancer   10.106.71.156   127.0.0.240   8080:30742/TCP   18m

Here is the port-forward:

$ kubectl port-forward service/springboot-ms 8080:8080
error: timed out waiting for the condition

However, if I perform the port-forward to my deployment object, it works perfectly.

$ kubectl port-forward deployment/springboot-ms 8080:8080
Forwarding from 127.0.0.1:8080 -> 8080
Handling connection for 8080
-- G.S
docker-desktop
kubernetes

0 Answers