Skip to content

Commit

Permalink
kgo: document KongPluginInstallation (#8034)
Browse files Browse the repository at this point in the history
Co-authored-by: Patryk Małek <[email protected]>
Co-authored-by: lena-larionova <[email protected]>
  • Loading branch information
3 people authored Oct 29, 2024
1 parent 12e5925 commit 9ea265b
Show file tree
Hide file tree
Showing 5 changed files with 408 additions and 47 deletions.
2 changes: 2 additions & 0 deletions app/_data/docs_nav_kgo_1.4.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ items:
url: /guides/upgrade/data-plane/rolling/
- text: Blue / Green Deployment
url: /guides/upgrade/data-plane/blue-green/
- text: Kong Custom Plugin Distribution
url: guides/plugin-distribution/
- title: Reference
icon: /assets/images/icons/icn-magnifying-glass.svg
items:
Expand Down
53 changes: 53 additions & 0 deletions app/_includes/md/custom-plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<!-- Shared between KIC and KGO plugin installation -->
## Create a custom plugin

{:.note}
> For details about plugin development for {{site.base_gateway}}, see the [Plugin Development](/gateway/{{page.release}}/plugin-development) guide.
1. Create a directory with plugin code.

{:.note}
> If you already have a real plugin, you can skip this step.
```bash
mkdir myheader
echo 'local MyHeader = {}
MyHeader.PRIORITY = 1000
MyHeader.VERSION = "1.0.0"
function MyHeader:header_filter(conf)
-- do custom logic here
kong.response.set_header("myheader", conf.header_value)
end
return MyHeader
' > myheader/handler.lua

echo 'return {
name = "myheader",
fields = {
{ config = {
type = "record",
fields = {
{ header_value = { type = "string", default = "roar", }, },
},
}, },
}
}
' > myheader/schema.lua
```

The directory should now look like this:

```bash
tree myheader
```

```bash
myheader
├── handler.lua
└── schema.lua
0 directories, 2 files
```
13 changes: 12 additions & 1 deletion app/_includes/md/kgo/prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<details class="custom" markdown="1">
<summary>
<blockquote class="note">
<p style="cursor: pointer">Before you begin ensure that you have <u>installed the {{site.kgo_product_name}}</u> in your Kubernetes cluster {% if include.aiGateway %}with AI Gateway support enabled{% endif %}. {% if include.enterprise %}This guide requires an enterprise license.{% endif %}</p>
<p style="cursor: pointer">Before you begin, ensure that you have <u>installed the {{site.kgo_product_name}}</u> in your Kubernetes cluster{% if include.aiGateway %} with AI Gateway support enabled{% endif %}{% if include.kongplugininstallation %} with KongPluginInstallation support enabled{% endif %}. {% if include.enterprise %}This guide requires an enterprise license.{% endif %}</p>
</blockquote>
</summary>

Expand Down Expand Up @@ -47,6 +47,17 @@ kubectl set env -n kong-system deployments/kgo-gateway-operator-controller-manag
```
{% endif %}

{%- if include.kongplugininstallation %}

### Enable the KongPluginInstallation controller

As this guide uses the experimental KongPluginInstallation feature, we need to explicitly enable it:

```bash
kubectl set env -n kong-system deployments/kgo-gateway-operator-controller-manager -c manager GATEWAY_OPERATOR_ENABLE_CONTROLLER_KONGPLUGININSTALLATION="true"
```
{% endif %}

{% if include.enterprise %}

### Enterprise License
Expand Down
Loading

0 comments on commit 9ea265b

Please sign in to comment.