You can deploy a License using the Admin API.
The Control Plane sends Licenses configured through the /licenses
endpoint to all Data Planes in the cluster. The Data Planes use the most recent updated_at
License. This is the only method that automatically applies the License to Data Planes.
The following license payload is only an example. Substitute your own license before running the command.
curl -i -X POST http://localhost:8001/licenses/ \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '
{
"payload": "{\"license\":{\"payload\":{\"admin_seats\":\"1\",\"customer\":\"Example Company, Inc\",\"dataplanes\":\"1\",\"license_creation_date\":\"2017-07-20\",\"license_expiration_date\":\"2017-07-20\",\"license_key\":\"00141000017ODj3AAG_a1V41000004wT0OEAU\",\"product_subscription\":\"Konnect Enterprise\",\"support_plan\":\"None\"},\"signature\":\"6985968131533a967fcc721244a979948b1066967f1e9cd65dbd8eeabe060fc32d894a2945f5e4a03c1cd2198c74e058ac63d28b045c2f1fcec95877bd790e1b\",\"version\":\"1\"}}"
}
'
You can deploy a License with a license.json
file.
The license data must contain straight quotes to be considered valid JSON ('
and "
, not ’
or “
). Kong Gateway searches for the License by default in /etc/kong/license.json
.
In a self-managed Kong Gateway deployment, the Control Plane does not propagate the License to Data Plane nodes.
You must add the License to each Data Plane node, and each node must start with the License.
The License can’t be added after starting the node.
- Save your License to a file named
license.json
.
- Copy the license file to the
/etc/kong
.
-
Restart the Kong Gateway nodes to apply the license by running
kong restart
from within the container.
You can deploy a License as an environment variable.
If you deploy a License using a KONG_LICENSE_DATA
or KONG_LICENSE_PATH
environment variable, the Control Plane does not propagate the License to Data Plane nodes.
You must add the License to each Data Plane node, and each node must start with the License.
The License can’t be added after starting the node.
Unlike other KONG_*
environmental variables, the KONG_LICENSE_DATA
and KONG_LICENSE_PATH
can’t be defined inline as part of any kong
CLI commands. License file environmental variables must be exported to the shell where the Nginx process runs, ahead of the kong
CLI tool.
- Export your License to an environment variable:
export KONG_LICENSE_DATA='$YOUR_LICENSE_DATA'
- Reference the variable as part of your Kong Gateway deployment.
By default, Kong Gateway looks for a License file at /etc/kong/license.json
. If your default Kong Gateway directory is different, or the location of license.json
is different than the default, you can use the KONG_LICENSE_PATH
variable instead to force Kong Gateway to check a different directory.