curl -X POST "https://us.api.konghq.com/v1/mesh/control-planes" \
--no-progress-meter --fail-with-body \
-H "Authorization: Bearer $KONNECT_TOKEN" \
--json '{
"name": "example-cp"
}'Migrate a self-managed zone control plane to Konnect
You are browsing documentation for an older version of Kong Mesh. See the latest documentation here.
Export your meshes, policies, and secrets from the self-managed global control plane, apply them to a Konnect-managed global control plane, then reconnect each zone control plane to Konnect.
Prerequisites
Kong Konnect
If you don’t have a Konnect account, you can get started quickly with our onboarding wizard.
- The following Konnect items are required to complete this tutorial:
- Personal access token (PAT): Create a new personal access token by opening the Konnect PAT page and selecting Generate Token.
-
Set the personal access token as an environment variable:
export KONNECT_TOKEN='YOUR KONNECT TOKEN'
A Konnect global control plane
Before you can add services or apply configurations, you must create a global control plane.
-
Create the control plane by sending a request to the Mesh control planes API:
-
Export the control plane
idso you can reference it when you create a zone:export CONTROL_PLANE_ID='YOUR_CONTROL_PLANE_ID' -
Export your region:
export KONNECT_REGION='us'
The global control plane is now created but has no functionality until you connect a zone.
A self-managed zone control plane
Deploy a self-managed Kong Mesh global control plane and a zone control plane connected to it on Kubernetes. You’ll migrate this zone to Konnect.
-
Export the names of the contexts to your environment:
export GLOBAL_CONTEXT=global export ZONE_CONTEXT=zone -
Create separate clusters for the global and zone control planes. The global and zone control planes must run in separate clusters. These steps use minikube:
minikube start -p $GLOBAL_CONTEXT minikube start -p $ZONE_CONTEXT -
Provision load balancer addresses on the global cluster so the zone can reach the control plane’s KDS address:
nohup minikube tunnel -p $GLOBAL_CONTEXT > /dev/null 2>&1 & -
Add the Kong Mesh Helm repository:
helm repo add kong-mesh https://kong.github.io/kong-mesh-charts helm repo update -
Deploy the global control plane:
helm install --kube-context $GLOBAL_CONTEXT --create-namespace --namespace kong-mesh-system \ --set kuma.controlPlane.mode=global \ kong-mesh kong-mesh/kong-mesh -
Export the global control plane’s KDS address:
export KDS_ADDRESS=grpcs://$(kubectl --context $GLOBAL_CONTEXT get svc -n kong-mesh-system kong-mesh-global-zone-sync -o jsonpath='{.status.loadBalancer.ingress[0].ip}'):5685 -
Deploy a zone control plane connected to the global control plane:
helm install --kube-context $ZONE_CONTEXT --create-namespace --namespace kong-mesh-system \ --set kuma.controlPlane.mode=zone \ --set kuma.controlPlane.zone=zone-1 \ --set kuma.controlPlane.kdsGlobalAddress=$KDS_ADDRESS \ --set kuma.controlPlane.tls.kdsZoneClient.skipVerify=true \ --set kuma.ingress.enabled=true \ kong-mesh kong-mesh/kong-mesh
Install kumactl
-
Go to the Kong Mesh packages page to download and extract the installation archive for your OS, or download and extract the latest release automatically (Linux or macOS):
curl -L https://developer.konghq.com/mesh/v2/installer.sh | VERSION=2.14.6 sh - -
Add the Kong Mesh binaries directory to your path. By default, the directory is
/kong-mesh-2.14.6/bin. You can use the following command to set the directory in your path for the current terminal window:export PATH=$PATH:$(pwd)/kong-mesh-2.14.6/bin
If you already run Kong Mesh with a self-managed global control plane, you can migrate your zones to a Konnect-managed global control plane so that Konnect hosts and operates the global control plane for you. To learn more, see Kong Mesh in Konnect.
This guide migrates a self-managed zone control plane to Konnect by transferring your meshes and policies to the Konnect-managed global control plane and reconnecting the zone.
This process assumes you’re migrating zones one by one. During migration, zone-to-zone communication may break temporarily because each zone’s zone ingress must be registered with the new global control plane in Konnect. Until both zones are migrated, cross-zone service discovery won’t work.
Transfer resources from the self-managed global control plane
-
Create and navigate to the working directory for this guide:
mkdir -p ~/mesh-konnect && cd ~/mesh-konnect -
Forward port
5681from the self-managed global control plane:kubectl port-forward --context $GLOBAL_CONTEXT svc/kong-mesh-control-plane -n kong-mesh-system 5681:5681 > /dev/null 2>&1 & -
Configure
kumactlto access the self-managed global control plane. Requests over the port-forward reach the control plane fromlocalhost, which Kong Mesh authenticates as an administrator by default, so no token is required:kumactl config control-planes add \ --address http://localhost:5681 \ --name "global-cp" \ --overwrite -
Export the meshes, policies, and secrets from the self-managed global control plane. The
federation-with-policiesprofile includes the mesh definitions, all policies, and the signing keys and secrets (including mTLS CA secrets) that the zone needs to keep working after it moves:kumactl export --profile=federation-with-policies --format=universal > resources.yaml -
Export your Konnect region:
export KONNECT_REGION='us' -
Configure
kumactlto target the Konnect-managed global control plane. This pointskumactlat your control plane’s Mesh API and authenticates with your Konnect token:kumactl config control-planes add \ --name konnect \ --address https://$KONNECT_REGION.api.konghq.com/v1/mesh/control-planes/$CONTROL_PLANE_ID/api \ --headers "authorization=Bearer $KONNECT_TOKEN" \ --overwrite -
Apply the exported resources to the Konnect global control plane:
kumactl apply -f resources.yaml
Connect the zone control plane to Konnect
Generate a zone token from the Konnect-managed global control plane, then reconfigure your existing zone control plane to connect to Konnect instead of the self-managed global control plane.
A zone isn’t a standalone Konnect resource. To provision one through the API, create a system account access token with the Connector role scoped to your control plane, then connect a zone control plane with that token. This is the same model that the Terraform guide automates.
-
Create a system account:
curl -X POST https://global.api.konghq.com/v3/system-accounts \ -H "Authorization: Bearer $KONNECT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "zone-1", "description": "Authentication for zone-1", "konnect_managed": false }'Export the returned account
id:export ACCOUNT_ID='YOUR_SYSTEM_ACCOUNT_ID' -
Assign the
Connectorrole for your control plane to the system account:curl -X POST https://global.api.konghq.com/v3/system-accounts/$ACCOUNT_ID/assigned-roles \ -H "Authorization: Bearer $KONNECT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "role_name": "Connector", "entity_type_name": "Mesh Control Planes", "entity_id": "'"$CONTROL_PLANE_ID"'", "entity_region": "'"$KONNECT_REGION"'" }' -
Generate an access token for the system account:
curl -X POST https://global.api.konghq.com/v3/system-accounts/$ACCOUNT_ID/access-tokens \ -H "Authorization: Bearer $KONNECT_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "zone-1", "expires_at": "2027-01-01T00:00:00Z" }'The response includes the
tokenvalue, which is shown only once. Copy it now. -
Export the token:
export CONTROL_PLANE_TOKEN='YOUR_ZONE_TOKEN' -
Store the zone token in a Kubernetes secret:
echo " apiVersion: v1 kind: Secret metadata: name: cp-token namespace: kong-mesh-system type: Opaque stringData: token: $CONTROL_PLANE_TOKEN " | kubectl --context $ZONE_CONTEXT apply -f - -
Create a Helm values file that connects the zone to Konnect. Use the same zone name as your existing zone:
cat <<EOF > values.yaml kuma: controlPlane: mode: zone zone: zone-1 kdsGlobalAddress: grpcs://$KONNECT_REGION.mesh.sync.konghq.com:443 konnect: cpId: $CONTROL_PLANE_ID secrets: - Env: KMESH_MULTIZONE_ZONE_KDS_AUTH_CP_TOKEN_INLINE Secret: cp-token Key: token ingress: enabled: true egress: enabled: true EOF -
Apply the new configuration to the existing zone control plane:
helm upgrade --kube-context $ZONE_CONTEXT --namespace kong-mesh-system kong-mesh kong-mesh/kong-mesh -f values.yamlKonnect automatically detects and displays the zone once it reconnects.
Validate
In Konnect, confirm the migrated zone is connected:
- In the Konnect sidebar, click Service Mesh.
- Confirm that the migrated zone appears with an Online status.
- Confirm that the meshes, policies, and data plane proxies you transferred are present.
Cleanup
Stop the background processes
Stop the kubectl port-forward and minikube tunnel processes started during this guide:
pkill -f "kubectl port-forward.*5681"
pkill -f "minikube tunnel"Delete the self-managed clusters
Delete the global and zone clusters created for this guide:
minikube delete -p $GLOBAL_CONTEXT
minikube delete -p $ZONE_CONTEXTDelete the Konnect control plane
Delete the global control plane, which also removes its zones and mesh:
curl -X DELETE https://$KONNECT_REGION.api.konghq.com/v1/mesh/control-planes/$CONTROL_PLANE_ID \
-H "Authorization: Bearer $KONNECT_TOKEN"Delete the system account created for the zone token:
curl -X DELETE https://global.api.konghq.com/v3/system-accounts/$ACCOUNT_ID \
-H "Authorization: Bearer $KONNECT_TOKEN"Remove the kumactl control plane configurations
Remove the control plane configurations added to kumactl during this guide:
kumactl config control-planes remove --name global-cp
kumactl config control-planes remove --name konnectRemove the working directory
Return to the parent directory, then delete the working directory and the files created during this guide:
cd ../
rm -rf ~/mesh-konnectFAQs
How does a zone authenticate to the global control plane?
Each zone control plane authenticates to the Konnect-managed global control plane with an access token. When you create a zone with the UI wizard, Konnect provisions this token for you as a system account access token and includes it in the generated deployment instructions, so you don’t need to create one manually.
Konnect supports two types of access tokens:
- Personal access token (PAT): Prefixed with
kpat_and tied to an individual user account. Use a PAT for interactive or one-off tasks. - System account access token (SAT): Prefixed with
spat_and tied to a system account rather than a person. We recommend system account tokens for zone authentication and automation because they aren’t tied to a user who might leave the organization.
If you provision zones with automation instead of the UI wizard, such as with Terraform, create a system account, assign it the Connector role on the control plane, and generate a system account access token to authenticate the zone. For a full example, see Deploy Kong Mesh using Terraform and Konnect.