https://github.com/colearendt/traefik-plugin-init
An init container to make traefik local plugins easier to use
https://github.com/colearendt/traefik-plugin-init
kubernetes plugin traefik traefik-docker traefik-plugin
Last synced: 2 months ago
JSON representation
An init container to make traefik local plugins easier to use
- Host: GitHub
- URL: https://github.com/colearendt/traefik-plugin-init
- Owner: colearendt
- License: mit
- Created: 2022-01-21T23:15:38.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-26T20:42:00.000Z (about 3 years ago)
- Last Synced: 2025-02-14T12:33:18.725Z (4 months ago)
- Topics: kubernetes, plugin, traefik, traefik-docker, traefik-plugin
- Language: Go
- Homepage:
- Size: 44.9 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Traefik Plugin Init
This repository provides a simple container that:
- Can be used as an `initContainer` in Kubernetes
- Avoids having to build custom `traefik` docker images to use [traefik plugins](https://doc.traefik.io/traefik-pilot/plugins/overview/)
- (Specifically, [local plugins](https://github.com/traefik/plugindemo#local-mode), which do not require traefik pilot)
- Can be used with the [traefik helm chart](https://github.com/traefik/traefik-helm-chart)
- Allows multple plugins for a single traefik installation
- Allows specifying GitHub references per plugin (i.e. branch, tag, ref, etc.)Please see the [./examples](./examples) directory for illustrations of how to use
## What does it do
On startup, the container loops through GitHub repositories and clones them
into the container. By mounting a shared volume between this container and the
traefik container, this will make the plugin sources available to traefik.## Configuration
Recommended configuration is with environment variables:
- `TRAEFIK_PLUGIN_PATH`: the path repositories will be cloned within
- `TRAEFIK_PLUGIN_PREFIX`: the environment variable prefix to use to define GitHub repositories
- `TRAEFIK_PLUGIN_REPO_1`, `TRAEFIK_PLUGIN_REPO_2`, etc.: if
`TRAEFIK_PLUGIN_PREFIX` = `TRAEFIK_PLUGIN_REPO_`, then these would house
your GitHub referencesGit URL examples:
- `https://github.com/XciD/traefik-plugin-rewrite-headers` (will reference the
default branch at container startup)
- `https://github.com/XciD/traefik-plugin-rewrite-headers@main` (chooses a
branch or tag ref)
- **NOTE: BROKEN:** `https://github.com/XciD/traefik-plugin-rewrite-headers@e66f2dc` (chooses a
sha)**NOTE:** in production, it is recommended to pin plugins to an immutable
reference (usually a `tag`). Otherwise, restarting traefik pods can
change plugin versions## Shortcomings
- Tested only interactively against https://github.com . Semantics may be different for other
git repository providers
- SHA refs are currently broken
- Need to test properly