Skip to content

Commit

Permalink
chore(*) remove config cache
Browse files Browse the repository at this point in the history
  • Loading branch information
aboudreault authored and Guaris committed Aug 17, 2022
1 parent 1f06577 commit f040ef4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 62 deletions.
22 changes: 0 additions & 22 deletions src/gateway/plan-and-deploy/hybrid-mode/hybrid-mode-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -501,16 +501,6 @@ kong:{{page.kong_versions[page.version-index].ce-version}}-alpine
You can also choose to encrypt or disable the data plane configuration
cache with some additional settings:

`KONG_DATA_PLANE_CONFIG_CACHE_MODE`
: Optional setting for storing the config cache, defaults to `unencrypted`.
Change this to `encrypted` if you want to store the data plane's config cache
in an encrypted format, or set it to `off` if you don't want to use a cache.
Not available in open-source deployments.

`KONG_DATA_PLANE_CONFIG_CACHE_PATH`
: An optional custom path to the config cache. Not available in open-source
deployments.

1. If needed, bring up any subsequent data planes using the same settings.

{% endnavtab %}
Expand Down Expand Up @@ -582,16 +572,6 @@ and follow the instructions in Steps 1 and 2 **only** to download
You can also choose to encrypt or disable the data plane configuration
cache with some additional settings:

`data_plane_config_cache_mode`
: Optional setting for storing the config cache, defaults to `unencrypted`.
Change this to `encrypted` if you want to store the data plane's config cache
in an encrypted format, or set it to `off` if you don't want to use a cache.
Not available in open-source deployments.

`data_plane_config_cache_path`
: An optional custom path to the config cache. Not available in open-source
deployments.

3. Restart Kong for the settings to take effect:
```bash
kong restart
Expand Down Expand Up @@ -679,8 +659,6 @@ Parameter | Description | CP or DP {:width=10%:}
[`cluster_telemetry_endpoint`](/gateway/{{page.kong_version}}/reference/configuration/#cluster_telemetry_endpoint) <span class="badge enterprise"/> <br>*Required for Enterprise deployments* | The port that the data plane uses to send telemetry data to the control plane. Ignored on control plane nodes. | DP
[`cluster_control_plane`](/gateway/{{page.kong_version}}/reference/configuration/#cluster_control_plane) <br>*Required* | Address and port that the data plane nodes use to connect to the control plane. Must point to the port configured using the [`cluster_listen`](/gateway/{{page.kong_version}}/reference/configuration/#cluster_listen) property on the control plane node. Ignored on control plane nodes. | DP
[`cluster_mtls`](/gateway/{{page.kong_version}}/reference/configuration/#cluster_mtls) <br>*Optional* <br><br>**Default:** `shared` | One of `shared` or `pki`. Indicates whether hybrid mode will use a shared certificate/key pair for CP/DP mTLS or if PKI mode will be used. See below sections for differences in mTLS modes. | Both
[`data_plane_config_cache_mode`](/gateway/{{page.kong_version}}/reference/configuration/#data_plane_config_cache_mode) <span class="badge enterprise"/> <br>*Optional* <br><br>**Default:** `unencrypted` | Determines how the data plane configuration cache is stored. <br> &#8226; `unencrypted`: Stores configuration without encrypting it in `config.cache.json.gz` <br> &#8226; `encrypted`: Encrypts and stores the configuration cache in `.config.cache.jwt` (hidden file). <br> &#8226; `off`: The data plane does not cache configuration | DP
[`data_plane_config_cache_path`](/gateway/{{page.kong_version}}/reference/configuration/#data_plane_config_cache_path) <span class="badge enterprise"/> <br>*Optional* <br><br>**Default:** Kong [`prefix` path](/gateway/{{page.kong_version}}/reference/configuration/#prefix) | Path to the data plane config cache file, for example `/tmp/kong-config-cache`. If the cache mode is `encrypted`, the filename is `.config.cache.jwt` (hidden file). If the cache mode is `unencrypted`, the filename is `config.cache.json.gz`. | DP

The following properties are used differently between `shared` and `pki` modes:

Expand Down
13 changes: 5 additions & 8 deletions src/gateway/plan-and-deploy/hybrid-mode/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,28 +154,25 @@ the control plane after verifying the success and correctness of the procedure.
During that time, the data plane will keep working with the latest configuration.

A new data plane node can be provisioned during control plane downtime. This
requires either copying the config cache file (`config.json.gz`) from another
requires either copying the LMDB directory (`dbless.lmdb`) from another
data plane node, or using a declarative configuration. In either case, if it
has the role of `"data_plane"`, it will also keep trying to contact the control
plane until it's up again.

To change a disconnected data plane node's configuration, you have to remove
the config cache file (`config.json.gz`), ensure the `declarative_config`
the LMDB directory (`dbless.lmdb`), ensure the `declarative_config`
parameter or the `KONG_DECLARATIVE_CONFIG` environment variable is set, and set
the whole configuration in the referenced YAML file.

### Data plane cache configuration
{:.badge .enterprise}

By default, data planes store their configuration to the file system
in an unencrypted cache file, `config.json.gz`, in {{site.base_gateway}}'s
`prefix` path. You can also choose to encrypt this cache, or disable it entirely.
in an unencrypted LMDB database, `dbless.lmdb`, in {{site.base_gateway}}'s
`prefix` path. <<You can also choose to encrypt this database (TODO in progress)>>.

If encrypted, the data plane uses the cluster certificate key to decrypt the
configuration cache on startup.

See [`data_plane_config_cache_mode`](/gateway/{{page.kong_version}}/reference/configuration/#data_plane_config_cache_mode)
and [`data_plane_config_cache_path`](/gateway/{{page.kong_version}}/reference/configuration/#data_plane_config_cache_path).
LMDB database on startup.

## Limitations

Expand Down
32 changes: 0 additions & 32 deletions src/gateway/reference/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -738,38 +738,6 @@ node to which telemetry updates will be posted in `host:port` format.

---

#### data_plane_config_cache_mode
{:.badge .enterprise}

Data planes can store their config to file system as a backup in case the node
is restarted or reloaded to faster bring the node in configured state or in case
there are issues connecting to control plane.

This parameter can be used to control the behavior.

To be used by data plane nodes only: `unencrypted` = stores config cache
unencrypted `encrypted` = stores config cache encrypted `off` = does not store
the config cache

**Default:** `unencrypted`

---

#### data_plane_config_cache_path
{:.badge .enterprise}

The unencrypted config cache is stored by default to Kong `prefix` with a
filename `config.cache.json.gz`.

The encrypted config cache is stored by default to Kong `prefix` with a
filename `.config.cache.jwt` Alternatively you can specify path for config cache
with this parameter, e.g. `/tmp/kong-config-cache`.

**Default:** none

---


### Hybrid Mode Control Plane section

#### cluster_listen
Expand Down

0 comments on commit f040ef4

Please sign in to comment.