App template
Error pages
Shows a maintenance page and error pages for the project's domains.
- Memory when idle
- about 10 MiB
- CI measures it once the app is ready and before any traffic. Leave room for more.
- Tested on
- x86 servers
Introduction
Error pages serves a maintenance page and the pages for the status codes 404, 502, 503 and 504. It is a small nginx server that holds the pages in a ConfigMap.
This template has no domain and no sign-in. Zeabur OSS sends the maintenance and error pages of the project’s domains to this service. Other workloads in the same namespace can use it too.
Values you provide
You don’t fill in anything when you deploy.
Getting started
-
In Zeabur OSS, open the
error-pagesservice. When Overview shows its replica as ready, the service is up. It has no public domain. The Networking tab shows its private address. -
Other workloads reach it through the Service
error-pages. Port 8080 serves each page athttp://error-pages:8080/<status>.html, for examplehttp://error-pages:8080/502.html. Port 8081 answers every request with the maintenance page and status503. -
To look at a page from your own machine, open a tunnel and request it. Zeabur OSS has no screen for this, so use kubectl:
kubectl -n <namespace> port-forward service/error-pages 8080:8080 curl http://localhost:8080/502.html
There are no secrets to read for this template.
Configuration
Use the pages in a Traefik errors middleware
Create a Middleware in the same namespace that sends error responses to port 8080 and asks for the page of the status code:
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: error-pages
spec:
errors:
status:
- "404"
- "502-504"
query: /{status}.html
service:
name: error-pages
port: 8080
See Errors in the Traefik docs.
Change the text of a page
The pages are the keys 404.html, 502.html, 503.html, 504.html and maintenance.html of the ConfigMap error-pages. In the project, open the Objects page, open the ConfigMap error-pages, switch to the YAML view, click Edit, change the page, then review and apply. Kubernetes updates the mounted files within about a minute, and nginx reads each page on every request, so you do not need to restart anything.
Resources
Each service is guaranteed the first amount and can use up to the second.
error-pages
Ports
8080, 8081
CPU
0.005 cores to 0.1 cores
Memory
8 MiB to 32 MiB
Technical details
This release
- Version
- 1.31.7-alpine-slim
- Licence
- BSD-2-Clause AND Apache-2.0
- Homepage
- nginx.org
- Source file
- templates/error-pages/template.yaml @ v0.6.3
Tested in CI
CI installs these exact files on a new cluster, waits until they are ready, then records the idle memory.
| Distribution | Platform | Kubernetes | Passed | Idle memory |
|---|---|---|---|---|
| kind | linux/amd64 | v1.37.0 | 2 MiB |
Security
The pod cannot reach the Kubernetes API. It runs as non-root UID 101 with a read-only filesystem and no extra capabilities, and it makes no outbound connections. The Service and the ConfigMap of pages carry the label zeabur.com/page-server=true, which Zeabur OSS uses to find the page server.
Known risks
Risk
Anyone who can edit the ConfigMap changes what visitors see.
How it is handled
Give edit rights on ConfigMaps only to people who may change the site. The server sends the HTML as is and runs no code.
What the cluster needs
Zeabur OSS suggests the components a cluster is missing. Without it, install them first.