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

docs(DEVELOPER.md): add how to set up hybrid mode #11517

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 50 additions & 0 deletions DEVELOPER.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,13 @@ macOS
brew install libyaml
```

Now, we have to set environment variable `GITHUB_TOKEN` to download some essential repos.
You can follow [Managing your personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens) to generate an access token.

```bash
# export GITHUB_TOKEN=ghp_xxxxxx_your_access_token
```

Finally, we start the build process:

```
Expand Down Expand Up @@ -320,6 +327,49 @@ When developing, you can use the `Makefile` for doing the following operations:
| `test-plugins` | Run the plugins test suite |
| `test-all` | Run all unit + integration + plugins tests at once |

### Setup Hybrid Mode Development Environment

You can follow the steps given below to setup a hybrid mode environment.

1. Activate the venv

```bash
# . bazel-bin/build/kong-dev-venv.sh
```

2. Following [Deploy Kong Gateway in Hybrid Mode: Generate certificate/key pair](https://docs.konghq.com/gateway/latest/production/deployment-topologies/hybrid-mode/setup/#generate-a-certificatekey-pair) to generate a certificate/key pair.

3. Create CP and DP configuration files, such as `kong-cp.conf` and `kong-dp.conf`.

4. Following [Deploy Kong Gateway in Hybrid Mode: CP Configuration](https://docs.konghq.com/gateway/latest/production/deployment-topologies/hybrid-mode/setup/#set-up-the-control-plane) to configure CP using `kong.conf`.

5. Following [Deploy Kong Gateway in Hybrid Mode: DP Configuration](https://docs.konghq.com/gateway/latest/production/deployment-topologies/hybrid-mode/setup/#install-and-start-data-planes) to configure DP using `kong.conf`.

6. Unset environment variable `KONG_PREFIX` to ensure configuration directive `prefix` in configuration file is enabled.

7. Modify or add the directive `prefix` to `kong-cp.conf` and `kong-dp.conf`
to be `prefix=servroot-cp` and `prefix=servroot-dp`,
or other names you want, but make sure they are different.

8. Use the pre-defined docker-compose file to bring up databases, etc.

```bash
# start_services
```

9. If it is the first time to start Kong, you have to execute the following command to CP node.

```bash
# kong migrations bootstrap -c kong-cp.conf
```

10. Start CP and DP. `kong start -c kong-cp.conf` and `kong start -c kong-dp.conf`.

11. To stop CP and DP, you can execute `kong stop -p servroot-cp` and
`kong stop -p servroot-dp` in this example.
Names `servroot-cp` and `servroot-dp` are set in configuration file in step 7.



## Dev on Linux (Host/VM)

Expand Down