Skip to content
forked from k8up-io/k8up

Kubernetes and OpenShift Backup Operator

License

Notifications You must be signed in to change notification settings

modularTaco/k8up

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Go version Kubernetes version Version Maintainability GitHub downloads Docker image License

Overview

K8up is a backup operator that will handle PVC and app backups on a k8s/OpenShift cluster.

Just create a schedule and a credentials 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 currently under heavy development and far from feature complete. But it should already be stable enough for production use.

Documentation

The documentation is published here: https://k8up.io/

Contributing

K8up is an operator written using the Operator SDK.

You'll need:

  • A running kubernetes cluster (minishift, minikube, k3s, ... you name it)
  • kubectl and kustomize
  • Go development environment
  • Your favorite IDE (with a Go plugin)
  • docker
  • make

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.

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 running make install or using kubectl apply -k config/crd/apiextensions.k8s.io/v1.

Currently there's an issue using make 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 docker image (see quickstart)
  2. using make run (provide your own kubeconfig)
  3. using make kind-run (uses KIND to install a cluster in docker and provides its own kubeconfig in testbin/)
  4. using a configuration of your favorite IDE (see below for VSCode example)

Example VSCode run configuration:

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Launch",
      "type": "go",
      "request": "launch",
      "mode": "auto",
      "program": "${workspaceFolder}/main.go",
      "env": {
        "BACKUP_IMAGE": "vshn/wrestic:v0.2.0",
        "BACKUP_GLOBALS3ENDPOINT": "http://somewhere.example.org",
        "BACKUP_GLOBALS3BUCKET": "somebucket",
        "BACKUP_GLOBALSECRETACCESSKEY": "replacewithaccesskey",
        "BACKUP_GLOBALACCESSKEYID": "replacewithkeyid",
        "BACKUP_GLOBALREPOPASSWORD": "somepassword"
      },
      "args": []
    }
  ]
}

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.

Run E2E tests

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/v1beta1 is needed, while K8s 1.22+ only supports apiextensions.k8s.io/v1. You need node and npm to run the tests, as it runs with DETIK.

To run e2e tests run:

make e2e-test

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

To remove the local KIND cluster and other resources, run

make clean

Example configurations

There are a number of example configurations in config/samples. Apply them using kubectl apply -f config/samples/somesample.yaml

About

Kubernetes and OpenShift Backup Operator

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 89.5%
  • Shell 6.7%
  • Makefile 3.6%
  • Dockerfile 0.2%