Issue a workload-bound data plane token, install the transparent proxy, and start kuma-dp beside the workload with a Dataplane resource describing its ports. The control plane generates the MeshService from the kuma.io/workload label.
Prerequisites
Series Prerequisites
This page is part of the Get started with Kong Mesh on Universal series.
Complete the previous page, Set up the Kong Mesh control plane before completing this page.
kongctl v1.29.0+
This tutorial uses kongctl to manage Konnect resources programmatically. We recommend keeping kongctl up to date with the latest version (1.29.0).
- Install kongctl from developer.konghq.com/kongctl.
-
Verify the installation:
kongctl version
Issue a data plane token
A Universal proxy proves who it is with a data plane token. Bind it to the proxy’s name and to its workload:
kongctl create mesh dataplane-token \
--control-plane-url "$KONG_MESH_CP" \
--control-plane-token "$KONG_MESH_ADMIN_TOKEN" \
--name kv \
--workload kv \
--valid-for 24h > "$KONG_MESH_DEMO_DIR/token-kv"Start the container
-
Start the container for the
kvservice:docker run \ --detach \ --name kong-mesh-demo-kv \ --hostname kv \ --network kong-mesh-demo \ --ip 172.18.78.2 \ --volume "$KONG_MESH_DEMO_DIR:/demo" \ ghcr.io/kumahq/kuma-counter-demo:debian-slim -
Check that the store is listening on port
5050:docker logs kong-mesh-demo-kvYou should get the following response:
time=2025-03-14T12:17:34.630Z level=INFO ... msg="server running" addr=:5050
Install the sidecar binaries
Run the setup script created in the install step inside the container:
docker exec kong-mesh-demo-kv sh /demo/setup-sidecar.shSet the zone name
Set the zone name that the demo app will need:
docker exec kong-mesh-demo-kv \
curl -s localhost:5050/api/key-value/zone \
--header 'Content-Type: application/json' \
--data '{"value":"local-demo-zone"}'Install the transparent proxy
kumactl install transparent-proxy writes the iptables rules that redirect the container’s
traffic through the sidecar. It needs root and the NET_ADMIN capability.
Run this command only inside the container. It redirects all of the host’s traffic to a data plane proxy, so running it on your own machine or a VM without one can cut off its network access.
Run the following command:
docker exec --privileged kong-mesh-demo-kv \
kumactl install transparent-proxy \
--config /demo/transparent-proxy.yamlThe last line of the output should be:
# transparent proxy setup completed successfully. You can now run kuma-dp with the transparent-proxy feature enabledStart the sidecar
Run kuma-dp in the same container, as the kuma-dp user the iptables rules exclude, pointing
it at the template created in the install step:
docker exec --detach kong-mesh-demo-kv sh -c '
runuser -u kuma-dp -- kuma-dp run \
--cp-address https://control-plane:5678 \
--skip-verify \
--dataplane-file /demo/dataplane.yaml \
--dataplane-var name=kv \
--dataplane-var address=172.18.78.2 \
--dataplane-var port=5050 \
--dataplane-token-file /demo/token-kv \
--transparent-proxy-config /demo/transparent-proxy.yaml \
> /demo/logs-kv.log 2>&1'
--skip-verifyskips TLS verification of the control plane certificate. It is here because the demo control plane uses a self-signed certificate. Never use it outside a demo. Givekuma-dpthe CA with--ca-cert-fileinstead.
In this example:
--dataplane-fileapplies theDataplaneas the proxy starts- The three
--dataplane-varflags fill the template’s placeholders --transparent-proxy-configturns on transparent proxying for this proxy and tells the control plane how the rules are set up- The sidecar’s output goes to
$KONG_MESH_DEMO_DIR/logs-kv.log.
Check that the sidecar is connected
- Check that the
kvdata plane appears in the control plane:kongctl get mesh dataplanes \ --control-plane-url "$KONG_MESH_CP" \ --control-plane-token "$KONG_MESH_ADMIN_TOKEN" -
Check that the
kvdata plane is online:kongctl inspect mesh dataplanes \ --control-plane-url "$KONG_MESH_CP" \ --control-plane-token "$KONG_MESH_ADMIN_TOKEN"If
kvdoesn’t appear, check$KONG_MESH_DEMO_DIR/logs-kv.logfor the reason.
Inspect the generated MeshService
The control plane generates a MeshService from the kuma.io/workload: kv label on the Dataplane, with one port per inbound.
-
Check that the
MeshServicewas created:kongctl get mesh meshservices \ --control-plane-url "$KONG_MESH_CP" \ --control-plane-token "$KONG_MESH_ADMIN_TOKEN" -
Check the generated configuration:
kongctl get mesh meshservices kv -o yaml \ --control-plane-url "$KONG_MESH_CP" \ --control-plane-token "$KONG_MESH_ADMIN_TOKEN"
The selector matches on the workload label, the port carries the protocol you set on the
inbound, and the status reports the VIP and the kv.svc.mesh.local hostname the demo app will
reach it on.