Deploy Kuma on Universal
To start learning how Kuma works, you run and secure a simple demo application that consists of two services:
demo-app
: a web application that lets you increment a numeric counter. It listens on port 5000redis
: data store for the counter
Prerequisites
- Redis installed
- Demo app downloaded from GitHub:
- Optional: To explore traffic metrics with the demo app, you also need to set up Prometheus. See the MeshMetric policy documentation.
Install Kuma
Install a Kuma control plane using the Docker images:
- kuma-cp: at
docker.io/kumahq/kuma-cp:2.7.3
- kuma-dp: at
docker.io/kumahq/kuma-dp:2.7.3
- kumactl: at
docker.io/kumahq/kumactl:2.7.3
You can freely docker pull
these images to start using Kuma, as we will demonstrate in the following steps.
Generate tokens
Create a token for Redis and a token for the app (both are valid for 30 days):
This requires
authentication
unless executed against a control-plane running on localhost.
If kuma-cp
is running inside a Docker container, see
docker authentication docs
.
Create a data plane proxy for each service
For Redis:
For the demo app:
Deploy the demo application
- Run
redis
as a daemon on port 26379 and set a default zone name: - Install and start
demo-app
on the default port 5000: - In a browser, go to 127.0.0.1:5000 and increment the counter.
Explore the GUI
You can view the sidecar proxies that are connected to the Kuma control plane:
Kuma ships with a read-only GUI that you can use to retrieve Kuma resources. By default the GUI listens on the API port and defaults to :5681/gui
.
You can navigate to 127.0.0.1:5681/meshes/default/dataplanes
to see the connected dataplanes.
Introduction to zero-trust security
By default, the network is insecure and not encrypted. We can change this with Kuma by enabling the Mutual TLS policy to provision a Certificate Authority (CA) that will automatically assign TLS certificates to our services (more specifically to the injected data plane proxies running alongside the services).
Before enabling Mutual TLS (mTLS) in your mesh, you need to create a MeshTrafficPermission
policy that allows traffic between your applications.
If you enable mTLS without a MeshTrafficPermission
policy, all traffic between your applications will be blocked.
- To create a
MeshTrafficPermission
policy that allows all traffic, do the following:
- To create a
Mesh
policy with a builtin CA backend, do the following:
Once Mutual TLS has been enabled, Kuma will not allow traffic to flow freely across our services unless we explicitly have a Traffic Permission policy that describes what services can be consumed by other services. By default, a very permissive traffic permission is created.
For the sake of this demo, we will delete it:
You can try to make requests to the demo application at 127.0.0.1:5000/
and you will notice that they will not work.
Now, let’s add back the default traffic permission:
By doing so every request, we now make sure our demo application at 127.0.0.1:5000/
is not only working again, but it’s automatically encrypted and secure.
As usual, you can visualize the Mutual TLS configuration and the Traffic Permission policies we have just applied via the GUI, the HTTP API or kumactl
.
Next steps
- Explore the Features available to govern and orchestrate your service traffic.
- Add a gateway to access the demo from the outside by following the builtin gateway guide.
- Add Kong as gateway to access the demo from the outside by following the delegated gateway guide.
- Federate zone into a multizone deployment.
-
Read the full documentation to learn about all the capabilities of Kuma.
- Chat with us at the official Kuma Slack for questions or feedback.