Bobcares

Kubernetes integration don’t publish ports to host: What to do

by | Nov 17, 2021

Kubernetes integration don’t publish ports to host and giving you trouble? Our Support Techs have a solution to your problem.

At Bobcares, we have a solution for every issue, big and small as a part of our Server Management Services.

Let’s take a look at how our in-house experts resolve this issue today.

Kubernetes integration don’t publish ports to host

While running a Kubernetes NodePort service, you should be able to reach the service via the host-exposed port on localhost. For instance, if it is NodePort service on ports 80:31235/TCP according to kubectl get services, you can use curl http://localhost:31235.

However, sometimes you find yourself able to reach it within the cluster through every expected route, except the host.

Here is a sample output ofrom the Diagnose & Feedback section of the menu in such a scenario:

Docker for Mac: version: 17.12.0-ce-mac45 (a61e84b8bca06b1ae6ce058cdd7beab1520ad622) 
macOS: version 10.13.2 (build: 17C205) 
logs: /tmp/28E2313A-556A-4863-8921-3D5C1F192311/20180116-212006.tar.gz 
[OK] db.git 
[OK] vmnetd 
[OK] dns 
[OK] driver.amd64-linux 
[OK] virtualization VT-X 
[OK] app 
[OK] moby 
[OK] system 
[OK] moby-syslog 
[OK] kubernetes 
[OK] env 
[OK] virtualization kern.hv_support 
[OK] slirp 
[OK] osxfs 
[OK] moby-console 
[OK] logs 
[OK] docker-cli 
[OK] menubar 
[OK] disk

In this example, we can ascertain the Diagnostic ID as 28E2313A-556A-4863-8921-3D5C1F192311

Resolving Kubernetes integration don’t publish ports to host

  1. First, we will switch to Docker Edge via Homebrew:
    brew cask uninstall docker 
    brew cask install docker-edge

    Then we will launch edge whale via the OSX Launchpad. Then reset the world and turn on Kubernetes support in the preferences window.

  2. Next, download, gist from this link.
  3. After that, run the following command:
    kubectl apply -f k8s-services.yaml
  4. Then, run the command
    kubectl get pods

    This will result in 2 matching pods. Copy and paste one and run one of them. For instance:

    kubectl describe pod lb-5958db466f-6znvm

    You will notice it running on an IP address and also notice it running an HTTP daemon that is listening on port 8111.

  5. Next, run the following command:
    curl http://localhost:30246,
  6. Our Support Engineers recommend trying again with any of pods-local, host ports, service on node IP address or 127.0.0.1.
  7. Then, run the following command
    kubectl run --rm -i --tty --image busybox x,

    Then withtint he shell, run:

    wget http://np:8181.

    You will notice that the normal paths are able to reach between services without difficulty within the cluster.

  8. Next, run the following command to get a shell in the hidden Linux virtual machine.
    screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty

    We will then run the following command with the second port number to finally reach the service successfully.

    wget http://localhost:30246,

[Require assistance with another issue? Give us a call today.]

Conclusion

To conclude, we learned what to do when Kubernetes integration don’t publish ports to host. Our Support Engineers illustrated how to reach the service successfully in case of this specific issue.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Never again lose customers to poor
server speed! Let us help you.