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.
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:
- An account registered on the Traefik Hub platform.
kubectl
installed and configured.
Installing the Traefik Hub Agent
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.
Choose Traefik Hub as Ingress Controller (this is the default installation method) and follow the steps in the UI.
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.
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.
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, theflight
and theticket
API. - The
internal
group will have only access to theflight
API.
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.
Create the first user and assign the user to the support
group, don't forget to select the Create button.
Follow the instructions on the screen to set the user password.
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.
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.
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.
- CLI Command
- CLI Output
kubectl get apiportal -n apps
NAME URLS
traefik-hub-demo-portal https://random-name.traefikhub.io
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.
Please refer to the API Portal documentation to learn about how to use the API Portal.
- Support Group
- Internal Group
Congratulations, you deployed two APIs with two different API Accesses granting permission to two different user groups, the related API Gateway and API Portal.
Related Content
- Head over to the API Portal documentation and learn how to configure API Keys
- Learn more about API Management with Traefik Hub.