-
Notifications
You must be signed in to change notification settings - Fork 208
docs: add 'Contributing to plugins' guide #6398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mohammedfirdouss
wants to merge
15
commits into
pipe-cd:master
Choose a base branch
from
mohammedfirdouss:docs/contribute-plugins-guide
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+138
−0
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
1eb4e1b
ADD contributing-plugins guide to documentation
mohammedfirdouss 63b2ef5
Merge branch 'master' into docs/contribute-plugins-guide
mohammedfirdouss c94b58b
Merge branch 'master' into docs/contribute-plugins-guide
mohammedfirdouss 4e6bc95
Merge branch 'master' into docs/contribute-plugins-guide
mohammedfirdouss 1b9491d
docs: enhance contributing plugins guide with plugin architecture det…
mohammedfirdouss 91870e8
docs: clarify section titles for contributing official and community …
mohammedfirdouss 7b1bfea
Merge branch 'master' into docs/contribute-plugins-guide
mohammedfirdouss 71276ca
docs: update concepts documentation
mohammedfirdouss 343e397
docs: remove outdated contributing plugins guide
mohammedfirdouss a5828ea
docs: enhance contributing plugins guide with new plugin examples
mohammedfirdouss d621d7f
docs: update contributing plugins guide with configuration examples a…
mohammedfirdouss afce56c
Merge branch 'master' into docs/contribute-plugins-guide
mohammedfirdouss f660c5a
Merge branch 'master' into docs/contribute-plugins-guide
mohammedfirdouss 5ce6539
Update docs/content/en/docs-v1.0.x/contribution-guidelines/contributi…
eeshaanSA 05abe98
Update docs/content/en/docs-v1.0.x/contribution-guidelines/contributi…
eeshaanSA File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
138 changes: 138 additions & 0 deletions
138
docs/content/en/docs-v1.0.x/contribution-guidelines/contributing-plugins.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,138 @@ | ||
| --- | ||
| title: "Contributing to plugins" | ||
| linkTitle: "Contributing to plugins" | ||
| weight: 4 | ||
| description: > | ||
| This page describes how to contribute plugins for piped. | ||
| --- | ||
|
|
||
| PipeCD's plugin architecture allows anyone to extend piped's capabilities by creating custom plugins. This guide explains how to develop and contribute plugins. | ||
|
|
||
| ## Understanding the plugin architecture | ||
|
|
||
| In PipeCD v1, plugins are the actors that execute deployments on behalf of piped. Instead of piped directly deploying to platforms, plugins handle platform-specific logic while piped's core controls deployment flows. | ||
|
|
||
| **Key concepts:** | ||
|
|
||
| - **Plugins** run as gRPC servers, launched and managed by piped | ||
| - **Deploy targets** define where a plugin deploys (e.g., a Kubernetes cluster) | ||
| - Plugins can be **official** (maintained by PipeCD team) or **community-contributed** | ||
|
|
||
| For a detailed overview, see the [Plugin Architecture blog post](https://pipecd.dev/blog/2024/11/28/overview-of-the-plan-for-pluginnable-pipecd/). | ||
|
|
||
| ## Plugin types | ||
|
|
||
| Plugins can implement one or more of these interfaces: | ||
|
|
||
| | Interface | Purpose | | ||
| |-----------|---------| | ||
| | **Deployment** | Plan and execute deployment stages | | ||
| | **LiveState** | Fetch and build the state of live resources | | ||
| | **Drift** | Calculate drift between live and git-source manifests | | ||
|
|
||
| For example: | ||
| - A Kubernetes plugin implements all three interfaces | ||
| - A Wait stage plugin only implements the Deployment interface | ||
|
|
||
| ## Where plugins live | ||
|
|
||
| - **Official plugins**: Located in `/pkg/app/pipedv1/plugin/` in the [pipecd repository](https://github.com/pipe-cd/pipecd) | ||
| - **Community plugins**: Located in the [pipe-cd/community-plugins](https://github.com/pipe-cd/community-plugins) repository | ||
|
|
||
| ## Getting started | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| - [Go 1.24 or later](https://go.dev/) | ||
| - Understanding of gRPC | ||
| - Familiarity with the platform you're building a plugin for | ||
|
|
||
| ### Study existing plugins | ||
|
|
||
| Before creating a new plugin, study the existing ones: | ||
|
|
||
| | Plugin | Complexity | Good for learning | | ||
| |--------|------------|-------------------| | ||
| | [wait](https://github.com/pipe-cd/pipecd/tree/master/pkg/app/pipedv1/plugin/wait) | Simple | Basic plugin structure | | ||
| | [waitapproval](https://github.com/pipe-cd/pipecd/tree/master/pkg/app/pipedv1/plugin/waitapproval) | Simple | Stage-only plugin | | ||
| | [kubernetes](https://github.com/pipe-cd/pipecd/tree/master/pkg/app/pipedv1/plugin/kubernetes) | Complex | Full-featured plugin | | ||
| | [terraform](https://github.com/pipe-cd/pipecd/tree/master/pkg/app/pipedv1/plugin/terraform) | Complex | Infrastructure as Code plugin | | ||
|
|
||
| Community plugins: | ||
|
|
||
| | Plugin | Description | | ||
| |--------|-------------| | ||
| | [opentofu](https://github.com/pipe-cd/community-plugins/tree/main/plugins/opentofu) | OpenTofu deployment plugin | | ||
|
|
||
| ### Plugin structure | ||
|
|
||
| A minimal plugin needs: | ||
|
|
||
| ``` | ||
| your-plugin/ | ||
| ├── go.mod | ||
| ├── go.sum | ||
| ├── main.go # Entry point, starts gRPC server | ||
| ├── plugin.go # Implements plugin interfaces | ||
| ├── config/ # Plugin-specific configuration | ||
| │ └── application.go | ||
| └── README.md # Documentation | ||
| ``` | ||
|
|
||
| ### Plugin configuration | ||
|
|
||
| Plugins are configured in the piped config. See the [piped installation guide](/docs-v1.0.x/installation/install-piped/) for configuration examples: | ||
|
|
||
| ```yaml | ||
| apiVersion: pipecd.dev/v1beta1 | ||
| kind: Piped | ||
| spec: | ||
| plugins: | ||
| - name: your-plugin | ||
| port: 7001 # Any unused port | ||
| url: <PLUGIN_URL> | ||
| deployTargets: # Optional, depends on plugin | ||
| - name: target1 | ||
| config: | ||
| # Plugin-specific config | ||
| ``` | ||
|
|
||
| ## Contributing to official plugins | ||
|
|
||
| 1. **Open an issue** first to discuss your plugin idea with maintainers | ||
| 2. **Fork and clone** the [pipecd repository](https://github.com/pipe-cd/pipecd) | ||
| 3. **Create your plugin** under `/pkg/app/pipedv1/plugin/your-plugin/` | ||
| 4. **Write tests** — see existing plugins for patterns | ||
| 5. **Add a README** documenting configuration and usage | ||
| 6. **Submit a PR** linking to the discussion issue | ||
|
|
||
| ### Build and test | ||
|
|
||
| ```bash | ||
| # Build all plugins | ||
| make build/plugin | ||
|
|
||
| # Run tests | ||
| make test/go | ||
|
|
||
| # Run piped locally with your plugin | ||
| make run/piped CONFIG_FILE=piped-config.yaml EXPERIMENTAL=true INSECURE=true | ||
| ``` | ||
|
|
||
| ## Contributing to community plugins | ||
|
|
||
| The [community-plugins repository](https://github.com/pipe-cd/community-plugins) welcomes plugins that may not fit in the official repo. | ||
|
|
||
| 1. **Fork** the community-plugins repository | ||
| 2. **Create your plugin** following the structure above | ||
| 3. **Submit a PR** with documentation | ||
|
|
||
| ## Resources | ||
mohammedfirdouss marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - [Plugin Architecture RFC](https://github.com/pipe-cd/pipecd/blob/master/docs/rfcs/0015-pipecd-plugin-arch-meta.md) | ||
| - [Plugin Concepts](/docs-v1.0.x/concepts/#plugins) | ||
| - [Installing piped](/docs-v1.0.x/installation/install-piped/) | ||
| - [Plugin Alpha Release blog](https://pipecd.dev/blog/2025/06/16/plugin-architecture-piped-alpha-version-has-been-released/) | ||
| - [#pipecd Slack channel](https://cloud-native.slack.com/) for questions | ||
|
|
||
| Thank you for contributing to PipeCD plugins! | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.