Configure a Kong Mesh global control plane on Kubernetes with the Konnect UI

Uses: Kong Mesh
TL;DR

In the Konnect UI, navigate to Service Mesh create a global control plane, then create a zone and follow the wizard to deploy the zone control plane using the system account access token that Konnect provisions for you. Create a default mesh and deploy workloads with kubectl.

Prerequisites

This tutorial requires a Konnect Plus account. If you don’t have a Konnect account, you can get started quickly with our onboarding wizard.

This guide requires a running Kubernetes cluster that supports the LoadBalancer service type. If you already have a Kubernetes cluster running, you can skip this step. It can be a cluster running locally, like Docker, or in a public cloud like AWS EKS, GCP GKE, etc.

Install and configure kubectl to connect to your cluster.

Using the Konnect UI, you can create a global control plane, connect a Kubernetes zone, and manage your Kong Mesh mesh. This guide creates a global control plane, adds a zone, creates a mesh, deploys the demo application, and validates traffic through the mesh using the Konnect UI.

To run your zone control plane on a VM or bare metal instead, see Configure a Kong Mesh global control plane on Universal with the Konnect UI.

Create a global control plane in Konnect

Before you can add services or apply configurations, you must create a global control plane.

  1. In the Konnect sidebar, click Service Mesh.
  2. Click Create a service mesh.
  3. In the Name field, enter example-cp.
  4. Click Save.

The global control plane is now created but has no functionality until you connect a zone.

Create a zone in the global control plane

Add a zone to connect a data plane and receive configuration updates.

  1. In the Konnect sidebar, click Service Mesh.
  2. Click example-cp.
  3. Click Create zone.
  4. Select Kubernetes as the configuration type.
  5. In the Name field, enter zone-1.

    The zone name must use lowercase alphanumeric characters or hyphens, and start and end with an alphanumeric character.

  6. In the Token field, enter your Konnect personal access token.
  7. Follow the Helm and token setup instructions shown in the UI to deploy the zone control plane on your Kubernetes cluster.

    Konnect automatically provisions a system account access token for the zone and includes it, along with the control plane ID and address, in the deployment steps. You don’t need to create a token manually.

  8. Once the zone is connected, click Continue.

Create a mesh

Workloads can only join the mesh once a mesh exists on the global control plane. Create the default mesh:

  1. In the Konnect sidebar, click Service Mesh.
  2. Click example-cp, then click Meshes.
  3. Click Create mesh.
  4. In the Name field, enter default.
  5. Click Create.

Deploy the demo application

  1. To test your mesh, deploy the Kong Mesh demo app into the kong-mesh-demo namespace:

    echo "
    apiVersion: v1
    kind: Namespace
    metadata:
      labels:
        kuma.io/sidecar-injection: enabled
      name: kong-mesh-demo
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: demo-app
      namespace: kong-mesh-demo
    spec:
      ports:
      - appProtocol: http
        port: 5050
        protocol: TCP
        targetPort: 5050
      selector:
        app: demo-app
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: kv
      namespace: kong-mesh-demo
    spec:
      ports:
      - appProtocol: http
        port: 5050
        protocol: TCP
        targetPort: 5050
      selector:
        app: kv
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      labels:
        app: demo-app
        version: v1
      name: demo-app
      namespace: kong-mesh-demo
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: demo-app
          version: v1
      template:
        metadata:
          labels:
            app: demo-app
            version: v1
        spec:
          containers:
          - env:
            - name: KV_URL
              value: http://kv.kong-mesh-demo.svc.cluster.local:5050
            - name: APP_VERSION
              valueFrom:
                fieldRef:
                  fieldPath: metadata.labels['version']
            image: ghcr.io/kumahq/kuma-counter-demo:latest@sha256:daf8f5cffa10b576ff845be84e4e3bd5a8a6470c7e66293c5e03a148f08ac148
            name: demo-app
            ports:
            - containerPort: 5050
              name: http
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: kv
      namespace: kong-mesh-demo
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: kv
      template:
        metadata:
          labels:
            app: kv
        spec:
          containers:
          - image: ghcr.io/kumahq/kuma-counter-demo:latest
            name: kv
            ports:
            - containerPort: 5050
              name: http
    " | kubectl apply -f -
  2. Wait for the demo app to be ready:

    kubectl wait -n kong-mesh-demo --for=condition=available --timeout=120s deployment --all

    This creates:

    • demo-app: a counter web app on port 5050
    • kv: the key-value store that backs the counter

Validate

Confirm the zone and demo services are connected to your global control plane.

  1. In the Konnect sidebar, click Service Mesh.
  2. Click example-cp, then click Meshes.
  3. Click default, then click the Services tab.

    You should see the demo-app and kv services.

    It may take a few minutes for the services to reach the Online status.

  4. Port-forward the demo-app service to your local machine:

    kubectl port-forward svc/demo-app -n kong-mesh-demo 5050:5050
  5. In a browser, go to http://127.0.0.1:5050 and increment the counter.

    The counter is stored in the kv service through the mesh, so a successful increment confirms that traffic is flowing between your services.

Cleanup

Delete the demo app namespace and all of its resources:

kubectl delete namespace kong-mesh-demo

Uninstall Kong Mesh and remove its namespace:

helm uninstall kong-mesh --namespace kong-mesh-system
kubectl delete namespace kong-mesh-system
  1. In the Konnect sidebar, click Service Mesh.
  2. Click example-cp.
  3. From the control plane’s actions menu, select Delete and confirm.

Deleting the control plane also removes its zone and the system account access token that Konnect provisioned for it.

FAQs

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.

Because the mesh is deployed on Kubernetes, kumactl is read-only. You manage resources using kubectl. Still, we recommend configuring kumactl for visibility and diagnostics.

  1. In the Konnect sidebar, click Service Mesh.
  2. Click example-cp.
  3. Click Connect.
  4. Follow the steps shown in the UI to configure kumactl.

See the kumactl command reference for more information.

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!