cluster-etcdbackup

by startxfr

Helm chartv21.3.418App 1.0.0GPL-3.0-or-laterVerified publisher

Helm chart used to deploy a CronJob that backs up OpenShift etcd to an S3-compatible object store at the cluster level

About this chart

Cluster Chart : Etcd backup

This helm chart is used to deploy a periodic OpenShift etcd backup CronJob writing snapshots to an S3-compatible object store. It uses the adfinis/openshift-etcd-backup container image and ships Prometheus alerts for missing or failed backups.

This chart is part of the cluster-xxx startx helm chart series that doesn't necessarily deploy pods but rather represent a cluster configuration state orchestrated by gitops tools like ArgoCD.

Requirements and guidelines

Read the startx helm-repository homepage for more information on how to use these resources.

  • An S3-compatible bucket and an access key / secret key pair with write access
  • The backup pods run on a control-plane node with the privileged SCC (granted by the chart)

What the chart renders

ResourceSync wavePurpose
Namespace (via project sub-chart)-10Namespace etcd-backup
ServiceAccount/etcd-backup1Identity for the backup pods
Role/use-privileged-scc1Allow use on the privileged SCC
RoleBinding/etcd-backup-sa-privileged1Bind SA to Role
ConfigMap/backup-config1Non-sensitive S3 settings
Secret/etcd-backup-s31Sensitive S3 access/secret keys
ConfigMap/s3-ca (optional)1Custom CA bundle when useS3Ca: true
CronJob/etcd-backup15The backup job itself
PrometheusRule/etcd-backup-cronjob-monitor30"No recent backup" + "Last job failed" alerts

S3 credentials can either be rendered by the chart (fill etcdBackup.s3_secret.s3_access_key and s3_secret_key) or referenced from an existing secret (set etcdBackup.s3_secret.secretName, with keys OCP_BACKUP_S3_ACCESS_KEY and OCP_BACKUP_S3_SECRET_KEY).

Deploy this helm chart on openshift

1. Connect to your Openshift cluster

oc login -t <token> <cluster-url>

2. Install the repository

helm repo add startx https://helm-repository.readthedocs.io/en/latest/repos/stable/

3. Get information about this chart

helm show chart startx/cluster-etcdbackup

4. Install this chart

Default values

Complete deployment of a project with the following characteristics :

  • 1 namespace: named etcd-backup without constraints
  • 1 serviceAccount: named etcd-backup allowed to use the privileged SCC
  • 1 configMap and 1 secret holding the S3 endpoint, bucket and credentials
  • 1 cronJob: named etcd-backup running every 12 hours (0 */12 * * *) with a retention of 30 days / 10 backups
  • 1 prometheusRule raising an alert when no successful backup happened for 24 hours or when the last job failed
# Create the project
helm install cluster-etcdbackup-project startx/cluster-etcdbackup --set project.enabled=true,etcdBackup.enabled=false
# Deploy the etcd backup CronJob
helm install cluster-etcdbackup-instance startx/cluster-etcdbackup --set project.enabled=false,etcdBackup.enabled=true,etcdBackup.s3_endpoint=https://s3.example.com,etcdBackup.s3_bucket_name=my-bucket,etcdBackup.s3_secret.s3_access_key=XXX,etcdBackup.s3_secret.s3_secret_key=YYY

Other available values

helm install cluster-etcdbackup startx/cluster-etcdbackup -f https://raw.githubusercontent.com/startxfr/helm-repository/master/charts/cluster-etcdbackup/values-startx.yaml

Values files

Example values files shipped with the chart, to use with helm install -f <file> :

  • startx : context startx/default/infra; against values.yaml: differ on 11 keys, by top-level key: project (6), etcdBackup (3), context (2) (see values-startx.yaml)
  • examples/argocd/ : 4 example manifest(s) (see the ArgoCD or usage sections)
helm install cluster-etcdbackup startx/cluster-etcdbackup -f https://raw.githubusercontent.com/startxfr/helm-repository/master/charts/cluster-etcdbackup/values-startx.yaml

Trigger a backup manually

oc -n etcd-backup create job \
  --from=cronjob/etcd-backup etcd-backup-manual-$(date +%s)
oc -n etcd-backup logs -f job/etcd-backup-manual-...

Deploy with ArgoCD

This chart does not deploy any operator, so only two Applications are needed.

AppProject

git clone https://github.com/startxfr/helm-repository.git
cd helm-repository/charts/cluster-etcdbackup/examples/argocd/
oc apply -k .

Applications

ApplicationWaveEnabled flagsDestination
cluster-etcdbackup-project"1"project.enabled: true, etcdBackup.enabled: falseetcd-backup
cluster-etcdbackup-app"10"project.enabled: false, etcdBackup.enabled: trueetcd-backup

The S3 credentials must be provided either through an existing secret (etcdBackup.s3_secret.secretName) or by overriding the values of the cluster-etcdbackup-app Application.

History

ReleaseDateDescription
21.3.32026-06-26Initial release of the etcd backup CronJob chart
21.3.2782026-10-21Align name, icon, metadata, sync-waves and docs to conventions
21.3.3002026-10-21Add new charts and align all to this release
21.3.3092026-10-27Adding new charts perconna and align all to v21.3.309
21.3.3212026-11-05Adding external secret management
21.3.3712026-11-19Add Sail, oauthProxy, DSCInitialization, spot machines and annotations support
21.3.3772026-11-19full repository release: aligned pins, ArgoCD source fix, schemas and docs
21.3.3792026-11-19conventions wave: spelling, READMEs, ArgoCD examples and values-app, oauth switch
21.3.3892026-11-19full repository release: HTTPS dependency URLs, dependency-ordered release, schema guard, docs and examples
21.3.3902026-11-20full repository release: test fix, keepalived README, aligned pins
21.3.3922026-11-21full repository release: chaos-pipeline run parameters and authenticated health check, aligned pins
21.3.3972026-11-21stable repository release 21.3.397: all charts aligned, unifai delegation cap documentation
21.3.3982026-11-21project: dockercfg existingSecret; chaos-pipeline: empty default for scenarios, optional ClusterOperator final check; chaos schemas regenerated
21.3.4102026-11-22full repository release: README conventions (Values files, Deploy with ArgoCD), conventions page
21.3.4122026-11-22full repository release: internal pins on the previous published version (ADR-0006)
21.3.4162026-11-23stable update: chart fixes (project, cluster-mongo, cluster-oadp, cluster-pipeline, cluster-machine, example-catalog); cluster-dvo accepts the grafana keys next to its historical keys, which keep priority
21.3.4182026-11-23commit a stable release of all charts

Deploy cluster-etcdbackup with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has cluster-etcdbackup 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 chartcluster-etcdbackup is pinned at v21.3.418 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