CLI Reference
- ,
--help
: print the command’s help message --v
: enable verbose mode--vv
: enable debug mode (noisy)
Available commands
kong config
Usage: kong config COMMAND [OPTIONS]
Use declarative configuration files with Kong.
The available commands are:
init [<file>] Generate an example config file to
get you started. If a filename
is not given, ./kong.yml is used
by default.
db_import <file> Import a declarative config file into
the Kong database.
db_export [<file>] Export the Kong database into a
declarative config file. If a filename
is not given, ./kong.yml is used
by default.
parse <file> Parse a declarative config file (check
its syntax) but do not load it into Kong.
Options:
-c,--conf (optional string) Configuration file.
-p,--prefix (optional string) Override prefix directory.
kong health
Usage: kong health [OPTIONS]
Check if the necessary services are running for this node.
Options:
-p,--prefix (optional string) prefix at which Kong should be running
kong hybrid
Usage: kong hybrid COMMAND [OPTIONS]
Hybrid mode utilities for Kong.
The available commands are:
gen_cert [<cert> <key>] Generate a certificate/key pair that is suitable
for use in hybrid mode deployment.
Cert and key will be written to
'./cluster.crt' and './cluster.key' inside
the current directory unless filenames are given.
-d,--days (optional number) Override certificate validity duration.
Default: 1095 days (3 years)
kong prepare
Usage: kong prepare [OPTIONS]
Prepare the Kong prefix in the configured prefix directory. This command can
be used to start Kong from the nginx binary without using the 'kong start'
command.
Example usage:
kong migrations up
kong prepare -p /usr/local/kong -c kong.conf
nginx -p /usr/local/kong -c /usr/local/kong/nginx.conf
Options:
-c,--conf (optional string) configuration file
-p,--prefix (optional string) override prefix directory
--nginx-conf (optional string) custom Nginx configuration template
kong quit
Usage: kong quit [OPTIONS]
Gracefully quit a running Kong node (Nginx and other
configured services) in given prefix directory.
This command sends a SIGQUIT signal to Nginx, meaning all
requests will finish processing before shutting down.
If the timeout delay is reached, the node will be forcefully
stopped (SIGTERM).
Options:
-p,--prefix (optional string) prefix Kong is running at
-t,--timeout (default 10) timeout before forced shutdown
-w,--wait (default 0) wait time before initiating the shutdown
kong reload
Usage: kong reload [OPTIONS]
Reload a Kong node (and start other configured services
if necessary) in given prefix directory.
This command sends a HUP signal to Nginx, which will spawn
new workers (taking configuration changes into account),
and stop the old ones when they have finished processing
current requests.
Options:
-c,--conf (optional string) configuration file
-p,--prefix (optional string) prefix Kong is running at
--nginx-conf (optional string) custom Nginx configuration template
kong runner
Execute a lua file in a kong node. the `kong` variable is available to
reach the DAO, PDK, etc. The variable `args` can be used to access all
arguments (args[1] being the lua filename being run).
Example usage:
kong runner file.lua arg1 arg2
echo 'print("foo")' | kong runner
kong start
Usage: kong start [OPTIONS]
Start Kong (Nginx and other configured services) in the configured
prefix directory.
Options:
-c,--conf (optional string) Configuration file.
-p,--prefix (optional string) Override prefix directory.
--nginx-conf (optional string) Custom Nginx configuration template.
--run-migrations (optional boolean) Run migrations before starting.
--db-timeout (default 60) Timeout, in seconds, for all database
operations (including schema consensus for
Cassandra).
--lock-timeout (default 60) When --run-migrations is enabled, timeout,
in seconds, for nodes waiting on the
leader node to finish running migrations.
kong stop
Usage: kong stop [OPTIONS]
Stop a running Kong node (Nginx and other configured services) in given
prefix directory.
This command sends a SIGTERM signal to Nginx.
Options:
-p,--prefix (optional string) prefix Kong is running at
kong version
Usage: kong version [OPTIONS]
Print Kong's version. With the -a option, will print
the version of all underlying dependencies.
Options:
-a,--all get version of all dependencies