kube-volume-freezer

module
v0.0.0-...-3098c48 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2016 License: MIT

README

kube-volume-freezer

Freeze Pod Volumes in Kubernetes for the purpose of producing a live snapshot.

Build Status Widget GoDoc Widget Coverage Status Widget Code Climate Widget MicroBadger Version Widget MicroBadger Image Widget

Use-Case

  • You want to sync and freeze one or multiple Kubernetes Pod Volumes before creating a live snapshot without adding additional capabilities to your Pods. (GCE-Guide on creating snapshots)

Architecture

  • kvf-minion is run on every Node with required privileges and perform the actual syncing, freezing and thawing of local Volumes on the host.
  • kvf-apiserver delegates client requests to the correct Minion.
  • kvfctl is a command-line interface to the kvf-apiserver.

Install

The folder manifests contains an example deployment of kube-volume-freezer with token protected Minions and API server.

Steps to install:

  • Set your base64 encoded tokens in the kcf-secret.yaml file.
  • Add kvf-secret.yaml, kvf-daemonset.yaml, kvf-deployment.yaml and kvf-svc.yaml to your Kubernetes.

Example

The following example shows how to create a live snapshot from a running system on GCE using kubectl, kvfctl, and gcloud.

#!/bin/bash
# Open a local port to the kube-volume-freezer service.
# This is not needed when running inside a Kubernetes Cluster.
kubectl port-forward kube-volume-freezer-master-1053963144-7uxa2 8080:8080 &
PID=$!

# Freeze Volume named "data" in Pod "gitlab-3323024633-063kf".
kvfctl freeze --address localhost:8080 --token "my-token" gitlab-3323024633-063kf data

# Create snapshot on GCE associated with the Pod.
gcloud compute disks snapshot gitlab-disk --zone europe-west1-b --snapshot-names "gitlab-disk-$(date +"%Y%m%d%H%M%S")"

# Thaw Volume.
kvfctl thaw --address localhost:8080 --token "my-token" gitlab-3323024633-063kf data

# Close local port.
kill -TERM ${PID}

In a more complex example you can use kubectl to detect persistent disks of different deployments automatically and perform live snapshotting simultaneously.

Library

Directories

Path Synopsis
cmd
kvf-apiserver
kvf-api-server starts the API Server.
kvf-api-server starts the API Server.
kvf-minion
kvf-minion starts the Minion API Server.
kvf-minion starts the Minion API Server.
kvfctl
kvfctl is a command line client to the Master API Server.
kvfctl is a command line client to the Master API Server.
pkg
api
Package api contains all high level types of the kube-volume-freezer API.
Package api contains all high level types of the kube-volume-freezer API.
api/errors
Package errors contains all API errors.
Package errors contains all API errors.
api/issues
Package issues contains all issues that can be included in API errors.
Package issues contains all issues that can be included in API errors.
apiserver
Package apiserver contains the implementation of the Master Server.
Package apiserver contains the implementation of the Master Server.
apiserver/controllers
Package controllers contains the REST Controllers of the Master Server.
Package controllers contains the REST Controllers of the Master Server.
apiserver/kubernetes
Package kubernetes contains the code for interfacing with Kubernetes.
Package kubernetes contains the code for interfacing with Kubernetes.
apiserver/kubernetes/k8stest
Package k8stest provides testing utilities for testing the kubernetes package.
Package k8stest provides testing utilities for testing the kubernetes package.
apiserver/volumes
Package volumes contains the business logic of the Volume Resource.
Package volumes contains the business logic of the Volume Resource.
apiserver/volumes/volumestest
Package volumestest provides testing utilities for testing the volumes package.
Package volumestest provides testing utilities for testing the volumes package.
client
Package client implements a client to the kube-volume-freezer Master API.
Package client implements a client to the kube-volume-freezer Master API.
client/clienttest
Package clienttest provides utilities for testing Clients.
Package clienttest provides utilities for testing Clients.
client/generic
Package generic contains the shared Client code of the Minion and Master Client.
Package generic contains the shared Client code of the Minion and Master Client.
log
Package log provides logging for the kube-volume-freezer project.
Package log provides logging for the kube-volume-freezer project.
minion
Package minion contains the implementation of the Minion Server.
Package minion contains the implementation of the Minion Server.
minion/client
Package client implements a client to the kube-volume-freezer Minion API.
Package client implements a client to the kube-volume-freezer Minion API.
minion/client/clienttest
Package clienttest provides utilities for testing the Minion Client.
Package clienttest provides utilities for testing the Minion Client.
minion/controllers
Package controllers contains the REST controllers of the Minion Server.
Package controllers contains the REST controllers of the Minion Server.
minion/fs
Package fs contains the code for interfacing with the file system.
Package fs contains the code for interfacing with the file system.
minion/fs/fstest
Package fstest provides testing utilities for testing the fs package.
Package fstest provides testing utilities for testing the fs package.
minion/volumes
Package volumes contains the business logic of the Volume Resource.
Package volumes contains the business logic of the Volume Resource.
rest
Package rest provides a framework for implementing a REST server.
Package rest provides a framework for implementing a REST server.
rest/resttest
Package resttest provides testing utilities for testing the rest package.
Package resttest provides testing utilities for testing the rest package.
util
Package util implements various utility functions.
Package util implements various utility functions.
util/diff
Package diff provides diff capabilites.
Package diff provides diff capabilites.
util/kubernetes
Package kubernetes contains tools for interfacing with kubernetes.
Package kubernetes contains tools for interfacing with kubernetes.
util/reflect
Package reflect contains reflection tools.
Package reflect contains reflection tools.
util/validation
Package validation contains validation tools.
Package validation contains validation tools.
validation
Package validation provides validation capabilites.
Package validation provides validation capabilites.
version
Package version represents the current version of the project.
Package version represents the current version of the project.
third_party

Jump to

Keyboard shortcuts

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