Skip to content

Commit

Permalink
chore(docs): add instructions on how to upgrade custom plugins to red…
Browse files Browse the repository at this point in the history
…is v2 config

KAG-5009
  • Loading branch information
nowNick committed Sep 3, 2024
1 parent 1b43b51 commit 692f3ab
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions app/_src/gateway/breaking-changes/38x.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,32 @@ chapter: 10
Before upgrading, review any configuration or breaking changes in this version and prior versions that
affect your current installation.

You may need to adopt different [upgrade paths](/gateway/{{page.release}}/upgrade/#guaranteed-upgrade-paths) depending on your
You may need to adopt different [upgrade paths](/gateway/{{page.release}}/upgrade/#guaranteed-upgrade-paths) depending on your
deployment methods, set of features in use, or custom plugins, for example.

Review the [changelog](/gateway/changelog/#3800) for all the changes in this release.

## Breaking changes and deprecations

TBA
### Custom plugins that used shared Redis config

In 3.8.0.0 version we have changed and refactored the shared Redis configuration that previously was imported by `require "kong.enterprise_edition.redis"`. If you have created a custom plugin that is using this shared configuration or if you have a forked version
of a plugin (ex. `rate-limiting-advanced`) then there might be additional steps that would require you to upgrade to version 2 of this Redis config.

Out of the box the custom plugins should still be working since the old shared configuration was left in place. The new config adds `cluster_max_redirections` option for Redis Cluster and the format of `cluster_nodes` and
`sentinel_nodes` has been changed. Apart from that - the intialization step is not required anymore.

Check failure on line 24 in app/_src/gateway/breaking-changes/38x.md

View workflow job for this annotation

GitHub Actions / Vale

[vale] reported by reviewdog 🐶 [kong.Spelling] Did you really mean 'intialization'? Raw Output: {"message": "[kong.Spelling] Did you really mean 'intialization'?", "location": {"path": "app/_src/gateway/breaking-changes/38x.md", "range": {"start": {"line": 24, "column": 58}}}, "severity": "ERROR"}

#### Shared Redis Config: How to upgrade custom plugins

If your plugin is using shared Redis config - i.e. you import: `require "kong.enterprise_edition.redis"` you should do the following steps:

1. Remove library intialization call: `redis.init_conf(conf)` - where `redis` is `local redis = require "kong.enterprise_edition.redis"`

Check failure on line 30 in app/_src/gateway/breaking-changes/38x.md

View workflow job for this annotation

GitHub Actions / Vale

[vale] reported by reviewdog 🐶 [kong.Spelling] Did you really mean 'intialization'? Raw Output: {"message": "[kong.Spelling] Did you really mean 'intialization'?", "location": {"path": "app/_src/gateway/breaking-changes/38x.md", "range": {"start": {"line": 30, "column": 19}}}, "severity": "ERROR"}
2. Switch the imports of redis from `local redis = require "kong.enterprise_edition.redis"` to `local redis = require "kong.enterprise_edition.tools.redis.v2"`

#### Rate-Limiting library: How to upgrade custom plugins

If your plugin is using Rate-Limiting library - i.e. you import `local ratelimiting = require("kong.tools.public.rate-limiting").new_instance("your-plugin-name")` you should do the following steps:

1. Switch the imports of:
1. Shared Redis config: `local redis = require "kong.enterprise_edition.redis"` to `local redis = require "kong.enterprise_edition.tools.redis.v2"`
2. Rate-Limiting library: `local ratelimiting = require("kong.tools.public.rate-limiting").new_instance("your-plugin-name")` to `local ratelimiting = require("kong.tools.public.rate-limiting").new_instance("your-plugin-name", { redis_config_version = "v2" })`

0 comments on commit 692f3ab

Please sign in to comment.