Related Documentation
OpenAPI Specifications
Minimum Version
Kong Gateway - 3.10
Tags
Related Resources

What is a Partial?

Partials allow you to reuse shared Redis configurations across plugins.

Some plugins in Kong Gateway share common Redis configuration settings that often need to be repeated. Partials allow you to extract those shared configurations into reusable entities that can be linked to multiple plugins. Without Partials, you would need to replicate this configuration across all plugins. If the settings change, you would need to update each plugin individually.

To ensure validation and consistency, Partials have defined types. Kong Gateway supports the following types of Partials; each plugin supports only one type:

  • redis-ce: A short and simple configuration.
  • redis-ee: A configuration with support for Redis Sentinel or Redis Cluster connections.

Any plugin that supports Redis configuration can reference those settings using Partial entities, enabling shared configuration across plugin instances.

In Konnect, Partials are only supported for bundled Konnect plugins. Custom plugins don’t support Partials.

Schema

Set up a Partial

Use Partials

By defining a Redis Partial once and then referencing it across these plugins, you avoid repeating connection details, reduce configuration errors, and ensure consistent Redis behaviour throughout your gateway. The following plugins use Redis for storing counters, sessions, or cached data:

Plugin Name

Redis Usage (What’s Stored)

Partial type

Benefit of using a Partial

ACME Certificate state (Let’s Encrypt ACME data) redis-ce Keep certificate state storage consistent across environments by reusing one Redis config.
GraphQL Proxy Caching Advanced Cached GraphQL responses redis-ee Apply the same Redis configuration to multiple GraphQL caches for easier management.
GraphQL Rate Limiting Advanced GraphQL request counters redis-ee Standardise Redis-based GraphQL rate limiting across endpoints with one Partial.
OpenID Connect Sessions and tokens redis-ee Reuse Redis settings for session storage, avoiding redundant configs across identity flows.
Proxy Caching Advanced Cached API responses redis-ee Reuse a single Redis definition to simplify and stabilise cache behaviour.
Rate Limiting Request counters redis-ce Apply the same Redis setup across multiple rate limiting policies without duplication.
Rate Limiting Advanced Request counters (supports Sentinel/Cluster) redis-ee Centralize complex Redis HA configuration so all services use it reliably.
Response Rate Limiting Response counters redis-ce Ensure consistent Redis-backed throttling rules across different services.
SAML Session data redis-ee Centralize session handling so all SAML flows share the same Redis configuration.

The following examples describe how to use Partials with plugins.

Add a Partial to a plugin

To use a Partial in a plugin, configure the partials.id parameter:

Remove a Partial from a plugin

To remove a Partial, remove the partials parameter. Make sure to configure the corresponding elements directly in your plugin configuration:

Check Partial usage

To see which plugins use a specific Partial:

  1. Use GET /partials/ to get the list of Partials, and get the ID of the Partial to check.
  2. Use GET /partials/$PARTIAL_ID to get a list of plugins that use this Partial.

Enable Partials support in custom plugins

You can leverage the Partials feature in your custom plugins by adjusting the plugin schema. To make custom plugins compatible with Partials, add the supported_partials key to the schema and specify the appropriate Partial type.

Here is an example schema for a custom plugin using a Partial:

{
  name = "custom-plugin-with-redis",
  supported_partials = {
    ["redis-ee"] = { "config.redis" },
  },
  fields = {
    {
      config = {
        type = "record",
        fields = {
          { some_other_config_key = { type = "string", required = true }},
          { redis = redis.config_schema }
        },
      },
    },
  },
}

Using DAO in custom plugins

Be aware that when using a Partial, the configuration belonging to the Partial is no longer stored alongside the plugin. If your code relies on Kong Gateway’s DAO and expects entities to contain Redis information, this data won’t be retrieved when using kong.db.plugins:select(plugin_id). Such a call will only fetch data stored in the plugin itself.

To include the Partial’s data within the plugin configuration, you must pass a special option parameter, such as: kong.db.plugins:select(plugin_id, { expand_partials = true }).

Something wrong?

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!