Universal data plane

Uses: Kong Mesh
Related Documentation
Minimum Version
Kong Mesh - 3.0
Previous Versions of this page

On Universal a proxy is made up of two pieces:

  • A Dataplane resource describing what the workload exposes and consumes
  • A kuma-dp process running beside it

Kubernetes derives both from a Pod. On Universal, you declare them.

Minimal proxy configuration

The Dataplane resource:

type: Dataplane
mesh: default
name: backend-01
labels:
  kuma.io/workload: backend
  app: backend
networking:
  address: 10.0.0.11
  inbound:
    - port: 8080
      name: http
      protocol: http

Apply it with:

kongctl apply mesh -f backend-01.yaml

Then issue a token:

kongctl create mesh dataplane-token --name backend-01 --workload backend --valid-for 24h > /etc/kuma/token

Start the process:

kuma-dp run \
  --cp-address https://control-plane.internal:5678 \
  --dataplane-file backend-01.yaml \
  --dataplane-token-file /etc/kuma/token

--dataplane-file applies the resource as the proxy starts, so the two steps can collapse into one. Applying it ahead of time suits configuration management; passing it inline suits an immutable image that templates the file at boot.

Labels and policy selection

labels on the Dataplane are the only identity a policy can select on:

Label

Effect

kuma.io/workload Names the workload this proxy belongs to. The control plane generates one MeshService per distinct value, and the SPIFFE ID defaults to /workload/{value}. Without it, the control plane generates no MeshService and the workload has nothing for a policy or route to target. It must be a valid RFC 1035 DNS label.
Your own labels Anything else you set (app, version, team) is what spec.targetRef.labels and MeshService.spec.selector.dataplaneLabels match on.

Inbounds

Each entry in networking.inbound[] is a port the workload serves.

Field

Meaning

port The port. With transparent proxying, the port the application listens on; without it, the port Envoy binds.
name The name of the port, which is what a policy’s sectionName refers to. Defaults to the port number as a string.
protocol tcp, http, http2, or grpc.

An inbound with no protocol is treated as unknown and served as plain TCP. It loses every L7 filter:

  • MeshTimeout’s HTTP timeouts
  • MeshFaultInjection entirely
  • MeshRateLimit’s HTTP limits
  • HTTP access log fields
  • HTTP-aware routing

Nothing rejects the Dataplane, so the only sign is the policies quietly not applying.

servicePort Where traffic is forwarded, if it differs from port.
serviceAddress The address traffic is forwarded to, if the application isn’t on networking.address.
state Ready or NotReady.

networking.address must be a real address: not empty, and not 0.0.0.0 or ::. The admin port, if set, has to differ from every inbound and outbound port.

Outbounds

With transparent proxying on, you list destinations in transparentProxying.reachableBackends instead of binding ports. Without it, each destination the workload calls needs an entry that binds a local port.

networking:
  address: 10.0.0.11
  inbound:
    - port: 8080
      name: http
      protocol: http
  outbound:
    - port: 5432
      backendRef:
        kind: MeshService
        name: postgres
        port: 5432

The application then connects to 127.0.0.1:5432 and the proxy carries it to the destination.

backendRef is required. kind can be MeshService, MeshExternalService, or MeshMultiZoneService, and the reference takes at least one of name or labels. If both are set, labels wins. port is required unless kind is MeshExternalService.

Transparent proxying

Transparent proxying intercepts the workload’s traffic, and is what makes a Universal proxy behave like a Kubernetes sidecar. It needs iptables rules on the host.

Install them as root with kumactl install transparent-proxy, which excludes the user kuma-dp runs as (by default the user kuma-dp or UID 5678, which must already exist):

sudo kumactl install transparent-proxy --kuma-dp-user kuma-dp

Then start kuma-dp as that user with the --transparent-proxy flag:

sudo runuser -u kuma-dp -- kuma-dp run \
  --cp-address https://control-plane.internal:5678 \
  --dataplane-file backend-01.yaml \
  --dataplane-token-file /etc/kuma/token \
  --transparent-proxy

