online-archivist

command module
v0.0.0-...-20c57e2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

README

OpenShift Online Archivist

The Archivist is an application for monitoring the capacity of an OpenShift cluster, and archiving dormant or least active projects. It requires a running instance of Heptio Ark which performs the actual archival/unarchival for a specific namespace. (including all cluster resources, and PV snapshots) Ansible roles are included for deploying both applications in tandem.

Current Status

A cluster monitoring loop is implemented in the Archivist and is successfully submitting requests to archive dormant projects to Ark.

In future we expect to reserve namespaces for a given user

A cluster monitoring loop is implemented, as well as a good start on exporting and importing cluster objects.

S3 upload, unarchival, and the archival reconcile loop are still pending.

Unarchival will initially only support unarchiving to the same cluster and namespace. Provisions will be made to reserve project names while a project is archived. Eventually we do aim to be able to unarchive to another cluster and/or namespace.

Development

Prerequisites

Install golang 1.7 and check this project out in the standard GOPATH. (i.e. ~/go/src/github.com/openshift/online-archivist)

Adding $GOPATH/bin to your $PATH is recommended.

Compile and Run Locally

This method will run the archivist as whatever oc user is currently logged in. This works particularly well with things like minishift, and oc cluster up. In both cases you will want to be logged in as system:admin.

oc cluster up
oc login system:admin

Compile and run:

make build

# Run the cluster monitor component:
$ archivist monitor --config devel.cfg

Running Tests

Unit tests:

$ make test

Integration tests (launches an OpenShift master and etcd internally to work against):

$ make test-integration

Deploy To an OpenShift Cluster

TODO: An ansible role is in progress that should allow deploying to any OpenShift cluster. This role will build the application from this git repository using OpenShift itself.

Ansible is provided to deploy both the Archivist by building from git source, as well as Ark.

  1. Validate settings in ansible/vars/
  2. Create an Ansible inventory matching the standard openshift-ansible format. (as created for online team devenvs with aws-launcher, etc)
  3. ansible-playbook -i hosts ansible/archivist.yml

Manual Unarchival

Until we have API calls to unarchive you can manually initiate one:

  1. 'exec' into the running ark pod (in heptio-ark namespace)
  2. Lookup the backup for username you want to unarchive: /ark backup get -l "openshift.io/requester=username"
  3. Trigger an Ark restore: /ark restore create [backupname]

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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