Skip to content

Commit 859e51f

Browse files
Feat: Custom plugin streaming (#8556)
* custom plugin streaming doc * vale * add beta label * adjust requirements * Apply suggestions from code review Co-authored-by: Diana <[email protected]> * add one line about the UI * typo * remove beta flag --------- Co-authored-by: Diana <[email protected]>
1 parent b1a5db2 commit 859e51f

File tree

5 files changed

+67
-3
lines changed

5 files changed

+67
-3
lines changed

app/_data/docs_nav_konnect.yml

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
url: /gateway-manager/dedicated-cloud-gateways/azure-peering
6161
- text: Custom Domains
6262
url: /gateway-manager/dedicated-cloud-gateways/custom-dns/
63+
- text: Custom Plugins
64+
url: /gateway-manager/dedicated-cloud-gateways/custom-plugins/
6365
- text: Data plane logs
6466
url: /gateway-manager/dedicated-cloud-gateways/data-plane-logs
6567
- text: Serverless Gateways
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Custom plugins in Dedicated Cloud Gateways
3+
content_type: reference
4+
---
5+
6+
With Dedicated Cloud Gateways, {{site.konnect_short_name}} can stream custom plugins from the control plane to the data plane.
7+
8+
This means that the control plane becomes a single source of truth for plugin versions. You only need to upload a plugin once, to the control plane, and {{site.konnect_short_name}} handles distributing the plugin code to all data planes in that control plane.
9+
10+
Compared to the manual process required in a regular hybrid {{site.konnect_short_name}} deployment, custom plugin streaming in Dedicated Cloud Gateways provides the following benefits:
11+
* Faster custom plugin distribution
12+
* Minimal manual maintenance
13+
* The control plane is the single source of truth
14+
15+
## Prerequisites
16+
17+
* Your [custom plugin](/gateway/latest/plugin-development/) meets the following requirements:
18+
* Each custom plugin must have a unique name.
19+
* Each custom plugin can have a maximum of 1 `handler.lua` file and 1 `schema.lua` file.
20+
* The plugin can't execute in the `init_worker` phase and can't set any timers.
21+
* The plugin must be written in Lua. No other languages are supported.
22+
* You have a [personal access token or system access token](/konnect/org-management/access-tokens) for the {{site.konnect_short_name}} API
23+
24+
## Adding a custom plugin to a Dedicated Cloud Gateway deployment
25+
26+
Upload custom plugin schema and handler files to create a configurable entity in {{site.konnect_short_name}}.
27+
If you prefer using the {{site.konnect_short_name}} UI, you can also upload these files through the Plugins menu in [Gateway Manager](https://cloud.konghq.com/gateway-manager/).
28+
29+
{:.important}
30+
> The name you give the plugin must be identical to the name of the plugin in the schema file.
31+
32+
Using the following command, make a `POST` request to the [`/custom-plugins`](/konnect/api/control-plane-configuration/latest/#/operations/list-custom-plugin) endpoint of the {{site.konnect_short_name}} Control Plane Config API:
33+
34+
```sh
35+
curl -X POST https://{region}.api.konghq.com/v2/control-planes/{control-plane-id}/core-entities/custom-plugins \
36+
-H "Content-Type: application/json" \
37+
-H "Authorization: Bearer {your-access-token}" \
38+
-d "$(jq -n \
39+
--arg handler "$(cat handler.lua)" \
40+
--arg schema "$(cat schema.lua)" \
41+
'{"handler":$handler,"name":"streaming-headers","schema":$schema}')" \
42+
| jq
43+
```
44+
45+
This request returns an `HTTP 200` response with the schema and handler for your plugin as a JSON object.
46+
47+
Once a custom plugin is uploaded to a Dedicated Cloud Gateway control plane, it can be managed like any other plugin, using any of the following tools:
48+
* [decK](/konnect/gateway-manager/declarative-config/)
49+
* [{{site.konnect_short_name}} Control Plane Config API](/konnect/api/control-plane-configuration/latest/#/operations/list-custom-plugin)
50+
* [{{site.konnect_short_name}} UI](https://cloud.konghq.com/)
51+
52+
## More information
53+
54+
* [Custom plugin schema endpoints (Control Plane Config API)](/konnect/api/control-plane-configuration/latest/#/Custom%20Plugin%20Schemas)
55+
* [Custom plugin template](https://github.com/Kong/kong-plugin)
56+
* [Plugin development guide](/gateway/latest/plugin-development/)
57+
* [PDK reference](/gateway/latest/plugin-development/pdk/)

app/konnect/gateway-manager/dedicated-cloud-gateways/index.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,6 @@ This includes [Data Plane Resilience](/gateway/latest/kong-enterprise/cp-outage-
6060
* [Data Plane logs](/konnect/gateway-manager/dedicated-cloud-gateways/)
6161
* [Transit Gateways](/konnect/gateway-manager/dedicated-cloud-gateways/transit-gateways/)
6262
* [How to upgrade data planes](/konnect/gateway-manager/data-plane-nodes/upgrade/)
63-
* [Custom Domains](/konnect/gateway-manager/dedicated-cloud-gateways/custom-dns/)
63+
* [Custom domains](/konnect/gateway-manager/dedicated-cloud-gateways/custom-dns/)
64+
* [Custom plugins](/konnect/gateway-manager/dedicated-cloud-gateways/custom-plugins/)
6465
* [Cloud Gateways API](/konnect/api/cloud-gateways/latest/)

app/konnect/gateway-manager/plugins/add-custom-plugin.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ See [Editing or deleting a custom plugin's schema](/konnect/gateway-manager/plug
1717
for more information.
1818

1919
{:.note}
20-
> **Note**: Custom plugins are not supported in Dedicated Cloud Gateways.
20+
> **Note**: For adding custom plugins to a Dedicated Cloud Gateway, see
21+
[Custom plugins in Dedicated Cloud Gateways](/konnect/gateway-manager/dedicated-cloud-gateways/custom-plugins/).
2122

2223
## Prerequisites
2324

@@ -186,6 +187,7 @@ or {{site.base_gateway}} deployments.
186187
## More information
187188

188189
* [Edit or delete custom plugins in {{site.konnect_short_name}}](/konnect/gateway-manager/plugins/update-custom-plugin/)
190+
* [Custom plugins in Dedicated Cloud Gateways](/konnect/gateway-manager/dedicated-cloud-gateways/custom-plugins/)
189191
* [Custom plugin schema endpoints (Control Plane Config API)](/konnect/api/control-plane-configuration/latest/#/Custom%20Plugin%20Schemas)
190192
* [Custom plugin template](https://github.com/Kong/kong-plugin)
191193
* [Plugin development guide](/gateway/latest/plugin-development/)

app/konnect/gateway-manager/plugins/index.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ can access via the Konnect UI or the custom plugins API. This means that {{site.
4040
only sees a custom plugin's configuration options, and does not see any other data.
4141

4242
{:.note}
43-
> **Note**: Custom plugins are not supported in Dedicated Cloud Gateways.
43+
> **Note**: For adding custom plugins to a Dedicated Cloud Gateway, see
44+
[Custom plugins in Dedicated Cloud Gateways](/konnect/gateway-manager/dedicated-cloud-gateways/custom-plugins/).
4445

4546
To run in {{site.konnect_short_name}}, every custom plugin must meet the following requirements:
4647

@@ -87,6 +88,7 @@ for the full list, as well as a breakdown of the pricing tiers that each plugin
8788
### Custom plugins
8889
* [Add a custom plugin in {{site.konnect_short_name}}](/konnect/gateway-manager/plugins/add-custom-plugin/)
8990
* [Edit or delete custom plugins in {{site.konnect_short_name}}](/konnect/gateway-manager/plugins/update-custom-plugin/)
91+
* [Custom plugins in Dedicated Cloud Gateways](/konnect/gateway-manager/dedicated-cloud-gateways/custom-plugins/)
9092
* [Custom plugin schema endpoints (Control Plane Config API)](/konnect/api/control-plane-configuration/latest/#/Custom%20Plugin%20Schemas)
9193
* [Custom plugin template](https://github.com/Kong/kong-plugin)
9294
* [Plugin development guide](/gateway/latest/plugin-development/)

0 commit comments

Comments
 (0)