You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: krakend/content.md
+27-26Lines changed: 27 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -2,37 +2,35 @@
2
2
3
3
# What is KrakenD?
4
4
5
-
[KrakenD](https://www.krakend.io/) is a stateless, high-performance, enterprise-ready, opensource API gateway written in Go. Its engine (formerly known as *KrakenD Framework*) is now a **Linux Foundation Project** codenamed [Lura Project](https://luraproject.org/). Lura is the only enterprise-grade API Gateway hosted in a neutral, open forum.
5
+
[KrakenD](https://www.krakend.io/) is a stateless, high-performance, enterprise-ready, open-source API gateway written in Go. Its engine (formerly known as *KrakenD Framework*) is now a **Linux Foundation Project** codenamed [Lura Project](https://luraproject.org/). Lura is the only enterprise-grade API Gateway hosted in a neutral, open forum.
6
6
7
-
KrakenD is very lightweight and simple to use as it only requires to write the configuration file, no Go knowledge is required. It offers connectivity to internal and external services, transformation and filtering of data, aggregation of multiple data sources (APIs, gRPC, queues and pub/sub, lambda, etc) simultaneously or in cascade, protects the access to your API, throughputs its usage, and integrates with a lot of third-parties.
7
+
KrakenD is lightweight and straightforward as it only requires writing the configuration file. No Go knowledge is required. It offers connectivity to internal and external services, transformation and filtering of data, aggregation of multiple data sources (APIs, gRPC, queues and pub/sub, lambda, etc) simultaneously or in cascade, protects the access to your API, throughputs its usage, and integrates with a lot of third-parties.
8
8
9
-
All features are designed to offer awesome performance and infinite scalability.
9
+
All features are designed to offer extraordinary performance and infinite scalability.
10
10
11
11
## How to use this image
12
-
KrakenD only needs a single configuration file to create an API Gateway, although you can have a complex setup reflecting your organization structure. The configuration file(s) can live anywhere in the container but the default location is `/etc/krakend`.
12
+
KrakenD only needs a single configuration file to create an API Gateway, although you can have a complex setup reflecting your organization structure. The configuration file(s) can live anywhere in the container, but the default location is `/etc/krakend`.
13
13
14
-
To use the image, `COPY` your `krakend.json` file inside the container, or mount it using a volume. The configuration is checked only once during the startup and never used again. Don't have a config file yet? Generate it with the [KrakenD Designer UI](https://designer.krakend.io).
14
+
To use the image, `COPY` your `krakend.json` file inside the container or mount it using a volume. The configuration is checked only once during the startup and never used again. Don't have a config file yet? Generate it with the [KrakenD Designer UI](https://designer.krakend.io).
15
15
16
16
⚠️ **NOTICE**: KrakenD does not use live reload when your configuration changes. Restart the container.
17
17
18
18
### Quick start
19
19
You can start an empty gateway with a health check with the following commands:
20
20
21
21
```console
22
-
$ echo'{ "version": 2 }'> krakend.json
22
+
$ echo'{ "version": 3 }'> krakend.json
23
23
$ docker run -d -p 8080:8080 -v "$PWD:/etc/krakend/" %%IMAGE%%
24
24
...
25
25
$ curl http://localhost:8080/__health
26
-
{"status":"ok"}
26
+
{"agents":{},"now":"2022-11-25 14:35:55.552591448 +0000 UTC m=+26.856583003","status":"ok"}
27
27
```
28
28
29
-
30
-
31
29
### More Examples
32
-
The following are several examples of running KrakenD. By default the command `run` is executed, but you can pass
30
+
The following are several examples of running KrakenD. By default, the command `run` is executed, but you can pass
33
31
other commands and flags at the end of the run command.
34
32
35
-
The configuration files are taken from current directory (`$PWD`). All examples expect to find at least the file `krakend.json`.
33
+
The configuration files are taken from the current directory (`$PWD`). Therefore, all examples expect to find at least the file `krakend.json`.
36
34
37
35
#### Run with the debug enabled (flag `-d`):
38
36
This flag is **SAFE to use in production**. It's meant to enable KrakenD as a fake backend itself by enabling a [`/__debug` endpoint](https://www.krakend.io/docs/endpoints/debug-endpoint/)
@@ -49,12 +47,12 @@ See the [check command](https://www.krakend.io/docs/commands/check/)
49
47
```
50
48
#### Show the help:
51
49
52
-
docker run -it -p 8080:8080 -v $PWD:/etc/krakend/ %%IMAGE%% --help
50
+
docker run -it -p 8080:8080 -v $PWD:/etc/krakend/ %%IMAGE%% help
53
51
54
52
55
53
### Building your custom KrakenD image
56
54
57
-
Most production deployments will not want to rely on mounting a volume for the container, but to use their own image based on `%%IMAGE%%`:
55
+
Most production deployments will not want to rely on mounting a volume for the container but to use their image based on `%%IMAGE%%`:
RUN krakend check -d -t -c /etc/krakend/krakend.json
69
67
```
70
68
71
-
If you want to manage your KrakenD configuration using multiple files and folders, reusing templates and distributing the configuration amongst your teams, you can use the [flexible configuration (FC)](https://www.krakend.io/docs/configuration/flexible-config/). The following `Dockerfile` combines FC, the `krakend check` command, and a 2-step build.
69
+
If you want to manage your KrakenD configuration using multiple files and folders, reusing templates, and distributing the configuration amongst your teams, you can use the [flexible configuration (FC)](https://www.krakend.io/docs/configuration/flexible-config/). The following `Dockerfile` combines FC, the `krakend check` command, and a 2-step build.
72
70
73
71
```Dockerfile
74
72
FROM %%IMAGE%%:<version> as builder
75
-
ARG ENV=prod
76
73
77
74
COPY krakend.tmpl .
78
75
COPY config .
@@ -81,26 +78,23 @@ COPY config .
81
78
RUN FC_ENABLE=1 \
82
79
FC_OUT=/tmp/krakend.json \
83
80
FC_PARTIALS="/etc/krakend/partials" \
84
-
FC_SETTINGS="/etc/krakend/settings/$ENV" \
81
+
FC_SETTINGS="/etc/krakend/settings" \
85
82
FC_TEMPLATES="/etc/krakend/templates" \
86
83
krakend check -d -t -c krakend.tmpl
87
84
88
85
# Copy the output file only and discard any other files
All `krakend` commands are executed as `krakend` user (uid=1000) through `su-exec`, and the rest of the commands (e.g., `sh`) are executed as root.
140
+
141
+
You can directly use sub-commands of `krakend` like `run`, `help`, `version`, `check`, `check-plugin` or `validate` as the entrypoint will add the `krakend` command automatically. For example, the following lines are equivalent:
142
+
143
+
docker run -it -p 8080:8080 -v $PWD:/etc/krakend/ %%IMAGE%% help
144
+
docker run -it -p 8080:8080 -v $PWD:/etc/krakend/ %%IMAGE%% krakend help
[documentation](https://www.krakend.io/docs/overview/introduction/), [community support](https://groups.google.com/a/krakend.io/g/community), [open an issue](https://github.com/devopsfaith/krakend-ce/issues), [other support channels](https://www.krakend.io/support/)
1
+
[documentation](https://www.krakend.io/docs/overview/introduction/), [community support](https://groups.google.com/a/krakend.io/g/community), [open an issue](https://github.com/krakendio/krakend-ce/issues), [other support channels](https://www.krakend.io/support/)
0 commit comments