The following kongctl commands are available for Kong Mesh.
For more information, see the kongctl docs.
List every resource type this control plane serves:
kongctl get mesh resource-types
List all resources of one type, in the default mesh:
kongctl get mesh meshtimeouts
Read one resource, as YAML:
kongctl get mesh meshtimeouts "$POLICY_NAME" -o yaml
List resources across every mesh:
kongctl get mesh meshtrafficpermissions --all-meshes
You can give a type as its plural name, its singular, or its short alias: meshtrafficpermissions,
meshtrafficpermission and mtp all work, and matching is case-insensitive.
resource-types lists the aliases.
Apply one file:
kongctl apply mesh -f policy.yaml
Apply every resource in a directory:
kongctl apply mesh -f ./policies
Apply from stdin:
cat policy.yaml | kongctl apply mesh -f -
apply mesh creates or replaces each resource, so re-applying a file is how you edit a resource. Each
resource carries its own type, name and mesh, so one file or directory can span types and
meshes.
Delete a resource in the default mesh:
kongctl delete mesh meshtrafficpermission "$POLICY_NAME"
Delete a resource in another mesh with -m:
kongctl delete mesh meshtimeout "$POLICY_NAME" -m "$MESH_NAME"
Use the --auto-approve flag to skip the confirmation prompt.
get mesh reads resources back as they were written. inspect provides the state of resources once matching and merging have run.
Show which policies apply to a proxy, and on which of its ports:
kongctl inspect mesh dataplane "$DATAPLANE_NAME"
Show which proxies a policy matches:
kongctl inspect mesh meshtimeout "$POLICY_NAME"
Get an overview of all data plane proxies:
kongctl inspect mesh dataplanes
Get an overview of all meshes:
kongctl inspect mesh meshes
Get an overview of all zones:
kongctl inspect mesh zones
inspect dataplane reports per port rather than per proxy, because that is where a policy
actually lands:
PORT KIND ORIGINS
admin-ssl MeshTimeout kri_mt_default___mesh-wide-timeout_
proxy MeshTimeout kri_mt_default___mesh-wide-timeout_
postgres MeshTimeout kri_mt_default___outbound-timeout_
--type reaches the proxy’s own Envoy configuration instead of the control plane’s view:
|
--type
|
Reports
|
policies
|
The policies the control plane matched to each port. The default, and the only one that doesn’t need the proxy reachable.
|
stats
|
Envoy statistics.
|
clusters
|
The proxy’s clusters.
|
xds
|
The xDS configuration dump.
|
config
|
The proxy’s configuration.
|
Everything but policies is relayed from the proxy’s Envoy admin interface verbatim, so it
needs the zone connected to the control plane and the proxy reachable from the zone.
Export control plane configuration:
kongctl dump mesh > mesh.yaml
dump mesh covers every mesh on the control plane and writes resources in the same shape
apply mesh reads. --export-profile selects which resource types to export:
|
--export-profile
|
Exports
|
Leaves out
|
federation (default)
|
Mesh, Secret, GlobalSecret, HostnameGenerator, MeshIdentity, MeshTrust, MeshExternalService, MeshMultiZoneService and MeshOpenTelemetryBackend.
|
Policies, and the resources each zone creates for itself: Dataplane, Workload, MeshService, MeshZoneAddress, Zone, and every insight type.
|
federation-with-policies
|
Everything in federation, and every policy.
|
The same zone-created resources as federation.
|
no-dataplanes
|
Every resource type the control plane serves, including read-only insight types.
|
Dataplane and DataplaneInsight.
|
all
|
Every resource type the control plane serves, including Dataplane and read-only insight types.
|
Nothing.
|
The two federation profiles prepare the export to be applied to a new global control plane:
they remove control-plane-owned labels, such as kuma.io/origin, kuma.io/zone and
kuma.io/display-name, so the new control plane sets its own. They keep kuma.io/mesh.
all and no-dataplanes keep every label and include read-only resources. They describe a
control plane rather than seed one, so they can’t necessarily be applied back unchanged.
Every profile leaves out the envoy-admin-ca and inter-cp-ca global secrets, which secure
traffic between control planes and break TLS if applied to another one. Any
user-token-signing-key global secret goes last in the stream, because applying it invalidates
the token used to apply everything else.
An export can contain secrets. Store it somewhere appropriate for credentials.
Issue a token a data plane uses to prove its identity:
kongctl create mesh dataplane-token --name "$DATAPLANE_NAME" --workload "$WORKLOAD_NAME" --valid-for 24h > token
Issue a token for a zone control plane:
kongctl create mesh zone-token --zone "$ZONE_NAME" --valid-for 720h > token
Both write the token to stdout with no trailing newline, so the output can be redirected
straight into the file that kuma-dp or the zone control plane reads.
Bind a data plane token as narrowly as the deployment allows rather than to the mesh alone.
Once a MeshIdentity derives identities from the
kuma.io/workload label, the control plane rejects a proxy carrying that label unless
its token is bound with --workload. A token bound only by --name, or only to the mesh, no
longer authenticates it.
|
Flag
|
Binds the token to
|
--name
|
One named data plane.
|
--workload
|
A workload label value the data plane must carry.
|
--tag
|
Label values the data plane must carry. Repeatable; comma-separate multiple values for one label.
|
--proxy-type
|
The proxy type, for example dataplane.
|
--valid-for
|
How long the token remains valid, for example 24h.
|
zone-token takes --zone and --scope, which defaults to cp.