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
+21-17Lines changed: 21 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -4,13 +4,13 @@
4
4
5
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 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.
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, data transformation and filtering, and aggregation of multiple data sources (APIs, gRPC, queues and pub/sub, lambda, etc.) simultaneously or in cascade. It protects access to your API, throughputs its usage, and integrates with many third-parties.
8
8
9
9
All features are designed to offer extraordinary performance and infinite scalability.
10
10
11
11
## How to use this image
12
12
13
-
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
+
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 (the workdir) is `/etc/krakend`.
14
14
15
15
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).
16
16
@@ -20,10 +20,10 @@ To use the image, `COPY` your `krakend.json` file inside the container or mount
20
20
21
21
You can start an empty gateway with a health check with the following commands:
22
22
23
-
```console
24
-
$ docker run -d -p 8080:8080 -v "$PWD:/etc/krakend/" %%IMAGE%%
25
-
...
26
-
$ curl http://localhost:8080/__health
23
+
```bash
24
+
docker run -d -p 8080:8080 -v "$PWD:/etc/krakend/" %%IMAGE%%
25
+
26
+
curl http://localhost:8080/__health
27
27
{"agents":{},"now":"2024-05-23 14:35:55.552591448 +0000 UTC m=+26.856583003","status":"ok"}
28
28
```
29
29
@@ -37,21 +37,23 @@ The configuration files are taken from the current directory (`$PWD`). Therefore
37
37
38
38
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/)
39
39
40
-
```console
41
-
docker run -p 8080:8080 -v "${PWD}:/etc/krakend/" %%IMAGE%% run -d -c /etc/krakend/krakend.json
40
+
```bash
41
+
docker run -p 8080:8080 -v "${PWD}:/etc/krakend/" %%IMAGE%% run -d -c /etc/krakend/krakend.json
42
42
```
43
43
44
44
#### Checking the syntax of your configuration file
45
45
46
46
See the [check command](https://www.krakend.io/docs/commands/check/)
47
47
48
-
```console
49
-
docker run -it -v $PWD:/etc/krakend/ %%IMAGE%% check --config krakend.json
48
+
```bash
49
+
docker run -it -v $PWD:/etc/krakend/ %%IMAGE%% check --config krakend.json
50
50
```
51
51
52
52
#### Show the help:
53
53
54
-
docker run -it %%IMAGE%% help
54
+
```bash
55
+
docker run --rm -it %%IMAGE%% help
56
+
```
55
57
56
58
### Building your custom KrakenD image
57
59
@@ -63,10 +65,10 @@ Your `Dockerfile` could look like this:
63
65
FROM %%IMAGE%%:<version>
64
66
# NOTE: Avoid using :latest image on production. Stick to a major version instead.
65
67
66
-
COPY krakend.json /etc/krakend/krakend.json
68
+
COPY krakend.json ./
67
69
68
70
# Check and test that the file is valid
69
-
RUN krakend check -d -t -c /etc/krakend/krakend.json
71
+
RUN krakend check -t --lint-no-network -c krakend.json
70
72
```
71
73
72
74
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.
@@ -142,9 +144,11 @@ services:
142
144
143
145
### Container permissions and commands
144
146
145
-
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.
147
+
All `krakend` commands are executed as `krakend` user (uid=1000), and the rest of the commands (e.g., `sh`) are executed as root.
146
148
147
-
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:
149
+
You can directly use sub-commands of `krakend` like `run`, `help`, `version`, `check`, `check-plugin`, or `test-plugin` as the entrypoint will add the `krakend` command automatically. For example, the following lines are equivalent:
0 commit comments