maintenance

by codewithemad

Helm chartv0.1.7App 1.20.0AGPL-3.0Verified publisher

Quickly set up an elegant and user-friendly maintenance page for your services.

About this chart

⚙ Maintenance Chart

This Helm chart deploys a simple maintenance page using Caddy as the web server. It's designed to be easily deployed when you need to take your service down for maintenance, providing a user-friendly message to your visitors.

Features

  • Simple HTML maintenance page.
  • Caddy web server for efficient serving of static content.
  • Kubernetes Deployment, Service, and Ingress resources.
  • Configurable maintenance message.

Prerequisites

  • Kubernetes 1.19+
  • Helm 3.2.0+
  • The ingress controller (e.g., nginx-ingress) is installed in your cluster.

Installation

To use this chart, first add the repository:

helm repo add codewithemad https://codewithemad.ir/helm-charts/
helm repo update

Then, you can install the chart with the release name my-maintenance:

helm install my-maintenance codewithemad/maintenance --set ingress.host=your-domain.com

This command deploys the maintenance page on the Kubernetes cluster with the default configuration. The --set flag allows you to customize the ingress host.

To revert to your normal service, uninstall the maintenance chart and redeploy your original service.

helm uninstall my-maintenance

This removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the Maintenance chart and their default values.

ParameterDescriptionDefault
replicaCountNumber of replicas1
namespaceKubernetes namespace to usedefault
image.repositoryImage repositorycaddy
image.tagImage tag2.11.9-alpine
image.pullPolicyImage pull policyIfNotPresent
service.typeKubernetes Service typeClusterIP
service.portKubernetes Service port80
ingress.enabledEnable ingress controller resourcetrue
ingress.classNameIngressClass that will be usednginx
ingress.hostHostname to your maintenance applicationdown.example.com
ingress.annotationsAdditional ingress annotations{}
ingress.tls.enabledEnable TLS for ingressfalse
ingress.tls.secretNameName of the TLS secret""
maintenance.titleHeader titleSee values.yaml
maintenance.messageMessage displayed on the maintenanceSee values.yaml
page
maintenance.descriptionA short description below the messageSee values.yaml
maintenance.bannerURLURL of an image showing on top of theSee values.yaml
message
maintenance.faviconURLURL of a favicon.ico fileSee values.yaml

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example:

helm install my-maintenance codewithemad/maintenance \
  --set namespace=project-x \
  --set ingress.host="maintenance.mysite.com" \
  --set ingress.tls.enabled=true \
  --set ingress.tls.secretName="maintenance-mysite-com" \
  --set maintenance.message="We are performing scheduled maintenance. We'll be back online shortly" \
  --set maintenance.caption="For more contact <a href='mailto:[email protected]'>[email protected]</a>"

If you want to issue a new certificate using something like cert-manager, use:

--set ingress.annotations."cert-manager\.io/cluster-issuer"=letsencrypt

Alternatively, a YAML file specifying the parameters' values can be provided while installing the chart. For example:

helm install my-maintenance codewithemad/maintenance -f my-values.yaml

Contributing

Contributions are welcome! Please see the CONTRIBUTING.rst file for details.

License

This work is licensed under the terms of the GNU Affero General Public License (AGPL).

Deploy maintenance with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has maintenance 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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartmaintenance is pinned at v0.1.7 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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