k8up

module
v0.1.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2020 License: BSD-3-Clause

README

Build status

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 docs are WIP: https://vshn.github.io/k8up/

Dev Environment

You'll need:

  • Minishift or Minikube
  • golang installed :) (everything is tested with 1.11.3)
  • dep installed
  • Your favorite IDE (with a golang plugin)
  • docker
  • make

Generate kubernetes code

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

cd /project/root
make generate

This creates the client folder and deepcopy functions for the structs. This needs to be run on a local docker instance so it can mount the code to the container.

Run the operator in dev mode

cd /to/go/project
minishift start
oc login -u system:admin # default developer account doesn't have the rights to create a crd
#The operator has the be run at least once before to create the CRD
go run cmd/operator/*.go -development
#Add a demo backupworker (adjust the variables to your liking first)
kubectl apply -f manifest-examples/k8up.yaml
#Add a demo PVC if necessary
kubectl apply -f manifest-examples/pvc.yaml

Build and push the Restic container

The container has to exist on the registry in order for the operator to find the correct one.

minishift start
oc login -u developer
docker build -t $(minishift openshift registry)/myproject/k8up:0.0.1 .
docker save $(minishift openshift registry)/myproject/k8up:0.0.1 > tmp.tar
eval $(minishift docker-env)
docker load -i tmp.tar
rm tmp.tar
docker login -u developer -p $(oc whoami -t) $(minishift openshift registry)
docker push $(minishift openshift registry)/myproject/k8up:0.0.1

Docker tags

(AMD64/x86 arch only)

  • latest: master branch
  • dev: dev branch (useful for pre-releases)
  • versioned: tagged git releases

Directories

Path Synopsis
apis
backup/v1alpha1
Package v1alpha1 is the v1alpha1 version of the API.
Package v1alpha1 is the v1alpha1 version of the API.
client
k8s/clientset/versioned
This package has the automatically generated clientset.
This package has the automatically generated clientset.
k8s/clientset/versioned/fake
This package has the automatically generated fake clientset.
This package has the automatically generated fake clientset.
k8s/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
This package contains the scheme of the automatically generated clientset.
k8s/clientset/versioned/typed/backup/v1alpha1
This package has the automatically generated typed clients.
This package has the automatically generated typed clients.
k8s/clientset/versioned/typed/backup/v1alpha1/fake
Package fake has the automatically generated clients.
Package fake has the automatically generated clients.
cmd
operator command
observe
Package observe contains a very special "operator".
Package observe contains a very special "operator".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL