Skip to content

Commit

Permalink
Merge pull request #3572 from Eileen-Yu/docs/extending-instructions
Browse files Browse the repository at this point in the history
📖 Add notes to distinguish between external plugin and using KB as a library
  • Loading branch information
k8s-ci-robot committed Aug 28, 2023
2 parents 8824c0a + f801a25 commit 230e710
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
22 changes: 22 additions & 0 deletions docs/book/src/plugins/creating-plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,34 @@

[extending-cli]: extending-cli.md
[controller-runtime]: https://github.com/kubernetes-sigs/controller-runtime
[creating-external-plugins]: external-plugins.md
[operator-pattern]: https://kubernetes.io/docs/concepts/extend-kubernetes/operator
[sdk-ansible]: https://sdk.operatorframework.io/docs/building-operators/ansible/
[sdk-cli-pkg]: https://pkg.go.dev/github.com/operator-framework/operator-sdk/internal/cmd/operator-sdk/cli
[sdk-helm]: https://sdk.operatorframework.io/docs/building-operators/helm/
[sdk]: https://github.com/operator-framework/operator-sdk

<aside class="note warning">

<h1>Note</h1>

Extending Kubebuilder can be accomplished in two primary ways:

`By re-using the existing plugins`: In this approach, you use Kubebuilder as a library.

This enables you to import existing Kubebuilder plugins and extend them, leveraging their features to build upon.

It is particularly useful if you want to add functionalities that are closely tied with the existing Kubebuilder features.


`By Creating an External Plugin`: This method allows you to create an independent, standalone plugin as a binary.

The plugin can be written in any language and should implement an execution pattern that Kubebuilder knows how to interact with.

You can see [Creating external plugins][creating-external-plugins] for more info.

</aside>

## Overview

You can extend the Kubebuilder API to create your own plugins. If [extending the CLI][extending-cli], your plugin will be implemented in your project and registered to the CLI as has been done by the [SDK][sdk] project. See its [CLI code][sdk-cli-pkg] as an example.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.12.0
controller-gen.kubebuilder.io/version: v0.13.0
name: busyboxes.example.com.testproject.org
spec:
group: example.com.testproject.org
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.12.0
controller-gen.kubebuilder.io/version: v0.13.0
name: memcacheds.example.com.testproject.org
spec:
group: example.com.testproject.org
Expand Down

0 comments on commit 230e710

Please sign in to comment.