redirect
by WyriHaximus
Redirect
About this chart
Redirect
Opinionated helm chart for wyrihaximusnet/redirect.
Provided tags
random- Each time when the images are build a random image is selected and build.reactphp- Using ReactPHPnodejs- Using NodeJS
Configuration
These images comes with 3 mandatory configuration options:
redirect.defaultFallbackTarget- Requests not matching other rules will be redirected hereredirect.buildin- Can be eithernonWwwToWwworwwwToNonWww, anything else will make the image error and stop
There is also one optional configuration option for custom hostname based redirection:
redirect.hosts- from -> to based key value mapping
While the Docker image doesn't care, for the helm chart you also have to supply all the redirect.ingressHosts you
intend to be handled by this chart.
Full configuration example:
redirect:
# The default fallback is use in case the application can't find a domain to redirect to within the other configuration options
defaultFallbackTarget: https://www.wyrihaximus.net/
enforceHttps: true
buildin: wwwToNonWww
hosts:
www.ceesjankiewiet.nl: wyrihaximus.net
ingressHosts:
- www.wyrihaximus.net
# Enable horizontal pod autoscaler
hpa:
enable: true
# Cron job that replaces the oldest pod weekly
cron:
replaceOldestPodWeekly: false
Keep in mind that the configuration options are executed in the following order:
redirect.hostsredirect.buildinredirect.defaultFallbackTarget
Opinionated decisions
- requires kubernetes ^1.18
- Ports are hardcoded to
7132for the service, and7133for the metrics. - TLS is assumed to be required, and is set up based on supplied hosts in
redirect.hostsandredirect.ingressHosts. - It's assumed that this helm chart will be run in it's own namespace, so the naming for all resources is kept as simple as possible.
- Prometheus export annotations are added for metric scraping.
- The default tag is random to randomly cycle through the different implementations, here is the why.
- Comes with a pod
- Replace oldest pod every week to hook into the weekly random image retagging
Deploy redirect with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has redirect on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartredirect is pinned at v1.1.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply