Skip to content

Commit 4b4ff45

Browse files
committed
Add Krakend image
Signed-off-by: Albert Lombarte <[email protected]>
1 parent a8165e8 commit 4b4ff45

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

krakend/content.md

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
[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.
66

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.
88

99
All features are designed to offer extraordinary performance and infinite scalability.
1010

1111
## How to use this image
1212

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`.
1414

1515
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).
1616

@@ -20,10 +20,10 @@ To use the image, `COPY` your `krakend.json` file inside the container or mount
2020

2121
You can start an empty gateway with a health check with the following commands:
2222

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
2727
{"agents":{},"now":"2024-05-23 14:35:55.552591448 +0000 UTC m=+26.856583003","status":"ok"}
2828
```
2929

@@ -37,21 +37,23 @@ The configuration files are taken from the current directory (`$PWD`). Therefore
3737

3838
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/)
3939

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
4242
```
4343

4444
#### Checking the syntax of your configuration file
4545

4646
See the [check command](https://www.krakend.io/docs/commands/check/)
4747

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
5050
```
5151

5252
#### Show the help:
5353

54-
docker run -it %%IMAGE%% help
54+
```bash
55+
docker run --rm -it %%IMAGE%% help
56+
```
5557

5658
### Building your custom KrakenD image
5759

@@ -63,10 +65,10 @@ Your `Dockerfile` could look like this:
6365
FROM %%IMAGE%%:<version>
6466
# NOTE: Avoid using :latest image on production. Stick to a major version instead.
6567

66-
COPY krakend.json /etc/krakend/krakend.json
68+
COPY krakend.json ./
6769

6870
# 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
7072
```
7173

7274
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:
142144

143145
### Container permissions and commands
144146

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.
146148

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:
148150

149-
docker run -it %%IMAGE%% help
150-
docker run -it %%IMAGE%% krakend help
151+
```bash
152+
docker run --rm -it %%IMAGE%% help
153+
docker run --rm -it %%IMAGE%% krakend help
154+
```

0 commit comments

Comments
 (0)