diff --git a/app/_data/docs_nav_deck_1.10.x.yml b/app/_data/docs_nav_deck_1.10.x.yml index a9eb63015e44..d9196b8fd00b 100644 --- a/app/_data/docs_nav_deck_1.10.x.yml +++ b/app/_data/docs_nav_deck_1.10.x.yml @@ -38,6 +38,8 @@ items: url: /guides/best-practices - text: Using decK with Kong Gateway (Enterprise) url: /guides/kong-enterprise + - text: Run decK with Docker + url: /guides/run-with-docker - text: Using Multiple Files to Store Configuration url: /guides/multi-file-state - text: De-duplicate Plugin Configuration diff --git a/app/_data/docs_nav_deck_1.11.x.yml b/app/_data/docs_nav_deck_1.11.x.yml index 0385b496d819..4db8bf612871 100644 --- a/app/_data/docs_nav_deck_1.11.x.yml +++ b/app/_data/docs_nav_deck_1.11.x.yml @@ -38,6 +38,8 @@ items: url: /guides/best-practices - text: Using decK with Kong Gateway (Enterprise) url: /guides/kong-enterprise + - text: Run decK with Docker + url: /guides/run-with-docker - text: Using Multiple Files to Store Configuration url: /guides/multi-file-state - text: De-duplicate Plugin Configuration diff --git a/app/_data/docs_nav_deck_1.12.x.yml b/app/_data/docs_nav_deck_1.12.x.yml index 6e5b5d913b1d..82a8fe97fed0 100644 --- a/app/_data/docs_nav_deck_1.12.x.yml +++ b/app/_data/docs_nav_deck_1.12.x.yml @@ -42,6 +42,8 @@ items: url: /guides/kong-enterprise - text: Using decK with Konnect url: /guides/konnect + - text: Run decK with Docker + url: /guides/run-with-docker - text: Using Multiple Files to Store Configuration url: /guides/multi-file-state - text: De-duplicate Plugin Configuration diff --git a/app/_data/docs_nav_deck_1.13.x.yml b/app/_data/docs_nav_deck_1.13.x.yml index 32aa1210ba15..8eb2a61a00bf 100644 --- a/app/_data/docs_nav_deck_1.13.x.yml +++ b/app/_data/docs_nav_deck_1.13.x.yml @@ -40,6 +40,8 @@ items: url: /guides/kong-enterprise - text: Using decK with Konnect url: /guides/konnect + - text: Run decK with Docker + url: /guides/run-with-docker - text: Using Multiple Files to Store Configuration url: /guides/multi-file-state - text: De-duplicate Plugin Configuration diff --git a/app/_data/docs_nav_deck_1.14.x.yml b/app/_data/docs_nav_deck_1.14.x.yml index e9c997bb6a60..fa0eb75a36f5 100644 --- a/app/_data/docs_nav_deck_1.14.x.yml +++ b/app/_data/docs_nav_deck_1.14.x.yml @@ -40,6 +40,8 @@ items: url: /guides/kong-enterprise - text: Using decK with Konnect url: /guides/konnect + - text: Run decK with Docker + url: /guides/run-with-docker - text: Using Multiple Files to Store Configuration url: /guides/multi-file-state - text: De-duplicate Plugin Configuration diff --git a/app/_data/docs_nav_deck_1.15.x.yml b/app/_data/docs_nav_deck_1.15.x.yml index c00aa552c243..a91b6f727c2e 100644 --- a/app/_data/docs_nav_deck_1.15.x.yml +++ b/app/_data/docs_nav_deck_1.15.x.yml @@ -42,6 +42,8 @@ items: url: /guides/kong-enterprise - text: Using decK with Konnect url: /guides/konnect + - text: Run decK with Docker + url: /guides/run-with-docker - text: Using Multiple Files to Store Configuration url: /guides/multi-file-state - text: De-duplicate Plugin Configuration diff --git a/app/_data/docs_nav_deck_1.16.x.yml b/app/_data/docs_nav_deck_1.16.x.yml index 51cf2192aeca..03b2c0e0fb46 100644 --- a/app/_data/docs_nav_deck_1.16.x.yml +++ b/app/_data/docs_nav_deck_1.16.x.yml @@ -42,6 +42,8 @@ items: url: /guides/kong-enterprise - text: Using decK with Konnect url: /guides/konnect + - text: Run decK with Docker + url: /guides/run-with-docker - text: Using Multiple Files to Store Configuration url: /guides/multi-file-state - text: De-duplicate Plugin Configuration diff --git a/app/_data/docs_nav_deck_1.7.x.yml b/app/_data/docs_nav_deck_1.7.x.yml index faa0bf590f8b..8d21ce86fa13 100644 --- a/app/_data/docs_nav_deck_1.7.x.yml +++ b/app/_data/docs_nav_deck_1.7.x.yml @@ -38,6 +38,8 @@ items: url: /guides/best-practices - text: Using decK with Kong Gateway (Enterprise) url: /guides/kong-enterprise + - text: Run decK with Docker + url: /guides/run-with-docker - text: Using Multiple Files to Store Configuration url: /guides/multi-file-state - text: De-duplicate Plugin Configuration diff --git a/app/_data/docs_nav_deck_1.8.x.yml b/app/_data/docs_nav_deck_1.8.x.yml index cc4f98ddbea1..113242bcd994 100644 --- a/app/_data/docs_nav_deck_1.8.x.yml +++ b/app/_data/docs_nav_deck_1.8.x.yml @@ -38,6 +38,8 @@ items: url: /guides/best-practices - text: Using decK with Kong Gateway (Enterprise) url: /guides/kong-enterprise + - text: Run decK with Docker + url: /guides/run-with-docker - text: Using Multiple Files to Store Configuration url: /guides/multi-file-state - text: De-duplicate Plugin Configuration diff --git a/app/_data/docs_nav_deck_1.9.x.yml b/app/_data/docs_nav_deck_1.9.x.yml index 5090fe6565d7..a6aeeb6be2c8 100644 --- a/app/_data/docs_nav_deck_1.9.x.yml +++ b/app/_data/docs_nav_deck_1.9.x.yml @@ -38,6 +38,8 @@ items: url: /guides/best-practices - text: Using decK with Kong Gateway (Enterprise) url: /guides/kong-enterprise + - text: Run decK with Docker + url: /guides/run-with-docker - text: Using Multiple Files to Store Configuration url: /guides/multi-file-state - text: De-duplicate Plugin Configuration diff --git a/src/deck/guides/run-with-docker.md b/src/deck/guides/run-with-docker.md new file mode 100644 index 000000000000..fdf50e728451 --- /dev/null +++ b/src/deck/guides/run-with-docker.md @@ -0,0 +1,63 @@ +--- +title: Run decK with Docker +content_type: how-to +--- + +If you used the `kong/deck` Docker image to install decK, you can use the Docker image to manage decK. + +## Prerequisites +decK must be installed using a [Docker image](/deck/latest/installation/#docker-image). + +## Export the configuration +Run this command to export the `kong.yaml` file: + +```bash +docker run -i \ +-v $(pwd):/deck \ +kong/deck --kong-addr http://KONG_ADMIN_HOST:KONG_ADMIN_PORT --headers kong-admin-token:KONG_ADMIN_TOKEN -o /deck/kong.yaml dump +``` +Where `$(pwd)/kong.yaml` is the path to a `kong.yaml` file. + +## Export objects from all workspaces +Run this command to export objects from all the workspaces: + +```bash +docker run -i \ +-v $(pwd):/deck \ +--workdir /deck \ +kong/deck --kong-addr http://KONG_ADMIN_HOST:KONG_ADMIN_PORT:8001 --headers kong-admin-token:KONG_ADMIN_TOKEN dump --all-workspaces +``` + +## Reset the configuration +Run this command to initialize Kong objects: + +```bash +docker run -i \ +-v $(pwd):/deck \ +kong/deck --kong-addr http://KONG_ADMIN_HOST:KONG_ADMIN_PORT:8001 --headers kong-admin-token:KONG_ADMIN_TOKEN reset +``` + +## Import the configuration +Run this command to import `kong.yaml`: + +```bash +docker run -i \ +-v $(pwd):/deck \ +kong/deck --kong-addr http://KONG_ADMIN_HOST:KONG_ADMIN_PORT:8001 --headers kong-admin-token:KONG_ADMIN_TOKEN -s /deck/kong.yaml sync +``` +In this example, `kong.yaml` is in `$(pwd)/kong.yaml`. + +## View help manual pages +Run this command to view all available commands: + +```bash +docker run kong/deck --help +``` + +Run the following to check available command flags: + +```bash +docker run kong/deck dump --help +docker run kong/deck sync --help +docker run kong/deck reset --help +``` \ No newline at end of file diff --git a/src/deck/installation.md b/src/deck/installation.md index 8bb1429101d5..4159db986fbd 100644 --- a/src/deck/installation.md +++ b/src/deck/installation.md @@ -51,3 +51,7 @@ decK can read the files during diff/sync procedures. If you're integrating decK into your CI system, you can either install decK into the system itself, use the Docker based environment, or pull the binaries from [Github](https://github.com/Kong/deck/releases) for each job. + +## See also +For more information about how to manage decK using the Docker image, see [Run decK with Docker](/deck/{{page.kong_version}}/guides/run-with-docker). +