Skip to content

Publishing a Service

This page demonstrates how to expose a service using Traefik Hub and its tunneling feature.


Before you begin

If you don't use Kubernetes, please make sure to have Docker installed.

Before getting started, make sure you have the following:

  • An account registered on the Traefik Hub platform
  • The Traefik Hub Agent installed and running
  • A Kubernetes cluster
  • kubectl installed and configured (if you use Kubernetes)

Publishing an Example Application

In this example, you will be using a demo application called whoami, a web server answering with host-related information.

Install

The first step is to install whoami on your machine or cluster.

Use the following commands:

docker run -d -p 8080:80 --name whoami traefik/whoami
kubectl create deployment whoami --image=traefik/whoami
kubectl create service loadbalancer whoami --tcp=8080:80

Find and Publish

Now that the application is running, go back to the Traefik Hub dashboard. Find the services page on the navigation menu, search for the service called whoami, and select it.

Cannot find the service?

You can use the search bar in the top right corner of this page. The search bar filters by service name. service search

On the service detail page, select the Publish the service button. Use the form to configure the behavior.

You have two options:

  • The service port, which is normally detected by Traefik Hub automatically
  • The Access Control Policies, which secure the application with credentials, granting access only to certain users.

Finish the process by selecting the Publish the service button. The service will be accessible in a few moments.

exposed whoami

Once ready, you are redirected to the service details page, and a new section now displays the details of the service publication.

You can now see the Traefik Hub autogenerated and unique domain name allocated for your service.

The application is now accessible.

Bonus: The traffic is fully secured with TLS.

What's next