Link Search Menu Expand Document

Port and Network Access

Rendering Environment IP Addresses

To display the IP addresses, use the following syntax:

[[HOST_IP]]
[[HOST2_IP]]

Rendering Ports for the User

Labs allow ports running include the environment to be made available to learners. This is designed for displaying dashboards and other UI elements running inside a container.

Within the markdown for a step, use one of the following URLs; these will be updated with the correct details when the environment is connected:

  • To render port 8500: https://[[HOST_SUBDOMAIN]]-8500-[[KATACODA_HOST]].environments.katacoda.com/

  • To render port 80: https://[[HOST_SUBDOMAIN]]-80-[[KATACODA_HOST]].environments.katacoda.com/

  • To display page allowing user to select a port: https://[[HOST_SUBDOMAIN]]-[[KATACODA_HOST]].environments.katacoda.com/

If you would like to display dashboard tabs when a user begins a lab, provide the following "dashboards" option in your index.json file:

"environment": {
  "showdashboard": true,
  "dashboards": [{"name": "Display 80", "port": 80}, {"name": "Display 8080", "port": 8080}],
}

For an example, see https://katacoda.com/scenario-examples/scenarios/displaying-web-ui.

Port Binding

The listening process must be configured to listen on all IPs and not just localhost or 127.0.0.1.

Angular

With the Angular Live Development Server, you can specify this using ng serve --host 0.0.0.0.

Note that with the Angular Live Development Server, the Host parameter is also checked. When running within Katacoda, this check should also be disabled with the following parameter.

ng serve --host 0.0.0.0 --disable-host-check

Kubernetes

If you are planning to use the kubectl port-forward functionality within your scenario then please be aware that by default this only accepts connections from 127.0.0.1 and as such, the Katacoda Proxy won’t be able to access the port. Instead, please ensure that the command binds to 0.0.0.0 using kubectl port-forward --address 0.0.0.0.