Overview
The first step is obviously to download and install Kuma on the platform of your choice. Different distributions will present different installation instructions that follow the best practices for the platform you have selected.
Regardless of what platform you decide to use, the fundamental behavior of Kuma at runtime will not change across different distributions. These fundamentals are important to explore in order to understand what Kuma is and how it works.
Installing Kuma on Kubernetes is fully automated, while installing Kuma on Linux requires the user to run the Kuma executables. Both ways are very simple, and can be explored from the .
There are two main components of Kuma that are very important to understand:
- Control-Plane: Kuma is first and foremost a control-plane that will accept user input (you are the user) in order to create and configure Policies like , and in order to add services and configure their behavior within the Meshes you have created.
- Data-Plane: Kuma also bundles a data-plane implementation based on top of Envoy for convenience, in order to get up and running quickly. An instance of the data-plane will run alongside every instance of our services, and it will process both incoming and outgoing requests for the service.
Multi-Mesh: Kuma ships with multi-tenancy support since day one. This means you can create and configure multiple isolated Service Meshes from one control-plane. By doing so we lower the complexity and the operational cost of supporting multiple meshes. .
Since Kuma bundles a data-plane in addition to the control-plane, we decided to call the executables and kuma-dp
to differentiate them. Let’s take a look at all the executables that ship with Kuma:
kuma-cp
: this is the main Kuma executable that runs the control plane (CP).kuma-dp
: this is the Kuma data-plane executable that - under the hood - invokesenvoy
.kumactl
: this is the the user CLI to interact with Kuma (kuma-cp
) and its data.kuma-prometheus-sd
: this is a helper tool that enables native integration between andPrometheus
. Thanks to it,Prometheus
will be able to automatically find all dataplanes in your Mesh and scrape metrics out of them.kuma-tcp-echo
: this is a sample application that echos back the requests we are making, used for demo purposes.
universal
: when it’s being installed on a Linux compatible machine like MacOS, Virtual Machine or Bare Metal. This also includes those instances where Kuma is being installed on a Linux base machine (ie, a Docker image).
When running in Universal mode, Kuma will require a PostgreSQL database to store its state. The PostgreSQL database and schema will have to be initialized accordingly to the installation instructions:
When running on Kubernetes, Kuma will store all of its state and configuration on the underlying Kubernetes API Server, therefore requiring no dependency to store the data. Kuma will automatically inject the dataplane proxy kuma-dp
on any Pod that belongs to a Namespace that includes the following label:
You can learn more about sidecar injection in the section on Dataplanes.
When deploying services in Kubernetes, you can determine which Mesh you want the service to be be in by using the annotation. This annotation would be applied to a deployment like so:
Matching Labels in Pod and Service
At least one of these labels must match the labels we define in our Service
. The correct way to define the corresponding Redis Service
would be as follows:
Full CRD support: When using Kuma in Kubernetes mode you can create with Kuma’s CRDs applied via kubectl
.
Once the kuma-cp
process is started, it waits for data-planes to connect, while at the same time accepting user-defined configuration to start creating Service Meshes and configuring the behavior of those meshes via Kuma .
When we look at a typical Kuma installation, at a higher level it works like this:
When we unpack the underlying behavior, it looks like this:
xDS APIs: Kuma implements the xDS APIs of Envoy in the
kuma-cp
application so that the Envoy DPs can connect to it and retrieve their configuration.