Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Kubernetes and OpenShift Backup Operator

License

NotificationsYou must be signed in to change notification settings

k8up-io/k8up

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BuildGo versionVersionGitHub downloadsLicenseCII Best PracticesOpenSSF ScorecardArtifact Hub

K8up logo

K8up Backup Operator

K8up is a Kubernetes backup operator based onRestic that will handle PVC and application backups on a Kubernetes or OpenShift cluster.

Just create aschedule and acredentials object 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.

K8up is production ready. It is used in production deployments since 2019.

Documentation

The documentation is written in AsciiDoc and published with Antora tok8up.io.It's source is available in thedocs/ directory.

Runmake docs-preview to build the docs and preview changes.

Contributing

K8up is written usingKubebuilder.

You'll need:

  • A running Kubernetes cluster (minishift, minikube, k3s, ... you name it)
  • kubectl
  • Go development environment
  • Your favorite IDE (with a Go plugin)
  • Docker
  • make
  • sed (orgsed for MacOS)

To run the end-to-end test (e.g.make e2e-test), you additionally need:

  • helm (version 3)
  • jq
  • yq (make sure to usemikefarah/yq and notkislyuk/yq)
  • node andnpm
  • 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.Runmake help to get an overview over the relevant targets and their intentions.

You can find the project roadmaphere.

We useSnyk to test the code regularly for vulnerabilities and other security issues.

If you find any security issue, please follow ourVulnerability Reporting process.

Code Structure

K8s consists of two main modules:

  • Theoperator module is the part that runs constantly within K8s and contains the various reconciliation loops.
  • Therestic module is our interface to therestic binary and is invoked whenever aBackup orRestore (or similar) custom resource is instantiated.If it's job (like doing a backup or a restore) is done, the process ends.
/- 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_.[o]: this is part of the recommended Operator SDK structure

Generate Kubernetes code

If you make changes to the CRD structs you'll need to run code generation.This can be done with make:

make generate

Install CRDs

CRDs can be either installed on the cluster by runningmake install or usingkubectl apply -f config/crd/apiextensions.k8s.io/v1.

Currently there's an issue usingmake install related to how the CRDs are specified.Therefore settle to the second approach for now.

Run the operator

You can run the operator in different ways:

  1. as a container image (seequickstart)
  2. usingmake run-operator (provide your own kubeconfig)
  3. usingmake kind-run (uses KIND to install a cluster in docker and provides its own kubeconfig intestbin/)
  4. using a configuration of your favorite IDE

Best is if you haveminio installed somewhere to be able to setup the needed env values. It needs to be reachable from within your dev cluster.

Run E2E tests

You neednode andnpm to run the tests, as it runs withDETIK.

To run e2e tests, execute:

make e2e-test

To test just a specific e2e test, run:

make e2e-test -e BATS_FILES=test-02-deployment.bats

To remove the local KIND cluster and other e2e resources, run:

make e2e-clean

To cleanup all created artifacts, there's always:

make clean

Example configurations

There are a number of example configurations inconfig/samples.Apply them usingkubectl apply -f config/samples/somesample.yaml

Community

Read more about our communityin the documentation.

Chat with us

The K8up project is present in theCNCF Slack Workspace in the#k8up channel.

Monthly community meeting

We host a monthly community meeting. For more information, head over tothe community documentation.

Code of Conduct

Our code of conduct can be read atk8up.io.


[8]ページ先頭

©2009-2025 Movatter.jp