https://github.com/evertras/traefik-2-sandbox
Quick sandbox area to play with Traefik 2 in Kubernetes
https://github.com/evertras/traefik-2-sandbox
Last synced: 4 months ago
JSON representation
Quick sandbox area to play with Traefik 2 in Kubernetes
- Host: GitHub
- URL: https://github.com/evertras/traefik-2-sandbox
- Owner: Evertras
- Created: 2020-10-17T12:25:07.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-10-17T13:14:45.000Z (over 5 years ago)
- Last Synced: 2025-04-06T00:25:43.621Z (about 1 year ago)
- Language: Makefile
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Traefik v2 Sandbox
This is a sandbox area to play with Traefik v2 in Kubernetes as an ingress.
It contains two simple HTTP services that are deployed side by side in a local
Kubernetes cluster, and then Traefik will route between the two.
This will eventually contain some auth examples and more interesting
configs. For now, this is just a simple but complete sample of how
to set up Traefik v2 in Kubernetes locally for development purposes.
## Running it
Make sure your `kubectl` is pointing to your local Kubernetes cluster.
The namespace won't matter, a namespace named `traefik-sandbox` will
be created and everything will be put there.
```bash
# This will build the docker images and then deploy to local k8s
make apply
# Run various curl commands to see if we get routed properly
make test
```
If you're running Chrome, you can check the Traefik dashboard at
http://traefik.localhost/dashboard/
## A note on x.localhost domains
If you're using another browser, you'll have to add `traefik.localhost`
to `/etc/hosts` as a localhost endpoint first. This is because Chrome
assumes any `xyz.localhost` domain is actually trying to hit localhost,
but other browsers assume anything that isn't exactly `localhost` is
trying to hit a real server somewhere else. This includes curl, which
is why the `make test` command contains `-H "Host: traefik.localhost"`
and so on for its curls.