Skip to content

Commit 7a5fba8

Browse files
Run update.sh
1 parent 472b9bd commit 7a5fba8

File tree

1 file changed

+4
-167
lines changed

1 file changed

+4
-167
lines changed

kong/README.md

Lines changed: 4 additions & 167 deletions
Original file line numberDiff line numberDiff line change
@@ -57,178 +57,15 @@ WARNING:
5757

5858
# What is Kong?
5959

60-
Kong is a scalable, open source API Platform (also known as an API Gateway or API Middleware). Kong was originally built by [Kong Inc.](https://konghq.com) (formerly known as Mashape) to secure, manage, and extend over 15,000 Microservices for its API Marketplace, which generates billions of requests per month.
60+
Kong Gateway is the world’s most adopted API gateway. Lightweight, fast, and flexible, this open source gateway is built for hybrid and multi-cloud and optimized for microservices and distributed architectures.
6161

62-
Under active development, Kong is now used in production at hundreds of organizations from startups, to large enterprises and governments including: The New York Times, Expedia, Healthcare.gov, The Guardian, Condè Nast, The University of Auckland, Ferrari, Rakuten, Cisco, SkyScanner, Yahoo! Japan, Giphy and so on.
62+
Built on this open source DNA, Kong’s unified cloud API platform helps organizations ranging from startups to Fortune 500 enterprises unleash developer productivity, build securely, and accelerate time to market.
6363

6464
Kong's official documentation can be found at [docs.konghq.com](https://docs.konghq.com/).
6565

66-
# How to use this image without a Database
66+
# How to use this image
6767

68-
Kong 1.1 added the capability to run Kong without a database, using only in-memory storage for entities: we call this DB-less mode. When running Kong DB-less, the configuration of entities is done in a second configuration file, in YAML or JSON, using declarative configuration.
69-
70-
```shell
71-
$ docker run -d --name kong \
72-
-e "KONG_DATABASE=off" \
73-
-e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
74-
-e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \
75-
-e "KONG_PROXY_ERROR_LOG=/dev/stderr" \
76-
-e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \
77-
-e "KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl" \
78-
-p 8000:8000 \
79-
-p 8443:8443 \
80-
-p 8001:8001 \
81-
-p 8444:8444 \
82-
kong
83-
```
84-
85-
Generate a skeleton configuration file to get you started
86-
87-
```shell
88-
$ docker exec -it kong kong config init /home/kong/kong.yml
89-
$ docker exec -it kong cat /home/kong/kong.yml >> kong.yml
90-
```
91-
92-
Load a declarative configuration into a running Kong node via its Admin API using HTTPie
93-
94-
```shell
95-
$ http :8001/config [email protected]
96-
```
97-
98-
**Note**: Not all Kong plugins are compatible with DB-less mode, since some of them by design require a central database coordination and/or dynamic creation of entities, see the doc for details at [DB-less and Declarative Configuration](https://docs.konghq.com/latest/db-less-and-declarative-config/)
99-
100-
# How to use this image with a Database
101-
102-
You can either use the official Cassandra/PostgreSQL containers, or use your own.
103-
104-
## 1. Link Kong to either a Cassandra or PostgreSQL container
105-
106-
It's up to you to decide which datastore between Cassandra or PostgreSQL you want to use, since Kong supports both.
107-
108-
### Cassandra
109-
110-
Start a Cassandra container by executing:
111-
112-
```shell
113-
$ docker run -d --name kong-database \
114-
-p 9042:9042 \
115-
cassandra:3
116-
```
117-
118-
### Postgres
119-
120-
Start a PostgreSQL container by executing:
121-
122-
```shell
123-
$ docker run -d --name kong-database \
124-
-p 5432:5432 \
125-
-e "POSTGRES_USER=kong" \
126-
-e "POSTGRES_DB=kong" \
127-
-e "POSTGRES_PASSWORD=kong" \
128-
postgres:9.6
129-
```
130-
131-
## 2. Prepare your database
132-
133-
Run the database migrations with an ephemeral Kong container:
134-
135-
```shell
136-
$ docker run --rm \
137-
--link kong-database:kong-database \
138-
-e "KONG_DATABASE=postgres" \
139-
-e "KONG_PG_HOST=kong-database" \
140-
-e "KONG_PG_USER=kong" \
141-
-e "KONG_PG_PASSWORD=kong" \
142-
-e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \
143-
kong kong migrations bootstrap
144-
```
145-
146-
In the above example, both Cassandra and PostgreSQL are configured, but you should update the `KONG_DATABASE` environment variable with either `cassandra` or `postgres`.
147-
148-
**Note for Kong < 0.15**: with Kong versions below 0.15 (up to 0.14), use the `up` sub-command instead of `bootstrap`. Also note that with Kong < 0.15, migrations should never be run concurrently; only one Kong node should be performing migrations at a time. This limitation is lifted for Kong 0.15, 1.0, and above.
149-
150-
### Start Kong
151-
152-
Once the database has been started and prepared, we can start a Kong container and link it to the database container, and configuring the `KONG_DATABASE` environment variable with either `cassandra` or `postgres` depending on which database you decided to use:
153-
154-
```shell
155-
$ docker run -d --name kong \
156-
--link kong-database:kong-database \
157-
-e "KONG_DATABASE=postgres" \
158-
-e "KONG_PG_HOST=kong-database" \
159-
-e "KONG_PG_PASSWORD=kong" \
160-
-e "KONG_CASSANDRA_CONTACT_POINTS=kong-database" \
161-
-e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
162-
-e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \
163-
-e "KONG_PROXY_ERROR_LOG=/dev/stderr" \
164-
-e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \
165-
-e "KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl" \
166-
-p 8000:8000 \
167-
-p 8443:8443 \
168-
-p 8001:8001 \
169-
-p 8444:8444 \
170-
kong
171-
```
172-
173-
If everything went well, and if you created your container with the default ports, Kong should be listening on your host's `8000` ([Proxy](https://docs.konghq.com/latest/configuration/#proxy_port)), `8443` ([Proxy SSL](https://docs.konghq.com/latest/configuration/#proxy_listen_ssl)), `8001` ([Admin API](https://docs.konghq.com/latest/configuration/#admin_listen)) and `8444` ([Admin API SSL](https://docs.konghq.com/latest/configuration/#admin_listen_ssl)) ports.
174-
175-
You can read the docs at [docs.konghq.com](https://docs.konghq.com/) to learn more about Kong.
176-
177-
## 3. Use Kong with a custom configuration (and a custom Cassandra/PostgreSQL cluster)
178-
179-
You can override any property of the [Kong configuration file](https://docs.konghq.com/latest/configuration/) with environment variables. Just prepend any Kong configuration property with the `KONG_` prefix, for example:
180-
181-
```shell
182-
$ docker run -d --name kong \
183-
-e "KONG_DATABASE=postgres" \
184-
-e "KONG_PG_HOST=kong-database" \
185-
-e "KONG_LOG_LEVEL=info" \
186-
-e "KONG_CUSTOM_PLUGINS=helloworld" \
187-
-e "KONG_PG_HOST=1.1.1.1" \
188-
-e "KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl" \
189-
-p 8000:8000 \
190-
-p 8443:8443 \
191-
-p 8001:8001 \
192-
-p 8444:8444 \
193-
kong
194-
```
195-
196-
## Reload Kong in a running container
197-
198-
If you change your custom configuration, reload Kong (without downtime) by running:
199-
200-
```shell
201-
$ docker exec -it kong kong reload
202-
```
203-
204-
This will run the [`kong reload`](https://docs.konghq.com/latest/cli/#reload) command in your container.
205-
206-
# Running Kong in read-only mode
207-
208-
Starting with version `3.2.0` of Kong it is possible to run the container in read-only mode. To do so, mount a Docker volume to the locations where Kong needs to write data. The default configuration requires write access to `/tmp` and to the prefix path, as provided by the following example:
209-
210-
```shell
211-
$ docker run --read-only -d --name kong \
212-
-v "$(pwd)/declarative:/kong/declarative/" \
213-
-v "$(pwd)/tmp_volume:/tmp" \
214-
-v "$(pwd)/prefix_volume:/var/run/kong" \
215-
-e "KONG_PREFIX=/var/run/kong" \
216-
-e "KONG_DATABASE=off" \
217-
-e "KONG_PROXY_ACCESS_LOG=/dev/stdout" \
218-
-e "KONG_ADMIN_ACCESS_LOG=/dev/stdout" \
219-
-e "KONG_PROXY_ERROR_LOG=/dev/stderr" \
220-
-e "KONG_ADMIN_ERROR_LOG=/dev/stderr" \
221-
-e "KONG_ADMIN_LISTEN=0.0.0.0:8001, 0.0.0.0:8444 ssl" \
222-
-p 8000:8000 \
223-
-p 8443:8443 \
224-
-p 8001:8001 \
225-
-p 8444:8444 \
226-
kong
227-
```
228-
229-
# Kubernetes Ingress
230-
231-
Among the many deployment options [available](https://konghq.com/install), Kong also offers a [Kubernetes Ingress Controller](https://github.com/Kong/kubernetes-ingress-controller) ready to use in your K8s environment.
68+
Please refer to the [installation section](https://docs.konghq.com/gateway/latest/install/docker/#main) on our documentation website to learn how to use this image.
23269

23370
# Image Variants
23471

0 commit comments

Comments
 (0)