Welcome to the Linux Foundation Forum!

Lab 3.2 port-forwarding to example app fails

ramrodo Posts: 3
edited June 5 in LFS256 Class Forum

In Lab 3.2, at Step 4 trying to access the deployed application using the following command:

kubectl port-forward svc/argocd-example-app-service 9090:3000

and trying to access to http://localhost:9090/, it crashes after 1st or following attempts with the following message:

$ kubectl port-forward svc/argocd-example-app-service 9090:3000
Forwarding from -> 3000
Forwarding from [::1]:9090 -> 3000
Handling connection for 9090
E0604 19:10:22.343701  437481 portforward.go:409] an error occurred forwarding 9090 -> 3000: error forwarding port 3000 to pod 93f214d64df6a844543a6c6ddcbda3c327c799adecddbdb749d88d8ab4524f9c, uid : failed to execute portforward in network namespace "/var/run/netns/cni-82f4f592-8524-2180-8043-324a3e202f67": failed to connect to localhost:3000 inside namespace "93f214d64df6a844543a6c6ddcbda3c327c799adecddbdb749d88d8ab4524f9c", IPv4: dial tcp4 connect: connection refused IPv6 dial tcp6 [::1]:3000: connect: connection refused 
error: lost connection to pod

This happens with a local kind cluster (kind v0.23.0) with k8s v1.29 using Manjaro Linux as OS.

From my experience with other similar cases, this happens when the container image (in this case liquidreply/argocd-example-app) is missing some configuration at the Dockerfile/Containerfile.



Upcoming Training