This project demonstrates using Traefik as a reverse proxy and ingress controller with a sample Go API.
This repository contains:
foobar-api/
: A sample Go API service (see API docs)- Infrastructure configuration for running the service with Traefik
- GitHub Actions workflow for automated testing and deployment
- Traefik: Acts as reverse proxy and ingress controller
- Prometheus: For metrics collection
- Jaeger: For distributed tracing
- Deploy Traefik (install directory)
- Generate certificates (certs directory)
- Deploy Prometheus (prometheus directory)
- Install Jaeger (jaeger directory)
- Deploy the application (kubernetes directory)
- Traefik Dashboard: https://traefik.mykubernetes.com/dashboard
- API Service: https://traefik.mykubernetes.com/myapp/
The project uses GitHub Actions for automated testing and deployment. The workflow is triggered on:
- Push to main branch
- Pull requests to main branch
The pipeline consists of:
-
Testing Stage:
- Runs on custom runner
- Executes Go tests
-
Build and Push Stage (main branch only):
- Builds Docker image
- Pushes to Docker Hub registry
- Uses version from
foobar-api/.version
for tagging
For detailed pipeline configuration, see .github/workflows/ci-cd.yaml
- Traefik Installation Guide
- Traefik Dashboard
- Middlewares Overview
- API Gateway Services Reference
- Basic Auth Configuration