Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hostwithquantum/traefik-example
https://github.com/hostwithquantum/traefik-example
docker docker-swarm planetary-quantum traefik
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/hostwithquantum/traefik-example
- Owner: hostwithquantum
- Created: 2021-03-11T19:32:33.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-21T12:43:31.000Z (over 3 years ago)
- Last Synced: 2024-12-30T21:15:57.495Z (14 days ago)
- Topics: docker, docker-swarm, planetary-quantum, traefik
- Language: Makefile
- Homepage: https://docs.planetary-quantum.com/
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# traefik-example
How to run your own Traefik (v1.7). This example setup is heavily tailered towards deployments on [Planetary Quantum](https://www.planetary-quantum.com/). It can serve as another example for a lean and small deployment pipeline.
The Traefik here is the same version and in a similar configuration to the one
that (optionally) comes with Planetary Quantum cluster - in other words,
[everything described in our docs](https://docs.planetary-quantum.com/common-tasks/portainer-traefik/)
will work with it.Questions, comments? Feel free to open an issue. :-)
## Setup
```shell
# create .envrc and customize it
$ cp .envrc-dist .envrc
$ $EDITOR .envrc
$ source .envrc
```### Variables explained
These variables are in the example `.envrc-dist` file. You need to customize them.
| name | description |
| :---- | :--------- |
| QUANTUM_USER | Username for deployment |
| QUANTUM_PASSWORD | Password for the account |
| QUANTUM_ENDPOINT | Name of the endpoint/cluster |
| CUSTOMER_REGISTRY | fqdn of your docker registry, e.g. `r.planetary-quantum.com` |
| CUSTOMER_PROJECT | Name of the project namespace (on your registry) |
| CUSTOMER_EMAIL | An email address for Let's Encrypt |
| TRAEFIK_DOMAIN | The domain of your endpoint/cluster, e.g. `$customer.customer.planetary-quantum.net` |## Custom TLS Certificates
To demonstrate basic custom certificate usage, this repo comes with a
self-signed example certificate for `example.127.0.0.1.nip.io`.
(Other domains will automatically get Let's Encrypt certificates.)To add your own certificates:
* adjust `traefik.tpl.toml` under `entryPoints.https.tls.certificates` to
include all your certificates
* adjust the Dockerfile to COPY them all into the image## Build and publish the the image
In order to customize Traefik and keep all dependencies together, a custom image is the most simple approach.
The name of the image itself is `traefik`, but the "fq" name is `$CUSTOMER_REGISTRY/$CUSTOMER_PROJECT/traefik:latest`.
```shell
$ make all
```There are also individual targets:
- `make build`
- `make push`## Deploy the stack
Last but not least, here is how to deploy the stack:
```shell
$ make deploy
```The _target_ invokes quantum-cli via a Docker image and injects necessary environment variables (user, password, endpoint) into the deployment.