To prepare effectively for the Kong Gateway Certified Associate practical lab, you should practice across the five core domains tested in the hands-on section. Because the grading script evaluates the final state of your Kong Gateway instance, accuracy in entity names, plugin configurations, and declarative syncing is essential.
Below is a comprehensive guide covering five complete exam-style scenarios—spanning declarative configuration, load balancing, security, RBAC, and troubleshooting—with step-by-step solutions and verification checks.
Scenario 1: Declarative Configuration & Traffic Transformation (decK)
Exam Domain: Declarative Management & Traffic Control
Goal: Deploy a service using decK that modifies incoming headers before forwarding requests to the backend.
The Prompt
Create a declarative configuration file named
payments.yamland sync it to Kong Gateway with the following requirements:
1. Define a Service namedpayments-servicepointing tohttp://httpbin.org.
2. Attach a Route namedpayments-routematching the path/v1/paymentsand theHostheaderapi.payments.local.
3. Configure the Request Transformer plugin onpayments-routeso that every forwarded request automatically injects the headerX-Gateway-Source: Kong-Prodand removes any incomingX-Debugheader.
Step-by-Step Solution
- Create
payments.yaml:yaml_format_version: "3.0" services: - name: payments-service url: http://httpbin.org routes: - name: payments-route paths: - /v1/payments hosts: - api.payments.local plugins: - name: request-transformer config: add: headers: - X-Gateway-Source:Kong-Prod remove: headers: - X-DebugUse code with caution. - Validate and Preview the State:bash
deck gateway validate -s payments.yaml deck gateway diff -s payments.yamlUse code with caution. - Apply the Configuration:bash
deck gateway sync -s payments.yamlUse code with caution.(Exam Tip: If other services already exist in the lab environment, use--select-tagor dump the existing state first sodeck gateway syncdoes not delete unrelated exam tasks).
Verification
Send a test request containing the Host header and an X-Debug header:
bash
curl -i http://localhost:8000/v1/payments \
-H "Host: api.payments.local" \
-H "X-Debug: true"
Use code with caution.
Inspect the JSON response from httpbin.org to confirm "X-Gateway-Source": "Kong-Prod" is present and "X-Debug" is absent.
Scenario 2: Load Balancing & Active Health Checks
Exam Domain: Upstreams, Targets & High Availability
Goal: Distribute traffic across multiple backend nodes with weighted routing and automatic failover.
The Prompt
Configure load balancing for a backend microservice called
catalog-api:
1. Create an Upstream namedcatalog-upstream.
2. Enable active HTTP health checks oncatalog-upstreamprobing the/status/200path every 5 seconds. Mark a target healthy after 2 successes and unhealthy after 2 HTTP failures.
3. Add two targets tocatalog-upstream:httpbin.org:80with a weight of 80, andmockbin.org:80with a weight of 20.
4. Create a Service namedcatalog-serviceusinghttp://catalog-upstreamas its host, and expose it via a Route namedcatalog-routeon/catalog.
Step-by-Step Solution
- Create the Upstream with Active Health Checks:bash
curl -i -X POST http://localhost:8001/upstreams \ --data name=catalog-upstream \ --data healthchecks.active.http_path=/status/200 \ --data healthchecks.active.healthy.interval=5 \ --data healthchecks.active.healthy.successes=2 \ --data healthchecks.active.unhealthy.interval=5 \ --data healthchecks.active.unhealthy.http_failures=2Use code with caution. - Add the Weighted Targets:bash
curl -i -X POST http://localhost:8001/upstreams/catalog-upstream/targets \ --data target=httpbin.org:80 \ --data weight=80 curl -i -X POST http://localhost:8001/upstreams/catalog-upstream/targets \ --data target=mockbin.org:80 \ --data weight=20Use code with caution. - Create the Service and Route:bash
curl -i -X POST http://localhost:8001/services \ --data name=catalog-service \ --data host=catalog-upstream \ --data path=/anything curl -i -X POST http://localhost:8001/services/catalog-service/routes \ --data name=catalog-route \ --data "paths[]=/catalog"Use code with caution.
Verification
Check target health status via the Admin API:
bash
curl -s http://localhost:8001/upstreams/catalog-upstream/health | jq
Use code with caution.
Confirm both targets report "health": "HEALTHY" once the initial probes complete.
Scenario 3: Multi-Tier Consumer Security (JWT + ACL)
Exam Domain: Authentication & Access Control
Goal: Restrict an API route so only authenticated consumers belonging to a specific group can access it.
The Prompt
Protect an existing Service named
reports-service(exposed on/reports):
1. Enable the JWT plugin onreports-service.
2. Enable the ACL plugin onreports-serviceso only consumers in thefinance-teamgroup are allowed.
3. Create a Consumer namedalice, assign her to thefinance-teamACL group, and create a JWT credential for her with keyalice-issuerand secretsuper-secret-jwt-key.
Step-by-Step Solution
- Enable JWT and ACL Plugins on the Service:bash
curl -i -X POST http://localhost:8001/services/reports-service/plugins \ --data name=jwt curl -i -X POST http://localhost:8001/services/reports-service/plugins \ --data name=acl \ --data "config.allow[]=finance-team"Use code with caution. - Create Consumer
aliceand Assign ACL Group:bashcurl -i -X POST http://localhost:8001/consumers \ --data username=alice curl -i -X POST http://localhost:8001/consumers/alice/acls \ --data group=finance-teamUse code with caution. - Create the JWT Credential:bash
curl -i -X POST http://localhost:8001/consumers/alice/jwt \ --data key=alice-issuer \ --data secret=super-secret-jwt-keyUse code with caution.
Verification
- A request without a token (
curl -i http://localhost:8000/reports) must return401 Unauthorized. - A request with a valid HS256 JWT signed with
super-secret-jwt-keyand"iss": "alice-issuer"in the payload (curl -i http://localhost:8000/reports -H "Authorization: Bearer <token>") must return200 OK.
Scenario 4: Workspaces & Role-Based Access Control (RBAC)
Exam Domain: Kong Enterprise Governance & Administration
Goal: Isolate team resources into a dedicated workspace and grant least-privilege admin access.
The Prompt
A new development team needs an isolated workspace to manage their own APIs:
1. Create a Workspace namedmobile-team.
2. Insidemobile-team, create a Role namedmobile-dev.
3. Grant themobile-devrole full CRUD (create,read,update,delete) permissions on/services/*and/routes/*within themobile-teamworkspace.
4. Create an RBAC User nameddev-leadwith the tokenmobile-token-999and assign themobile-devrole to this user.
Step-by-Step Solution
- Create the Workspace:bash
curl -i -X POST http://localhost:8001/workspaces \ --data name=mobile-teamUse code with caution. - Create the Role inside the
mobile-teamWorkspace:bashcurl -i -X POST http://localhost:8001/mobile-team/rbac/roles \ --data name=mobile-devUse code with caution. - Add Endpoint Permissions to the Role:bash
curl -i -X POST http://localhost:8001/mobile-team/rbac/roles/mobile-dev/endpoints \ --data endpoint=/services/* \ --data actions=create,read,update,delete curl -i -X POST http://localhost:8001/mobile-team/rbac/roles/mobile-dev/endpoints \ --data endpoint=/routes/* \ --data actions=create,read,update,deleteUse code with caution. - Create the RBAC User and Attach the Role:bash
curl -i -X POST http://localhost:8001/rbac/users \ --data name=dev-lead \ --data user_token=mobile-token-999 curl -i -X POST http://localhost:8001/mobile-team/rbac/users/dev-lead/roles \ --data roles=mobile-devUse code with caution.
Verification
Test RBAC enforcement using the new user’s token:
- Listing services in
mobile-teamsucceeds (200 OK):bashcurl -i http://localhost:8001/mobile-team/services -H "Kong-Admin-Token: mobile-token-999"Use code with caution. - Listing consumers or accessing the
defaultworkspace fails (403 Forbidden):bashcurl -i http://localhost:8001/default/services -H "Kong-Admin-Token: mobile-token-999"Use code with caution.
Scenario 5: Troubleshooting Broken Routing & Plugin Conflicts
Exam Domain: Diagnostics & Debugging
Goal: Identify why an existing API returns 404 or 401 errors and resolve the misconfigurations.
The Prompt
Users report two issues with the
shipping-api:
1. Requests tohttp://localhost:8000/shipping/trackreturn404 Not Foundfrom the upstream backend, even though the backend expects/track.
2. Internal monitoring scripts sending requests withX-Api-Key: monitor-123receive401 Unauthorized.
Diagnose both issues and resolve them.
Step-by-Step Diagnostic & Fix
- Inspect the Route Configuration:bash
curl -s http://localhost:8001/routes | jqUse code with caution.- Finding 1: On
shipping-route(matching/shipping),strip_pathis set tofalse. Consequently, Kong forwards/shipping/trackto the backend instead of stripping/shippingand forwarding/track. - Fix 1: Patch the route to enable
strip_path:bashcurl -i -X PATCH http://localhost:8001/routes/shipping-route \ --data strip_path=trueUse code with caution.
- Finding 1: On
- Inspect Active Plugins on the Service and Route:bash
curl -s http://localhost:8001/plugins | jqUse code with caution.- Finding 2: The
key-authplugin hasconfig.key_namesconfigured as["apikey"](the default), so Kong ignores the customX-Api-Keyheader sent by the monitoring script. - Fix 2: Patch the plugin to accept both
apikeyandX-Api-Key:bashcurl -i -X PATCH http://localhost:8001/plugins/<key-auth-plugin-id> \ --data "config.key_names[]=apikey" \ --data "config.key_names[]=X-Api-Key"Use code with caution.
- Finding 2: The
Verification
Run the monitoring request again:
bash
curl -i http://localhost:8000/shipping/track -H "X-Api-Key: monitor-123"
Use code with caution.
Confirm the gateway authenticates the header and routes /track cleanly (200 OK).
Exam Day Best Practices for Practical Tasks
- Never wipe the entire gateway accidentally: Before running
deck gateway sync, always check whether other tasks share the same Kong instance. Dump the current configuration (deck gateway dump -o backup.yaml) before making major changes. - Watch out for
strip_pathdefaults: Via the Admin API,strip_pathdefaults totrueon HTTP routes, whereas declarative files or modified routes may behave differently if explicitly overridden. Always verify the exact path forwarded to the upstream. - Use
jqfor rapid inspection: Piping Admin API responses intojq(curl -s http://localhost:8001/plugins | jq) makes finding IDs and spotting typos in pluginconfigblocks significantly faster.