You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
And sure enough, following this chapter and applying both files to K8s will show this error message (please note that I'm using the "KinD" setup, and because of my local Docker setup have to explicitly create a port forwarding):
$ kubectl port-forward service/svc-test 30001:8080
Forwarding from 127.0.0.1:30001 -> 9090
Forwarding from [::1]:30001 -> 9090
Handling connection for 30001
E0625 13:52:21.097232 41027 portforward.go:409] an error occurred forwarding 30001 -> 9090: error forwarding port 9090 to pod ..., uid : failed to execute portforward in network namespace "/var/run/netns/cni-...": failed to connect to localhost:9090 inside namespace "...", IPv4: dial tcp4 127.0.0.1:9090: connect: connection refused IPv6 dial tcp6 [::1]:9090: connect: connection refused
After updating the services/svc.yml file and changing the targetPortfrom 9090 to 8080, it works as expected.
For reference, in the printed book (2023 edition) the services/svc.yml file is shown, and there it also says targetPort: 8080.
The text was updated successfully, but these errors were encountered:
Hi @nigelpoulton, while enjoying your K8s book, I noticed that a port definition in one of the examples does not match another file.
In the Service definition it says the target port is 9090:
TheK8sBook/services/svc.yml
Line 16 in 0b36032
The Pods that this Service refers to are defined like this, with port 8080:
TheK8sBook/services/deploy.yml
Line 19 in 0b36032
And sure enough, following this chapter and applying both files to K8s will show this error message (please note that I'm using the "KinD" setup, and because of my local Docker setup have to explicitly create a port forwarding):
After updating the
services/svc.yml
file and changing thetargetPort
from9090
to8080
, it works as expected.For reference, in the printed book (2023 edition) the
services/svc.yml
file is shown, and there it also saystargetPort: 8080
.The text was updated successfully, but these errors were encountered: