An easily customized pretty default backend replacement for Kubernetes Nginx ingress controller with a neutral default configuration.
A default installation will deploy a single instance of pretty-default-backend to the same namespace of the ingress that will utilize it.
Replace values [namespace-of-ingress], and [ingress-name] in the commands below according to your environment
-
Add Helm Repository
helm add repo bsord https://h.cfhr.io/bsord/charts
-
Install the helm chart (to same namespace as ingress)
helm install bsord/pretty-default-backend --set bgColor="#443322" --set brandingText="YourBrandingText" bsord/pretty-default-backend -n [namespace-of-ingress]
-
Configure an ingress to use pretty-default-backend with one of the following two options:
- Patch the Ingress Directly
kubectl annotate ingress [ingress-name] -n [namespace-of-ingress] \ nginx.ingress.kubernetes.io/default-backend=pretty-default-backend --overwrite kubectl annotate ingress [ingress-name] -n [namespace-of-ingress] \ nginx.ingress.kubernetes.io/custom-http-errors="404,503" --overwrite
- Pass as parameters to standard templated Helm v3 chart
Please note you must escape any special characters including commas and periods with a
Helm install [release-name] \ --set "ingress.annotations.nginx\\.ingress\\.kubernetes\\.io/default-backend=pretty-default-backend" \ --set "ingress.annotations.nginx\\.ingress\\.kubernetes\\.io/custom-http-errors=404\\,503\\,501" \ [repo/chart-name]
\
backslash when passing complex strings to--set
.
- Patch the Ingress Directly
Browse to a location that does not exist and would trigger a 404 on the ingress you annotated above.
The parameters below can be passed using --set KEY=VALUE
in the helm install/upgrade command above.
Key | Value | Default |
---|---|---|
bgColor |
Background color of the page in hex value | #334455 |
brandingText |
Branding text at bottom of error box | BrandingText(2020) |
- Write a functional ReadMe
- Fix workflow so it only triggers on succesful merge
- Use seperate writer stream before sending response (prevent broken responses)
- Add support for rich html variable input