Download presentation
Presentation is loading. Please wait.
Published byΔιόσκουροι Γιαννόπουλος Modified over 6 years ago
1
Enhancing Cloud Foundry with CLI Plugins
Jonathan Berkhahn, Simon Leung, IBM @_simonleung
2
What are Cloud Foundry CLI Plugins?
An extensible framework to add novel functionality and value to the Cloud Foundry Command Line Interface Allow CF users, developers, admins to add new commands Arbitrary functionality; interact with CF or infrastructure on top Plugin framework for interaction between plugin and CLI Golang Binary Implements the CLI plugin interface Documentation and examples available at github.com/cloudfoundry/cli/plugin_examples
3
What can CLI Plugins be used for?
Users interacting with apps Managing app deployment, i.e. blue-green deploy Interacting with apps directly Admins interacting with CF deployments Updating configuration of CF resources Developers testing new CF features Testbed for up and coming new features Development tools for ease of use
4
Plugin Use Case: CF Stack-Changer
Lucid version of Ubuntu being sunset Many container backends running on CF use Lucid Every running app on a Cloud Foundry needs to be switched Without Plugins Switch every app manually Writing a script isn’t much better Heavy-duty scripting to hit all the apps under all the orgs on an entire Cloud Foundry Script has to be distributed to multiple possible environments
5
CF Stack-Changer
6
Plugin Use Case: V3_Beta
Version 3 of the CF API being rolled out experimentally New endpoints, abstractions for pushing, listing apps Volatile API as development continues 3 Without Plugins Write curl requests manually Hard to keep up with evolving API
7
V3_Beta Easier than manually writing curl requests
Easier to distribute than scripts Easy to update the plugin when the API changes
8
Distributing CLI Plugins
9
How would users discover and install my plugins?
Distributing? How would users discover and install my plugins?
10
Problem: Hassle to download Discovering the plugin
Binary file Problem: Hassle to download Discovering the plugin > cf install-plugin <PLUGIN_BINARY>
11
Problem: Discovering the plugin
From URL Problem: Discovering the plugin > cf install-plugin <URL_TO_PLUGIN>
12
Plugin Repository Find and install plugins with only 2 commands!
cf repo-plugins cf install-plugin
13
What is a plugin repository?
A server that CLI interact with to browse and install plugins Multiple repos can be tracked.
14
2 repositories being tracked by CLI
15
What is a plugin repository?
A server that CLI interact with to browse and install plugins Multiple repos can be tracked. Anyone can host a plugin repo.
16
Clone and start hosting your own repository
17
Run repo and add URL to CLI
18
What is a plugin repository?
A server the CLI interact with to browse and install plugins Multiple repos can be tracked. Anyone can host a plugin repo. Users find/install plugin without leaving CLI
19
Install plugin directly from repository
20
Bonus: Creating a plugin
21
Plugin Minimum Implementation
GetMetadata() Meta data for all commands in the plugin Run() Entry point for plugin main function main() bootstrapping the plugin object `plugin.Start(OBJECT)` Show code
22
Run() GetMetadata() Main()
29
Questions?
30
Plugin Examples
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.