katafygio

command module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2018 License: MIT Imports: 3 Imported by: 0

README

katafygio

Build Status Go Report Card

katafygio discovers Kubernetes objects (deployments, services, ...), and continuously save them as yaml files in a git repository. This provides real time, continuous backups, and keeps detailled changes history.

Usage

katafygio --git-url https://user:token@github.com/myorg/myrepos.git --local-dir /tmp/kfdump

The remote git url is optional: if not specified, katafygio will create a local repository in the target dump directory. katafygio may be used that way to quickly dump a cluster's content.

Filtering out irrelevant objects (esp. ReplicaSets and Pods) with -x and -y will help to keep memory usage low. Same for low value and frequently changing objects, that may bloat the git history.

# Filtering out replicasets and pods since they are managed by Deployments
# (already archived), endpoints (managed by Services), secrets (to keep them
# confidential), events and node (irrelevant), and the leader-elector
# configmap that has low value and changes a lot, causing commits churn.

katafygio \
  -g https://user:token@github.com/myorg/myrepos.git -e /tmp/kfdump \
  -x secret -x pod -x replicaset -x node -x endpoints -x event \
  -y configmap:kube-system/leader-elector

You can also use the docker image.

CLI options

Flags:
  -s, --api-server string            Kubernetes api-server url
  -c, --config string                Configuration file (default "/etc/katafygio/katafygio.yaml")
  -d, --dry-run                      Dry-run mode: don't store anything.
  -x, --exclude-kind stringSlice     Ressource kind to exclude. Eg. 'deployment' (can be specified several times)
  -y, --exclude-object stringSlice   Object to exclude. Eg. 'configmap:kube-system/kube-dns' (can be specified several times)
  -l, --filter string                Label filter. Select only objects matching the label.
  -g, --git-url string               Git repository URL
  -p, --healthcheck-port int         Port for answering healthchecks on /health
  -h, --help                         help for katafygio
  -k, --kube-config string           Kubernetes config path
  -e, --local-dir string             Where to dump yaml files (default "./kubernetes-backup")
  -v, --log-level string             Log level (default "info")
  -o, --log-output string            Log output (default "stderr")
  -r, --log-server string            Log server (if using syslog)
  -i, --resync-interval int          Resync interval in seconds (0 to disable) (default 300)

Build

Assuming you have go 1.10 and glide in the path, and GOPATH configured:

make deps
make build

See Also

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
client
Package client initialize a Kubernete's client-go rest.Config
Package client initialize a Kubernete's client-go rest.Config
health
Package health serves healthchecks over HTTP at /health endpoint.
Package health serves healthchecks over HTTP at /health endpoint.
log
Package log initialize and configure a logrus logger.
Package log initialize and configure a logrus logger.
run
Package run implements the main katafygio's loop, by launching the healthcheck service and all known controllers.
Package run implements the main katafygio's loop, by launching the healthcheck service and all known controllers.
store/git
Package git stores changes a in a git repository
Package git stores changes a in a git repository

Jump to

Keyboard shortcuts

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