Kubernetes and OpenShift Backup Operator
K8up is a Kubernetes backup operator based on Restic that will handle PVC and application backups on a Kubernetes or OpenShift cluster.
Just create a
credentialsobject in the namespace you’d like to backup. It’s that easy. K8up takes care of the rest. It also provides a Prometheus endpoint for monitoring.
The documentation is written in AsciiDoc and published with Antora to k8up.io. It's source is available in the
K8up is written using the Operator SDK.
To run the end-to-end test (e.g.
make e2e-test), you additionally need:
bash(installed, doesn't have to be your default shell)
These are the most common make targets:
make helpto get an overview over the relevant targets and their intentions.
If you make changes to the CRD structs you'll need to run code generation. This can be done with make:
CRDs can be either installed on the cluster by running
make installor using
kubectl apply -k config/crd/apiextensions.k8s.io/v1.
You can run the operator in different ways:
make run(provide your own kubeconfig)
make kind-run(uses KIND to install a cluster in docker and provides its own kubeconfig in
Best is if you have minio installed somewhere to be able to setup the needed env values. It needs to be reachable from within your dev cluster.
K8up supports both OpenShift 3.11 clusters and newer Kubernetes clusters 1.16+. However, to support OpenShift 3.11 a legacy CRD definition with
apiextensions.k8s.io/v1beta1is needed, while K8s 1.22+ only supports
apiextensions.k8s.io/v1. You need
npmto run the tests, as it runs with DETIK.
To run e2e tests, execute:
To test compatibility of k8up with OpenShift 3.11 (or any other specific K8s version), you can run end-to-end tests like this:
make e2e-test -e CRD_SPEC_VERSION=v1beta1 -e KIND_NODE_VERSION=v1.13.12 -e KIND_KUBECTL_ARGS=--validate=false -e BACKUP_ENABLE_LEADER_ELECTION=false
To test just a specific e2e test, run:
make e2e-test -e BATS_FILES=test-00-deployment.bats
To remove the local KIND cluster and other e2e resources, run:
To cleanup all created artifacts, there's always:
kubectl apply -f config/samples/somesample.yaml