To customize the redirect ports, excluded ports, and DNS redirection, write them to a config file:

kumaDPUser: kuma-dp
redirect:
  inbound:
    port: 15006
    excludePorts: [9901]
  outbound:
    port: 15001
    excludePorts: [5432]
  dns:
    enabled: true

Pass the file to kumactl install transparent-proxy with --config:

sudo kumactl install transparent-proxy --config /etc/kuma/transparent-proxy.yaml

Then pass the same file to kuma-dp with --transparent-proxy-config in place of --transparent-proxy, so the control plane knows the redirect ports:

sudo runuser -u kuma-dp -- kuma-dp run \
  --cp-address https://control-plane.internal:5678 \
  --dataplane-file backend-01.yaml \
  --dataplane-token-file /etc/kuma/token \
  --transparent-proxy-config /etc/kuma/transparent-proxy.yaml

--transparent-proxy-config takes a file, a comma-separated list of files, or - for stdin, and can be repeated (later values override earlier ones).

With transparent proxying on, the embedded DNS proxy (--dns-enabled, on by default) lets the workload resolve mesh hostnames. The workload reaches destinations by name rather than by a local port.

reachableBackends lists what the proxy can reach. Without it (and without outbounds), the proxy reaches nothing, unless the control plane sets KUMA_DEFAULTS_RESTRICT_OUTBOUND=false. The proxy also drops destinations outside the mesh unless a MeshExternalService or a MeshPassthrough policy allows them.

networking:
  transparentProxying:
    reachableBackends:
      refs:
        - kind: MeshService
          labels:
            kuma.io/display-name: postgres
          port: 5432
        - kind: MeshService
          labels:
            app: orders

Each ref takes kind and labels. Select a destination by name with the kuma.io/display-name label. port is optional and requires labels.

Readiness

Kubernetes reports readiness from the Pod probe. On Universal, either report it from outside, or have the proxy probe the application:

networking:
  inbound:
    - port: 8080
      name: http
      protocol: http
      serviceProbe:
        tcp: {}
        interval: 5s
        timeout: 2s
        unhealthyThreshold: 3
        healthyThreshold: 1

The control plane excludes an inbound the proxy considers unhealthy from endpoint discovery, so traffic stops reaching it. An inbound with no serviceProbe and no reported health is treated as healthy.

Zone proxies

An ordinary Dataplane that declares zone proxy listeners carries cross-zone traffic:

type: Dataplane
mesh: default
name: zone-ingress-01
networking:
  address: 10.0.0.20
  listeners:
    - type: ZoneIngress
      address: 10.0.0.20
      port: 10001
      name: ingress

type can be ZoneIngress or ZoneEgress. Listeners can sit alongside inbounds on the same Dataplane.

These proxies authenticate with a data plane token.

Tokens

A data plane token proves which proxy is connecting. Bind it as narrowly as the deployment allows:

  • Bind it to one named proxy of a workload:

    kongctl create mesh dataplane-token --name backend-01 --workload backend --valid-for 24h
  • Bind it to a workload, for an autoscaling group whose instance names vary:

    kongctl create mesh dataplane-token --workload backend --valid-for 24h

Once a MeshIdentity derives the proxy’s identity from kuma.io/workload, the token must carry --workload. Proxies that are already connected keep running until they reconnect, so bind tokens to the workload from the start. --tag matches the Dataplane’s labels, and --valid-for bounds the lifetime.

The token goes to kuma-dp as --dataplane-token-file. kongctl writes it with no trailing newline so it can be redirected straight into that file.

Generated resources

Once the Dataplane is applied and the proxy is connected, the zone control plane generates the MeshService for its kuma.io/workload value, allocates a VIP and hostname, and creates the matching Workload resource (checked every two seconds by default). Make sure to always keep the Dataplane resources accurate.

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!