Platform9 Blog

How To Set Up Linkerd as a Kubernetes Service Mesh

In this article, you will learn how to set up Linkerd as a Kubernetes Service Mesh using a free Platform9 Kubernetes account.

Linkerd is a light-weight service mesh for Kubernetes. It adds observability, reliability, and security to Kubernetes applications without code changes. For example, Linkerd can monitor and report per-service success rates and latencies, can automatically retry failed requests, and can encrypt and validate connections between services, all without requiring any modification of the application itself.

Linkerd is fully open source, licensed under Apache v2, and is a Cloud Native Computing Foundation incubating project. It is developed in the open in the Linkerd GitHub organization.

Linkerd has three basic components: a UI, a data plane, and a control plane. You run Linkerd by:

  1. Installing the CLI on your local system
  2. Installing the control plane into your cluster
  3. Adding your services to Linkerd’s data plane

Once a service is running with Linkerd, you can use Linkerd’s UI to inspect and manipulate it.

In this step by step guide, we will walk you through a basic set up of Linkerd to get you up and running.

Getting Started

To get started, create your free Platform9 Kubernetes account by entering your email below, then select the ‘Deploy Now’ option. Once you have created and verified your account, follow the steps outlined below. 

Step 1: Create your free account

Step 1: Create your free account


Minimum Kubernetes version required is 1.13. This can be checked by running the command –

kubectl version --short

If you’ve already set up your (free) managed Platform9 Kubernetes account, you don’t have to worry about this.

Installing Linkerd as a Kubernetes Service Mesh

While installing Linkerd as a Kubernetes Service Mesh, you need to download the Linkerd CLI. This CLI interacts with Linkerd, including installing the control plane onto your Kubernetes cluster.

Here’s the command to run the CLI manually –

curl -sL | sh

You can also download a CLI directly from the Linkerd releases page if you want to install a specific version.

Add the Linkerd to your path and also consider adding it to your .bashrc file too.

export PATH=$PATH:$HOME/.linkerd2/bin

If you are using Homebrew, the command to install it is as follows –

brew install linkerd

Once installed, you can verify the version of linkerd by running the command –

linkerd version

Validating Linkerd CLI Installation

To ensure that Linkerd’s CLI has been successfully installed and all the pre-requisites like namespace Linkerd not being present etc., run the following command –

linkerd check --pre

All the checks in the above command should complete successfully, before proceeding.

Fig 1. Validating Linkerd CLI Installation

validating linkerd CLI installation

Installing Linkerd’s Control plane

linkerd install | kubectl apply -f -

you can change configuration options like choosing a custom namespace for Linkerd Control plane by running the command –

linkerd install -l  | kubectl apply -f -

For eg.

linkerd install -l linkerdtest | kubectl apply -f -

To explore all the available options while installing, run the command –

linkerd install --help

Once the installation is complete, you can run the following command to verify if all the Linkerd components are running successfully.

linkerd check

Exploring Linkerd Dashboard

You can explore the Linkerd Dashboard by running the following command —

linkerd dashboard &

If you are running this command from a Linux machine and would like the dashboard to listen on a specific interface instead of localhost by default, run the following commmand –

linkerd dashboard --address  &

This command sets up a port forward from your local system to the linkerd-web pod.

Here’s the simple command to install the Linkerd’s Control plane with all the default configuration.

NOTE: If you cannot access browser from the machine you are running the above linkerd command, you can make Linkerd dashboard listening on a specific interface IP instead of localhost by default, you’ll have to edit the enforced-host container argument and set it to an empty string. Detailed instructions are here under Tweaking Host Requirement Section.

Installing Demo Application

Install the emojivoto application in the corresponding namespace by running the command –

curl -sL \
| kubectl apply -f -

You can take a look at this application by using a port forward for the web-svc service associated with the emojivoto application by running the command –

kubectl -n emojivoto port-forward svc/web-svc 8080:80

Then, access the application using – http://localhost:8080/

NOTE: If you cannot access browser from the machine you are running the above kubectl command, you can make use the –address switch so you can reach it from your local machine and access it via a browser. The complete command is

 kubectl -n emojivoto port-forward svc/web-svc 8080:80 --address

You might notice that that some parts of emojivoto app are broken. this is intentional and you can debug it further by checking out this link.

Injecting Linkerd into the Demo Application

You can inject Linkerd into the newly deployed Demo application by running the command –

kubectl get -n emojivoto deploy -o yaml \
| linkerd inject - \
| kubectl apply -f -

The first part of the command gets all the manifests from the emojivoto namespace; second part injects it with linkerd related metadata and then reapplies the configuration.

There will be no downtime associated with this operation as it would be a rolling deploy.

You can check if the above operation was successful by running the following command –

linkerd -n emojivoto check --proxy

Demo app has an included load generator so you can observe the live metrics associated with the traffic flowing.

linkerd -n emojivoto stat deploy


There’s a Grafana instance that comes prebuilt that shows metrics collected by Prometheus such as latency, request volume and success rate.

Fig 2. Grafana Dashboard

Grafana Monitoring


Next Steps

In this blog, we walked through a tutorial on how to set up Linkerd as a Kubernetes Service Mesh. We hope you found this blog informative and engaging. For more reads like this one, visit our blog page or subscribe for up-to-date news, projects, and related content in real-time.

Check out our additional complete stack projects in our Github repos.

You may also enjoy

Running Free5GC on Platform9 Managed Kubernetes

By Mudit Jain

Kubernetes Service Mesh: How To Set Up Istio

By Mike Mackrory

The browser you are using is outdated. For the best experience please download or update your browser to one of the following: