Document updated on Dec 7, 2021
Automated KrakenD deployments with CI/CD
KrakenD operates with its single binary and your associated configuration. Therefore, your build process or CI/CD pipeline only needs to ensure that the configuration file is correct. These are a few recommendations to a safes KrakenD deployment:
- Make sure the configuration file is valid. When using Flexible Configuration, generate the final
krakend.json
usingFC_OUT
as the final artifact - Optional - Generate an immutable docker image
- Optional - Run integration tests
- Deploy the new configuration
There are several ways to automate KrakenD deployments, but you must always test your configuration before applying it in production. You’ll find a few notes that might help you automate this process in this document.
For the first step, the check
command is a must in any CI/CD pipeline or pre-deploy process to ensure you don’t put a broken setup in production that results in downtime. The check
command lets you find broken configurations before going live. Add a line like the following in your release process:
Recommended file check for CI/CD
$krakend check -t -d -c /path/to/krakend.json
The command above will stop the pipeline (exit 1
) if it fails or continue if the configuration is correct. Make sure to always place it in your build/deploy process.