Skip to content
This repository was archived by the owner on Nov 18, 2020. It is now read-only.

Robust Plugin Bootstrap Process #6

Open
frankgreco opened this issue Nov 21, 2017 · 0 comments
Open

Robust Plugin Bootstrap Process #6

frankgreco opened this issue Nov 21, 2017 · 0 comments

Comments

@frankgreco
Copy link
Contributor

Current Problem

Currently, there is no good way to load a plugin. A good example of this is the apiKey plugin that is shipped with Kanali. The following lines are from Kanali's Dockerfile.

RUN curl -O https://raw.githubusercontent.com/northwesternmutual/kanali-plugin-apikey/v1.2.0/plugin.go
RUN GOOS=`go env GOHOSTOS` GOARCH=`go env GOHOSTARCH` go build -buildmode=plugin -o apiKey_v1.2.0.so plugin.go

If this approach were taken for every plugin, a new Kanali image would be needed for each new plugin version. This is not ideal.

Proposed Solution

kanalictl follows the following pattern for its commands:

kanalictl [noun] [verb]

We can add a new noun, plugin and a new verb, load an example of this could be:

kanalictl plugin load --requirements=./plugins.yaml --location=/kanali/plugins

...and an example of a requirements file format:

---
plugins:
- name: apiKey
  version: v1.2.0
  location: github.com/northwesternmutual/kanali-plugin-apikey

kanali will load compiled plugins form a configurable location. Hence, this new command would do the following:

  1. clone each repo as specified by each plugin in this plugins list
  2. checkout the specified version
  3. compile plugin -buildmode=plugin -o <name>_<version>.so
  4. place .so file in specified --location

This solution solves the stated problem because:

  1. plugin bootstrap is abstracted from the kanali image...and from any image
  2. we can use a Kubernetes init container to bootstrap the plugins before the Kanali pod starts.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant