Skip to main content

Quick-Start Guide

In the next 8 minutes, you’ll install your first Traefik Hub agent, and you'll deploy your first APIs and configure the API Gateway and API Portal.


Introduction

This quick start guide takes you through installing the Traefik Hub agent and creating API Users using the internal IdP and deploying an API Management CRD stack into the apps namespace of your Kubernetes cluster.

Once the deployment is done, you will have a working API Portal with three APIs, one API collection and configured access permissions.

For a hassle-free experience, you will use our demo files from our workshop repository on GitHub tailored for this quick start guide.

Good to Know

Following this guide, you'll use kubectl to deploy files from a GitHub repository onto your Kubernetes cluster.
This guide uses traefikhub.io domains for API Gateways and Portals.
This guide uses the Internal IdP for user management.

Before You Begin

Please make sure you have the following:

Installing the Traefik Hub Agent

info

You can always refer to the detailed installation documentation for more information.

Login into the Traefik Hub dashboard and select Create my first Traefik Hub agent.

https://hub.traefik.io

Choose install

Choose Traefik Hub as Ingress Controller (this is the default installation method) and follow the steps in the UI.

https://hub.traefik.io

Ingress Controller mode

Copy and paste the instructions provided in step 2 and run them on your cluster. This will install Traefik Hub.

We recommend you save the agent token provided in step 3 for future reference. If you lose this token, you won't be able to recover it and will need to go through a new installation process.

As the last step (4) give the agent a name or use the random created one by Traefik Hub.

Select Configuration Done. Traefik Hub will then detect your newly installed agent.

Custom Configuration

For adjusting the default configuration, please refer to the custom configuration documentation.


User and Groups

To consume APIs, a user needs to be part of a user group. Groups are a means of categorizing users.
This allows for granting permissions to APIs for specific groups.

Read More

Please refer to the user management documentation for more information.

Creating Groups

Head over to groups page in the dashboard by selecting Groups on the left navigation, followed by Add group in the right top corner of the groups overview page and create two user groups:

  • The support group will have access to an API Collection, containing two APIs, the flight and the ticket API.
  • The internal group will have only access to the flight API.
https://hub.traefik.io/groups

Form for adding a group.

After you created the groups, you will now add two user.

Creating User

Select Users on the left navigation bar and Add user on the top right.

https://hub.traefik.io/users

Select the user creation form in the dashboard.

Create the first user and assign the user to the support group, don't forget to select the Create button.

https://hub.traefik.io/users/new

Filling in the user creation form.

Follow the instructions on the screen to set the user password.

https://hub.traefik.io/users/new

Follow the screen instructions to set a password for the user.

Repeat that step to create a second user, but this time assign the user to the group internal.

Deploy the CRD Stack

It is now time to deploy the demo CRD file.
This deployment will set up two different APIs (flight, ticket) and it will configure the API access permissions, the API Gateway and the API Portal.

warning

Before you continue with this guide, please take the time to review the files on GitHub!

Please do not deploy CRDs to your cluster without checking them first.

Use kubectl to push the deployment to your cluster.

CLI
kubectl apply -f https://raw.githubusercontent.com/traefik-workshops/hub-tutorials/master/quickstart/quickstart.yaml

This will take a short moment.

Access the API Portal

Use kubectl to get the URL of the newly created API Portal.

kubectl get apiportal -n apps
info

It may take a short moment till your Portal is fully deployed and reachable.

It is possible that you see warnings related to TLS during the initialization of the API Portal.

Browse to the URL and log in as one of the user you created.
Depending on the user, you will see that one of the user (member of the support group) has access to an API collection, containing two APIs.
The other user (member of the internal group) has only access to the flight API.

Read More

Please refer to the API Portal documentation to learn about how to use the API Portal.

https://random-name.traefikhub.io/collections/demo-travel-collection/apis/flight-api@apps

API Portal showing an API Collection.

Congratulations, you deployed two APIs with two different API Accesses granting permission to two different user groups, the related API Gateway and API Portal.