Welcome to Linkerd!
In this guide, we’ll walk you through how to install the Linkerd onto your Kubernetes cluster using Buoyant’s Linkerd Production Toolkit, a CLI (command-line interface) that makes it easy to install and manage Linkerd in production environments.
Note: This guide has been updated to cover Linkerd 2.13.
First, we’ll install the toolkit CLI onto your local machine. Using this CLI, you’ll then install the Linkerd control plane onto your Kubernetes cluster and connect that cluster to Buoyant Cloud. Finally, we’ll “mesh” an application by adding Linkerd’s data plane to it.
Step 0: Setup
Before anything else, we need to ensure you have access to a modern Kubernetes cluster and a functioning
kubectl command on your local machine. (If you don’t already have a Kubernetes cluster, one easy option is to run one on your local machine. There are many ways to do this, including kind, k3d, Docker for Desktop, and more.)
Validate your Kubernetes setup by running:
kubectl version --short
You should see output that includes both a
Client Version and
Now that we have our cluster, we’ll install the Linkerd CLI and use it validate that your cluster is capable of hosting Linkerd.
If you’re using a GKE “private cluster” or Calico CNI, there are some extra steps required before you can proceed to the next step.
Step 1: Install Buoyant’s Linkerd Production Toolkit CLI
The best way to install and interact with your Linkerd installation is to download Buoyant’s Linkerd Production Toolkit. This is a CLI tool that allow you to interact with your Linkerd deployment.
To install the toolkit CLI, run:
curl -sSL https://linkerd.buoyant.io/install | sh
Be sure to follow the instructions to add it to your path:
Once installed, verify the toolkit CLI is running correctly with:
You should see the CLI version, and also
Server version: unavailable. This is because you haven’t installed the control plane on your cluster. Don’t worry—we’ll fix that soon enough.
Step 2: Validate your Kubernetes cluster
Kubernetes clusters can be configured in many different ways. Before we can install the Linkerd control plane, we need to check and validate that everything is configured correctly. To check that your cluster is ready to install Linkerd, run:
linkerd check --pre
If there are any checks that do not pass, make sure to follow the provided links and fix those issues before proceeding.
Step 3: Install Linkerd onto your cluster
Now that you have the toolkit CLI running locally and a cluster that is ready to go, it’s time to install Linkerd on your cluster!
In this guide, we’re going to do the simplest option: a CLI-based install. This path is “demo grade”.
For production, we’d want to do things a little differently: we’d want to install
We’ll do this with two commands:
linkerd install --crds | kubectl apply -f - linkerd install | kubectl apply -f -
These commands generate Kubernetes manifests with all the core resources required for Linkerd (feel free to inspect this output if you’re curious). Piping these manifests into
kubectl apply then instructs Kubernetes to add those resources to your cluster. The
install --crds command installs Linkerd’s Custom Resource Definitions (CRDs), which must be installed first, while the
install command installs the Linkerd control plane.
The CLI-based install presented here is quick and easy, but there are a variety of other ways to install Linkerd, including by using Helm charts or by using a marketplace install from your Kubernetes provider.
Depending on the speed of your cluster’s Internet connection, it may take a minute or two for the control plane to finish installing. Wait for the control plane to be ready (and verify your installation) by running:
Step 4: Create your Buoyant Cloud account
Next, we’ll connect our Linkerd deployment to Buoyant Cloud. Connecting your cluster allows you to get automated health monitoring, notifications of security vulnerabilities, and automated data plane upgrades.
Start by creating a Buoyant Cloud account and following the simple instructions. You should see something like:
BUOYANT_CLOUD_CLIENT_ID=<id> BUOYANT_CLOUD_CLIENT_SECRET=<secret> linkerd buoyant install --cluster-name=my-new-cluster | kubectl apply -f -
(If you’re using Helm for this cluster, there will be slightly different instructions.)
Run those commands and then verify everything worked:
Congrats! Your cluster is now automatically monitored for health and security. You can take a quick peek at the overall health of your cluster with:
linkerd buoyant dashboard
Step 5: Install a demo app
Linkerd is installed, but it’s not really doing anything just yet. To see Linkerd in action, we’re going to need an application.
Let’s install a demo application called Emojivoto. This is a simple standalone Kubernetes application that uses a mix of gRPC and HTTP calls to allow the user to vote on their favorite emojis.
Install Emojivoto into the
emojivoto namespace by running:
curl -sSL https://run.linkerd.io/emojivoto.yml | kubectl apply -f -
This command installs Emojivoto onto your cluster, but Linkerd hasn’t been activated on it yet—we’ll need to “mesh” the application before Linkerd can work its magic.
Before we mesh it, let’s take a look at Emojivoto in its natural state. We’ll do this by forwarding traffic to its
web-svc service so that we can point our browser to it. Forward
web-svc locally to port 8080 by running:
kubectl -n emojivoto port-forward svc/web-svc 8080:80 &
Now visit http://localhost:8080. Voila: you should see Emojivoto in all its glory.
If you click around Emojivoto, you might notice that it’s a little broken! For example, if you try to vote for the donut emoji, you’ll get a 404 page. Don’t worry, these errors are intentional. (In a later guide, we’ll show you how to use Linkerd to identify the problem.)
With Emoji installed and running, we’re ready to mesh it—that is, to add Linkerd’s data plane proxies to it. We can do this on a live application without downtime, thanks to Kubernetes’s rolling deploys. Mesh your Emojivoto application by running:
kubectl get -n emojivoto deploy -o yaml \ | linkerd inject - \ | kubectl apply -f -
This command retrieves all of the deployments running in the
emojivoto namespace, runs their manifests through
linkerd inject, and then reapplies it to the cluster. (The
linkerd inject command simply adds annotations to the pod spec that instruct Linkerd to inject the proxy into the pods when they are created.)
inject is a pure text operation, meaning that you can inspect the input and output before you use it. Once piped into
kubectl apply , Kubernetes will execute a rolling deploy and update each pod with the data plane’s proxies.
Congratulations! You’ve now added Linkerd to an application! Just as with the control plane, it’s possible to verify that everything is working the way it should on the data plane side. Check your data plane with:
linkerd -n emojivoto check --proxy
And, of course, you can visit http://localhost:8080 and once again see Emojivoto in all its meshed glory.
Step 7: Explore Buoyant Cloud!
While Linkerd is running on your cluster (or clusters!), Buoyant Cloud is continually monitoring its health and security, and will send you alerts when
To take a quick look at the health of your Linkerd deployments, at any point you can visit Buoyant Cloud or simply run:
linkerd buoyant dashboard
Click around, explore, and have fun!
Congratulations, you’ve installed Linkerd have joined the exalted ranks of service mesh users! Give yourself a pat on the back.
What’s next? Here are some possible next steps:
- Introduce yourself on these very forums!
- Explore Buoyant’s Linkerd Production Runbook.
- Learn more about Linkerd’s architecture
- Learn how to use Linkerd to debug the errors in Emojivoto.
- Learn how to add your own services to Linkerd without downtime.
- Learn how to install Linkerd extensions such as Jaeger and the multicluster extension.
- Learn how to set up automatic control plane mTLS credential rotation for long-lived clusters.
- Learn how to restrict access to services using authorization policy.
Above all else: welcome to the Linkerd community!