openshift/online-archivist

Name: online-archivist

Owner: OpenShift

Description: null

Created: 2017-08-03 12:45:45.0

Updated: 2018-03-19 10:53:10.0

Pushed: 2018-01-12 21:27:41.0

Homepage: null

Size: 57951

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

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.

luster up
ogin system:admin

Compile and run:

 build

n the cluster monitor component:
chivist monitor --config devel.cfg
Running Tests

Unit tests:

ke test

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

ke 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]

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.