Project: K8up (Runtime / Cloud Native Storage)
File: README.md

][build] ][releases] ][releases] ][license] ](https://bestpractices.coreinfrastructure.org/projects/5388) ](https://api.securityscorecards.dev/projects/github.com/k8up-io/k8up) ](https://artifacthub.io/packages/helm/k8up/k8up) K8up is a Kubernetes backup operator based on that will handle PVC and application backups on a Kubernetes or OpenShift cluster. Just create a `schedule` and a `credentials` object in the namespace youd like to backup. Its that easy. K8up takes care of the rest. It also provides a Prometheus endpoint for monitoring. K8up is production ready. It is used in production deployments since 2019. The documentation is written in AsciiDoc and published with Antora to . It's source is available in the `docs/` directory. Run `make docs-preview` to build the docs and preview changes. K8up is written using . You'll need: A running Kubernetes cluster (minishift, minikube, k3s, ... you name it) Go development environment Your favorite IDE (with a Go plugin) Docker `make` `sed` (or `gsed` for MacOS) To run the end-to-end test (e.g. `make e2e-test`), you additionally need: `helm` (version 3) `jq` `yq` `node` and `npm` `bash` (installed, doesn't have to be your default shell) `base64` `find` These are the most common make targets: `build`, `test`, `docker-build`, `run`, `kind-run`. Run `make help` to get an overview over the relevant targets and their intentions. You can find the project roadmap at . We use to test the code regularly for vulnerabilities and other security issues. If you find any security issue, please follow our process. K8s consists of two main modules: The operator module is the part that runs constantly within K8s and contains the various reconciliation loops. The restic module is our interface to the `restic` binary and is invoked whenever a `Backup` or `Restore` (or similar) custom resource is instantiated. If it's job (like doing a backup or a restore) is done, the process ends. ```asciidoc / api Go Types for the Custom Resource Definitions (CRDs) [o] cmd CLI definition and entrypoints common Code that is not specific to either config Various configuration files for the Operator SDK [o] controllers The reconciliation loops of the operator module [o] docs Out ASCIIdoc code as published on https://k8up.io e2e The Bats-based End-To-End tests envtest Infrastructure code for the integration tests operator Code that is otherwise related to the operator module, but not part of the recommended Operator SDK structure. restic Code that makes up the restic module. ``` If you make changes to the CRD structs you'll need to run code generation. This can be done with make: ```bash make generate ``` CRDs can be either installed on the cluster by running `make install` or using `kubectl apply -f config/crd/apiextensions.k8s.io/v1`. Currently there's an issue using related to how the CRDs are specified. Therefore settle to the second approach for now. You can run the operator in different ways: as a container image (see ) using `make run-operator` (provide your own kubeconfig) using `make kind-run` (uses KIND to install a cluster in docker and provides its own kubeconfig in `testbin/`) using a configuration of your favorite IDE Best is if you have installed somewhere to be able to setup the needed env values. It needs to be reachable from within your dev cluster. You need `node` and `npm` to run the tests, as it runs with

To run e2e tests, execute: ```bash make e2e-test ``` To test just a specific e2e test, run: ```bash make e2e-test -e BATS_FILES=test-02-deployment.bats ``` To remove the local KIND cluster and other e2e resources, run: ```bash make e2e-clean ``` To cleanup all created artifacts, there's always: ```bash make clean ``` There are a number of example configurations in . Apply them using `kubectl apply -f config/samples/somesample.yaml` Read more about our community . The K8up project is present in the in the . We host a monthly community meeting. For more information, head over to . Our code of conduct can be read at . `"128Mi"` | Memory request of K8up operator. See . | | securityContext | object | `{}` | Container security context | | serviceAccount.annotations | object | `{}` | Annotations to add to the service account. | | serviceAccount.create | bool | `true` | Specifies whether a service account should be created | | serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | | tolerations | list | `[]` | | In `image.repository` the registry domain was moved into its own parameter `image.registry`. K8up 1.x features leader election, this enables rolling updates and multiple replicas. `k8up.enableLeaderElection` defaults to `true`. Disable this for older Kubernetes versions (<= 1.15) `replicaCount` is now configurable, defaults to `1`. Note: Deployment strategy type has changed from `Recreate` to `RollingUpdate`. CRDs need to be installed separately, they are no longer included in this chart. Note: `image.repository` changed from `vshn/k8up` to `k8up-io/k8up`. Note: `image.registry` changed from `quay.io` to `ghcr.io`. Note: `image.tag` changed from `v1.x` to `v2.x`. Please see the . `metrics.prometheusRule.legacyRules` has been removed (no support for OpenShift 3.11 anymore). Note: `k8up.backupImage.repository` changed from `quay.io/vshn/wrestic` to `ghcr.io/k8up-io/k8up` (`wrestic` is not needed anymore in K8up v2). Due to the migration of the chart from to this repo, we decided to make a breaking change for the chart. Only chart archives from version 3.x can be downloaded from the https://k8up-io.github.io/k8up index. No 2.x chart releases will be migrated from the APPUiO Helm repo. Some RBAC roles and role bindings have change the name. In most cases this shouldn't be an issue and Helm should be able to cleanup the old resources without impact on the RBAC permissions. New parameter: `podAnnotations`, default `{}`. New parameter: `service.annotations`, default `{}`. Parameter changed: `image.tag` now defaults to `v2` instead of a pinned version. Parameter changed: `image.pullPolicy` now defaults to `Always` instead of `IfNotPresent`. Note: Renamed ClusterRole `${release-name}-manager-role` to `${release-name}-manager`. Note: Spec of ClusterRole `${release-name}-leader-election-role` moved to `${release-name}-manager`. Note: Renamed ClusterRoleBinding `${release-name}-manager-rolebinding` to `${release-name}`. Note: ClusterRoleBinding `${release-name}-leader-election-rolebinding` removed (not needed anymore). Note: Renamed ClusterRole `${release-name}-k8up-view` to `${release-name}-view`. Note: Renamed ClusterRole `${release-name}-k8up-edit` to `${release-name}-edit`. The image tag is now pinned again and not using a floating tag. Parameter changed: `image.tag` now defaults to a pinned version. Each new K8up version now requires also a new chart version. Parameter changed: `image.pullPolicy` now defaults to `IfNotPresent` instead of `Always`. Parameter changed: `k8up.backupImage.repository` is now unset, which defaults to the same image as defined in `image.{registry/repository}`. Parameter changed: `k8up.backupImage.tag` is now unset, which defaults to the same image tag as defined in `image.tag`. <https://github.com/k8up-io/k8up> <! Common/Useful Link references from values.yaml -->