Skip to content

Commit

Permalink
Merge branch 'release/2.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
gszr committed Oct 26, 2020
2 parents 4c1a1ea + 9348456 commit c4441f5
Show file tree
Hide file tree
Showing 165 changed files with 7,651 additions and 1,742 deletions.
4 changes: 3 additions & 1 deletion .ci/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ if [ "$TEST_SUITE" == "plugins" ]; then

git clone https://github.com/Kong/$REPOSITORY.git --branch $VERSION --single-branch /tmp/test-$REPOSITORY || \
git clone https://github.com/Kong/$REPOSITORY.git --branch v$VERSION --single-branch /tmp/test-$REPOSITORY
sed -i 's/grpcbin:9000/localhost:15002/g' /tmp/test-$REPOSITORY/spec/*.lua
sed -i 's/grpcbin:9001/localhost:15003/g' /tmp/test-$REPOSITORY/spec/*.lua
cp -R /tmp/test-$REPOSITORY/spec/fixtures/* spec/fixtures/ || true
pushd /tmp/test-$REPOSITORY
luarocks make
Expand All @@ -104,7 +106,7 @@ if [ "$TEST_SUITE" == "pdk" ]; then
fi
if [ "$TEST_SUITE" == "unit" ]; then
unset KONG_TEST_NGINX_USER KONG_PG_PASSWORD KONG_TEST_PG_PASSWORD
scripts/autodoc-admin-api
scripts/autodoc
bin/busted -v -o gtest spec/01-unit
make lint
fi
2 changes: 1 addition & 1 deletion .ci/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ LUAROCKS=$(dep_version RESTY_LUAROCKS_VERSION)
OPENSSL=$(dep_version RESTY_OPENSSL_VERSION)
GO_PLUGINSERVER=$(dep_version KONG_GO_PLUGINSERVER_VERSION)

DEPS_HASH=$(cat .ci/setup_env.sh .travis.yml .requirements | md5sum | awk '{ print $1 }')
DEPS_HASH=$({ cat .ci/setup_env.sh .travis.yml .requirements Makefile; cat kong-*.rockspec | awk '/dependencies/,/}/'; } | md5sum | awk '{ print $1 }')
INSTALL_CACHE=${INSTALL_CACHE:=/install-cache}
INSTALL_ROOT=$INSTALL_CACHE/$DEPS_HASH

Expand Down
6 changes: 3 additions & 3 deletions .requirements
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ KONG_PACKAGE_NAME=kong
KONG_CONFLICTS=kong-enterprise-edition
KONG_LICENSE="ASL 2.0"

RESTY_VERSION=1.15.8.3
RESTY_VERSION=1.17.8.2
RESTY_LUAROCKS_VERSION=3.3.1
RESTY_OPENSSL_VERSION=1.1.1g
RESTY_OPENSSL_VERSION=1.1.1h
RESTY_PCRE_VERSION=8.44
LIBYAML_VERSION=0.2.5
KONG_GO_PLUGINSERVER_VERSION=v0.4.0
KONG_GO_PLUGINSERVER_VERSION=v0.5.1
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ addons:
hosts:
- grpcs_1.test
- grpcs_2.test
- grpcbin

env:
global:
Expand All @@ -39,11 +40,9 @@ env:
- DOCKER_MACHINE_ARM64_NAME=travis-ci-kong-${TRAVIS_JOB_ID}
matrix:
- KONG_TEST_DATABASE=postgres TEST_SUITE=integration
- KONG_TEST_DATABASE=cassandra CASSANDRA=2.2 TEST_SUITE=integration
- KONG_TEST_DATABASE=cassandra CASSANDRA=3.9 TEST_SUITE=integration
- KONG_TEST_DATABASE=off TEST_SUITE=dbless
- KONG_TEST_DATABASE=postgres TEST_SUITE=plugins
- KONG_TEST_DATABASE=cassandra CASSANDRA=2.2 TEST_SUITE=plugins
- KONG_TEST_DATABASE=cassandra CASSANDRA=3.9 TEST_SUITE=plugins
- TEST_SUITE=pdk

Expand All @@ -66,7 +65,7 @@ jobs:
- stage: lint and unit
script:
- make lint
- scripts/autodoc-admin-api
- scripts/autodoc
- bin/busted -v -o htest spec/01-unit
env:
- KONG_DATABASE=none
Expand Down
165 changes: 165 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Table of Contents


- [2.2.0](#220)
- [2.1.4](#214)
- [2.1.3](#213)
- [2.1.2](#212)
Expand Down Expand Up @@ -49,6 +50,148 @@
- [0.9.9 and prior](#099---20170202)


## [2.2.0]

> Released 2020/10/23
This is a new major release of Kong, including new features such as **UDP support**,
**Configurable Request and Response Buffering**, **Dynamically Loading of OS
Certificates**, and much more.

### Dependencies

- :warning: For Kong 2.2, the required OpenResty version has been bumped to
[1.17.8.2](http://openresty.org/en/changelog-1017008.html), and the
the set of patches included has changed, including the latest release of
[lua-kong-nginx-module](https://github.com/Kong/lua-kong-nginx-module).
If you are installing Kong from one of our distribution
packages, you are not affected by this change.
- Bump OpenSSL version from `1.1.1g` to `1.1.1h`.
[#6382](https://github.com/Kong/kong/pull/6382)

**Note:** if you are not using one of our distribution packages and compiling
OpenResty from source, you must still apply Kong's [OpenResty
patches](https://github.com/Kong/kong-build-tools/tree/master/openresty-build-tools/openresty-patches)
(and, as highlighted above, compile OpenResty with the new
lua-kong-nginx-module). Our [kong-build-tools](https://github.com/Kong/kong-build-tools)
repository will allow you to do both easily.

- :warning: Cassandra 2.x support is now deprecated. If you are still
using Cassandra 2.x with Kong, we recommend you to upgrade, since this
series of Cassandra is about to be EOL with the upcoming release of
Cassandra 4.0.

### Additions

##### Core

- :fireworks: **UDP support**: Kong now features support for UDP proxying
in its stream subsystem. The `"udp"` protocol is now accepted in the `protocols`
attribute of Routes and the `protocol` attribute of Services.
Load balancing and logging plugins support UDP as well.
[#6215](https://github.com/Kong/kong/pull/6215)
- **Configurable Request and Response Buffering**: The buffering of requests
or responses can now be enabled or disabled on a per-route basis, through
setting attributes `Route.request_buffering` or `Route.response_buffering`
to `true` or `false`. Default behavior remains the same: buffering is enabled
by default for requests and responses.
[#6057](https://github.com/Kong/kong/pull/6057)
- **Option to Automatically Load OS Certificates**: The configuration
attribute `lua_ssl_trusted_certificate` was extended to accept a
comma-separated list of certificate paths, as well as a special `system`
value, which expands to the "system default" certificates file installed
by the operating system. This follows a very simple heuristic to try to
use the most common certificate file in most popular distros.
[#6342](https://github.com/Kong/kong/pull/6342)
- Consistent-Hashing load balancing algorithm does not require to use the entire
target history to build the same proxying destinations table on all Kong nodes
anymore. Now deleted targets are actually removed from the database and the
targets entities can be manipulated by the Admin API as any other entity.
[#6336](https://github.com/Kong/kong/pull/6336)
- Add `X-Forwarded-Path` header: if a trusted source provides a
`X-Forwarded-Path` header, it is proxied as-is. Otherwise, Kong will set
the content of said header to the request's path.
[#6251](https://github.com/Kong/kong/pull/6251)
- Hybrid mode synchronization performance improvements: Kong now uses a
new internal synchronization method to push changes from the Control Plane
to the Data Plane, drastically reducing the amount of communication between
nodes during bulk updates.
[#6293](https://github.com/Kong/kong/pull/6293)
- The `Upstream.client_certificate` attribute can now be used from proxying:
This allows `client_certificate` setting used for mTLS handshaking with
the `Upstream` server to be shared easily among different Services.
However, `Service.client_certificate` will take precedence over
`Upstream.client_certificate` if both are set simultaneously.
In previous releases, `Upstream.client_certificate` was only used for
mTLS in active health checks.
[#6348](https://github.com/Kong/kong/pull/6348)
- New `shorthand_fields` top-level attribute in schema definitions, which
deprecates `shorthands` and includes type definitions in addition to the
shorthand callback.
[#6364](https://github.com/Kong/kong/pull/6364)
- Hybrid Mode: the table of Data Plane nodes at the Control Plane is now
cleaned up automatically, according to a delay value configurable via
the `cluster_data_plane_purge_delay` attribute, set to 14 days by default.
[#6376](https://github.com/Kong/kong/pull/6376)
- Hybrid Mode: Data Plane nodes now apply only the last config when receiving
several updates in sequence, improving the performance when large configs are
in use. [#6299](https://github.com/Kong/kong/pull/6299)

##### Admin API

- Hybrid Mode: new endpoint `/clustering/data-planes` which returns complete
information about all Data Plane nodes that are connected to the Control
Plane cluster, regardless of the Control Plane node to which they connected.
[#6308](https://github.com/Kong/kong/pull/6308)
* :warning: The `/clustering/status` endpoint is now deprecated, since it
returns only information about Data Plane nodes directly connected to the
Control Plane node to which the Admin API request was made, and is
superseded by `/clustering/data-planes`.
- Admin API responses now honor the `headers` configuration setting for
including or removing the `Server` header.
[#6371](https://github.com/Kong/kong/pull/6371)

##### PDK

- New function `kong.request.get_forwarded_prefix`: returns the prefix path
component of the request's URL that Kong stripped before proxying to upstream,
respecting the value of `X-Forwarded-Prefix` when it comes from a trusted source.
[#6251](https://github.com/Kong/kong/pull/6251)
- `kong.response.exit` now honors the `headers` configuration setting for
including or removing the `Server` header.
[#6371](https://github.com/Kong/kong/pull/6371)
- `kong.log.serialize` function now can be called using the stream subsystem,
allowing various logging plugins to work under TCP and TLS proxy modes.
[#6036](https://github.com/Kong/kong/pull/6036)
- Requests with `multipart/form-data` MIME type now can use the same part name
multiple times. [#6054](https://github.com/Kong/kong/pull/6054)

##### Plugins

- **New Response Phase**: both Go and Lua pluggins now support a new plugin
phase called `response` in Lua plugins and `Response` in Go. Using it
automatically enables response buffering, which allows you to manipulate
both the response headers and the response body in the same phase.
This enables support for response handling in Go, where header and body
filter phases are not available, allowing you to use PDK functions such
as `kong.Response.GetBody()`, and provides an equivalent simplified
feature for handling buffered responses from Lua plugins as well.
[#5991](https://github.com/Kong/kong/pull/5991)
- aws-lambda: bump to version 3.5.0:
[#6379](https://github.com/Kong/kong/pull/6379)
* support for 'isBase64Encoded' flag in Lambda function responses
- grpc-web: introduce configuration pass_stripped_path, which, if set to true,
causes the plugin to pass the stripped request path (see the `strip_path` Route
attribute) to the upstream gRPC service.
- rate-limiting: Support for rate limiting by path, by setting the
`limit_by = "path"` configuration attribute.
Thanks [KongGuide](https://github.com/KongGuide) for the patch!
[#6286](https://github.com/Kong/kong/pull/6286)
- correlation-id: the plugin now generates a correlation-id value by default
if the correlation id header arrives but is empty.
[#6358](https://github.com/Kong/kong/pull/6358)


## [2.1.4]

> Released 2020/09/18
Expand All @@ -60,6 +203,27 @@ contains bugfixes. The are no new features or breaking changes.

##### Core

- Improve graceful exit of Control Plane and Data Plane nodes in Hybrid Mode.
[#6306](https://github.com/Kong/kong/pull/6306)

##### Plugins

- datadog, loggly, statsd: fixes for supporting logging TCP/UDP services.
[#6344](https://github.com/Kong/kong/pull/6344)
- Logging plugins: request and response sizes are now reported
by the log serializer as number attributes instead of string.
[#6356](https://github.com/Kong/kong/pull/6356)
- prometheus: Remove unnecessary `WARN` log that was seen in the Kong 2.1
series.
[#6258](https://github.com/Kong/kong/pull/6258)
- key-auth: no longer trigger HTTP 400 error when the body cannot be decoded.
[#6357](https://github.com/Kong/kong/pull/6357)
- aws-lambda: respect `skip_large_bodies` config setting even when not using
AWS API Gateway compatibility.
[#6379](https://github.com/Kong/kong/pull/6379)


[Back to TOC](#table-of-contents)
- Fix issue where `kong reload` would occasionally leave stale workers locked
at 100% CPU.
[#6300](https://github.com/Kong/kong/pull/6300)
Expand Down Expand Up @@ -5369,6 +5533,7 @@ First version running with Cassandra.

[Back to TOC](#table-of-contents)

[2.2.0]: https://github.com/Kong/kong/compare/2.1.3...2.2.0
[2.1.4]: https://github.com/Kong/kong/compare/2.1.3...2.1.4
[2.1.3]: https://github.com/Kong/kong/compare/2.1.2...2.1.3
[2.1.2]: https://github.com/Kong/kong/compare/2.1.1...2.1.2
Expand Down
5 changes: 4 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -315,14 +315,17 @@ pipeline {
KONG_BUILD_TOOLS_LOCATION = "${env.WORKSPACE}/../kong-build-tools"
BINTRAY_USR = 'kong-inc_travis-ci@kong'
BINTRAY_KEY = credentials('bintray_travis_key')
AWS_ACCESS_KEY = credentials('AWS_ACCESS_KEY')
AWS_SECRET_ACCESS_KEY = credentials('AWS_SECRET_ACCESS_KEY')
DEBUG = 0
}
steps {
sh 'echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin || true'
sh 'make setup-kong-build-tools'
sh 'PACKAGE_TYPE=src RESTY_IMAGE_BASE=src make release'
sh 'PACKAGE_TYPE=apk RESTY_IMAGE_BASE=alpine RESTY_IMAGE_TAG=3 make release'
sh 'PACKAGE_TYPE=rpm RESTY_IMAGE_BASE=amazonlinux RESTY_IMAGE_TAG=1 make release'
sh 'PACKAGE_TYPE=rpm RESTY_IMAGE_BASE=amazonlinux RESTY_IMAGE_TAG=2 make release'
sh 'CACHE=false DOCKER_MACHINE_ARM64_NAME="kong-"`cat /proc/sys/kernel/random/uuid` PACKAGE_TYPE=apk RESTY_IMAGE_BASE=alpine RESTY_IMAGE_TAG=3 make release'
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
OS := $(shell uname | awk '{print tolower($$0)}')
MACHINE := $(shell uname -m)

DEV_ROCKS = "busted 2.0.0" "busted-htest 1.0.0" "luacheck 0.23.0" "lua-llthreads2 0.1.5" "http 0.3"
DEV_ROCKS = "busted 2.0.0" "busted-htest 1.0.0" "luacheck 0.24.0" "lua-llthreads2 0.1.5" "http 0.3" "ldoc 1.4.6"
WIN_SCRIPTS = "bin/busted" "bin/kong"
BUSTED_ARGS ?= -v
TEST_CMD ?= bin/busted $(BUSTED_ARGS)
Expand All @@ -28,7 +28,7 @@ RESTY_VERSION ?= `grep RESTY_VERSION $(KONG_SOURCE_LOCATION)/.requirements | awk
RESTY_LUAROCKS_VERSION ?= `grep RESTY_LUAROCKS_VERSION $(KONG_SOURCE_LOCATION)/.requirements | awk -F"=" '{print $$2}'`
RESTY_OPENSSL_VERSION ?= `grep RESTY_OPENSSL_VERSION $(KONG_SOURCE_LOCATION)/.requirements | awk -F"=" '{print $$2}'`
RESTY_PCRE_VERSION ?= `grep RESTY_PCRE_VERSION $(KONG_SOURCE_LOCATION)/.requirements | awk -F"=" '{print $$2}'`
KONG_BUILD_TOOLS ?= '4.11.1'
KONG_BUILD_TOOLS ?= '4.11.2'
OPENRESTY_PATCHES_BRANCH ?= master
KONG_NGINX_MODULE_BRANCH ?= master

Expand Down Expand Up @@ -112,7 +112,7 @@ install:
remove:
-@luarocks remove kong

dependencies: grpcurl
dependencies: bin/grpcurl
@for rock in $(DEV_ROCKS) ; do \
if luarocks list --porcelain $$rock | grep -q "installed" ; then \
echo $$rock already installed, skipping ; \
Expand All @@ -122,7 +122,7 @@ dependencies: grpcurl
fi \
done;

grpcurl:
bin/grpcurl:
@curl -s -S -L \
https://github.com/fullstorydev/grpcurl/releases/download/v1.3.0/grpcurl_1.3.0_$(GRPCURL_OS)_$(MACHINE).tar.gz | tar xz -C bin;
@rm bin/LICENSE
Expand Down
34 changes: 34 additions & 0 deletions autodoc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
Prerequisites:
```
cd kong-root-repo
make dev
git checkout branch/tag/release
```

Generate everything:

```
cd kong-root-repo
./scripts/autodoc
```

You can then copy the generated files to the docs.konghq.com repo manually, as follows:

```
cp autodoc/output/admin-api/admin-api.md ../docs.konghq.com/app/$xyxversion/admin-api.md
cp autodoc/output/admin-api/db-less-admin-api.md ../docs.konghq.com/app/$xyxversion/db-less-admin-api.md
cp autodoc/output/nav/docs_nav.yml.admin-api.in ../docs.konghq.com/autodoc-nav/docs_nav_$xyxversion.yml.admin-api.in
cp autodoc/output/cli.md ../docs.konghq.com/app/$xyxversion/cli.md
cp autodoc/output/configuration.md ../docs.konghq.com/app/$xyxversion/configuration.md
cp -r autodoc/output/pdk ../docs.konghq.com/app/$xyxversion/pdk
# Add the PDK nav to the docs nav
vim ../docs.konghq.com/app/_data/docs_nav_$xyxversion.yml
<add the contents of autodoc/output/_pdk_nav.yml in the "Plugin Development Kit" section
```



Original file line number Diff line number Diff line change
Expand Up @@ -866,6 +866,20 @@ return {
the Service's `host`.
]]
},
request_buffering = {
description = [[
Whether to enable request body buffering or not. With HTTP 1.1, it
may make sense to turn this off on services that receive data with
chunked transfer encoding.
]]
},
response_buffering = {
description = [[
Whether to enable response body buffering or not. With HTTP 1.1, it
may make sense to turn this off on services that send data with chunked
transfer encoding.
]]
},
service = {
description = [[
The Service this Route is associated to.
Expand Down
File renamed without changes.
Loading

0 comments on commit c4441f5

Please sign in to comment.