Getting Started

    In this guide, we’ll walk you through how to install Linkerd into yourKubernetes cluster. Then we’ll deploy a sample application to show off whatLinkerd can do.

    Installing Linkerd is easy. First, you will install the CLI (command-lineinterface) onto your local machine. Using this CLI, you’ll then install thecontrol plane into your Kubernetes cluster. Finally, you’ll “mesh” one ormore services by adding the data plane proxies. (See the page for details.)

    Before we can do anything, we need to ensure you have access to a Kubernetescluster running 1.12 or later, and a functioning command on yourlocal machine. (One easy option is to run Kubernetes on your local machine. Wesuggest Docker Desktop or, butthere are many options.)

    When ready, make sure you’re running a recent version of Kubernetes with:

    In the next step, we will install the Linkerd CLI and validate that your clusteris ready to install the control plane.

    (Note: if you’re using a GKE with a “private cluster”, there are some beforeyou can proceed.)

    Step 1: Install the CLI

    If this is your first time running Linkerd, you will need to download thecommand-line interface (CLI) onto your local machine. This CLI interacts withLinkerd, including installing the control plane onto your Kubernetes cluster.

    To install the CLI, run:

    1. curl -sL https://run.linkerd.io/install | sh

    Alternatively, you can download the CLI directly via theLinkerd releases page.

    Next, add linkerd to your path with:

      Verify the CLI is installed and running correctly with:

      1. linkerd version

      You should see the CLI version, and also Server version: unavailable. This isbecause you haven’t installed the control plane on your cluster. Don’t worry,you’ll be installing the control plane soon.

      Kubernetes clusters can be configured in many different ways. To ensure that thecontrol plane will install correctly, the Linkerd CLI can check and validatethat everything is configured correctly.

      To check that your cluster is configured correctly and ready to install thecontrol plane, you can run:

      1. linkerd check --pre

      If there are any checks that do not pass, make sure to follow the provided linksand fix those issues before proceeding.

      Step 3: Install Linkerd onto the cluster

      Now that you have the CLI running locally and a cluster that is ready to go,it’s time to install the control plane into its own namespace (by default,linkerd). To do this, run:

      Depending on the speed of your cluster’s Internet connection, it may take aminute or two for your cluster to pull the Linkerd images. While that ishappening, we can validate the installation by running:

      This command will patiently wait until Linkerd has been installed, is runningand becomes healthy. If you’re interested in what components were installed,you can run:

      1. kubectl -n linkerd get deploy

      Check out the documentation for an in depth explanation of what these components are and whatthey do.

      NoteLinkerd installs certain resources that require cluster-wide permissions. Forclusters where these permissions are restricted, the alternative multi-stageinstall instructions, which split theserequirements into a separate, self-contained step, may be useful.

      With the control plane installed and running, you can now view the Linkerddashboard by running:

      1. linkerd dashboard &

      )

      The Linkerd dashboard in action

      This command sets up a port forward from your local system to thelinkerd-web pod. (It’s also possible to for everyone to access.)

      Because the control plane components all have the proxy installed in their pods,each component is also part of the data plane itself. This provides the abilityto dig into what is going on with the control plane itself behind the scenes.In fact, you can run:

      1. linkerd -n linkerd top deploy/linkerd-web

      This is the traffic you’re generating by looking at the dashboard itself!

      Step 5: Install the demo app

      To get a feel for how Linkerd would work for one of your services, you caninstall a demo application. The emojivoto application is a standaloneKubernetes application that uses a mix of gRPC and HTTP calls to allow theusers to vote on their favorite emojis.

      Install emojivoto into the emojivoto namespace by running:

      Before we mesh it, let’s take a look at the app. If you’re using DockerDesktop at this point you canvisit directly. If you’re not usingDocker Desktop, we’ll need to forward the web-svc service. To forwardweb-svc locally to port 8080, you can run:

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

      Now visit http://localhost:8080. Voila! The emojivotoapp in all its glory.

      Clicking around, you might notice that some parts of emojivoto are broken!For example, if you click on a doughnut emoji, you’ll get a 404 page. Don’tworry, these errors are intentional. (And we can use Linkerd to identify theproblem. Check out the if you’reinterested in how to figure out exactly what is wrong.)

      Next, let’s add Linkerd to emojivoto by running:

      1. kubectl get -n emojivoto deploy -o yaml \
      2. | linkerd inject - \

      As with install, inject is a pure text operation, meaning that you caninspect the input and output before you use it. Once piped into kubectlapply, Kubernetes will execute a rolling deploy and update each pod with thedata plane’s proxies, all without any downtime.

      Congratulations! You’ve now added Linkerd to existing services! Just as withthe control plane, it is possible to verify that everything worked the way itshould with the data plane. To do this check, run:

      1. linkerd -n emojivoto check --proxy

      You can now view the Linkerd dashboard and see all the services in the demoapp. Since the demo app comes with a load generator, we can see live trafficmetrics by running:

      1. linkerd -n emojivoto stat deploy

      This will show the “golden” metrics for each deployment:

      • Success rates
      • Request rates
      • Latency distribution percentilesTo dig in a little further, it is possible to use top to get a real-timeview of which paths are being called:

      To go even deeper, we can use shows the stream of requests across asingle pod, deployment, or even everything in the emojivoto namespace:

      1. linkerd -n emojivoto tap deploy/web

      All of this functionality is also available in the dashboard, if you would liketo use your browser instead:

      Top Line Metrics)

      Top Line Metrics

      )

      Deployment Detail

      Top)

      Top

      )

      Tap

      What about things that happened in the past? Linkerd includesGrafana to visualize the metricscollected by , and shipswith some pre-configured dashboards. You can get to these by clicking theGrafana icon in the overview page.

      Deployment Detail Dashboard)

      Deployment Detail Dashboard

      That’s it! 👏

      Congratulations, you’re now a Linkerd user! Here are some suggested next steps: