Skip to content

Commit

Permalink
chore: make docs
Browse files Browse the repository at this point in the history
  • Loading branch information
programmer04 committed Oct 10, 2024
1 parent 14a926d commit b7e5120
Show file tree
Hide file tree
Showing 4 changed files with 317 additions and 96 deletions.
50 changes: 50 additions & 0 deletions app/_includes/md/custom-plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<!-- Shared between KIC and KGO plugin installation -->
## Create a custom plugin

1. Create a directory with test 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
```

After your plugin code available in a directory, the directory should 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 b7e5120

Please sign in to comment.