Skip to content

Commit

Permalink
Document single binary plugins
Browse files Browse the repository at this point in the history
Signed-off-by: Nolan Brubaker <nolan@heptio.com>
  • Loading branch information
Nolan Brubaker committed Sep 7, 2018
1 parent f049e07 commit cda3dff
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions docs/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

Heptio Ark has a plugin architecture that allows users to add their own custom functionality to Ark backups & restores
without having to modify/recompile the core Ark binary. To add custom functionality, users simply create their own binary
containing an implementation of one of Ark's plugin kinds (described below), plus a small amount of boilerplate code to
expose the plugin implementation to Ark. This binary is added to a container image that serves as an init container for
containing implementations of Ark's plugin kinds (described below), plus a small amount of boilerplate code to
expose the plugin implementations to Ark. This binary is added to a container image that serves as an init container for
the Ark server pod and copies the binary into a shared emptyDir volume for the Ark server to access.

Multiple plugins, of any type, can be implemented in this binary.

A fully-functional [sample plugin repository][1] is provided to serve as a convenient starting point for plugin authors.

## Plugin Kinds
Expand All @@ -17,12 +19,6 @@ Ark currently supports the following kinds of plugins:
- **Backup Item Action** - executes arbitrary logic for individual items prior to storing them in a backup file
- **Restore Item Action** - executes arbitrary logic for individual items prior to restoring them into a cluster

## Plugin Naming

Ark relies on a naming convention to identify plugins. Each plugin binary should be named `ark-<plugin-kind>-<name>`,
where `plugin-kind` is one of `objectstore`, `blockstore`, `backupitemaction`, or `restoreitemaction`, and `name` is
unique within the plugin kind.

## Plugin Logging

Ark provides a [logger][2] that can be used by plugins to log structured information to the main Ark server log or
Expand All @@ -32,4 +28,4 @@ within your plugin.


[1]: https://github.com/heptio/ark-plugin-example
[2]: https://github.com/heptio/ark/blob/master/pkg/plugin/logger.go
[2]: https://github.com/heptio/ark/blob/master/pkg/plugin/logger.go

0 comments on commit cda3dff

Please sign in to comment.