Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCU-1924] New "Manage decK with Docker" page #4124

Merged
merged 10 commits into from
Nov 15, 2022
2 changes: 2 additions & 0 deletions app/_data/docs_nav_deck_1.10.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions app/_data/docs_nav_deck_1.11.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions app/_data/docs_nav_deck_1.12.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions app/_data/docs_nav_deck_1.13.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions app/_data/docs_nav_deck_1.14.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions app/_data/docs_nav_deck_1.15.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions app/_data/docs_nav_deck_1.16.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions app/_data/docs_nav_deck_1.7.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions app/_data/docs_nav_deck_1.8.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions app/_data/docs_nav_deck_1.9.x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
63 changes: 63 additions & 0 deletions src/deck/guides/run-with-docker.md
Original file line number Diff line number Diff line change
@@ -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
```
4 changes: 4 additions & 0 deletions src/deck/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).