0
0
Kubernetesdevops~5 mins

Linkerd as lightweight alternative in Kubernetes - Commands & Configuration

Choose your learning style9 modes available
Introduction
Managing communication between services in Kubernetes can be complex and slow. Linkerd is a simple, lightweight tool that helps services talk to each other securely and reliably without adding much overhead.
When you want to add secure communication between microservices without heavy setup.
When you need automatic retries and timeouts for service calls to improve reliability.
When you want to monitor service-to-service traffic with minimal resource use.
When you prefer a simple service mesh that is easy to install and maintain.
When you want to add observability to your Kubernetes services without complex configuration.
Commands
This command downloads and installs the Linkerd CLI tool on your local machine to manage Linkerd in your Kubernetes cluster.
Terminal
curl -sL https://run.linkerd.io/install | sh
Expected OutputExpected
Linkerd CLI installed to /home/user/.linkerd2/bin Run the following to add the CLI to your PATH: export PATH=$PATH:/home/user/.linkerd2/bin
This command checks if your Kubernetes cluster is ready for Linkerd installation by verifying necessary permissions and resources.
Terminal
linkerd check --pre
Expected OutputExpected
kubernetes-api -------------- √ can initialize the client √ can query the Kubernetes API linkerd-version -------------- √ cli version is up-to-date √ control plane version is up-to-date Status check results are happy.
This command generates the Linkerd control plane configuration and applies it to your Kubernetes cluster to install Linkerd.
Terminal
linkerd install | kubectl apply -f -
Expected OutputExpected
namespace/linkerd created service/linkerd-controller created deployment.apps/linkerd-controller created ... (other resources created) configmap/linkerd-config created
This command verifies that Linkerd was installed correctly and is running properly in your cluster.
Terminal
linkerd check
Expected OutputExpected
kubernetes-api -------------- √ can initialize the client √ can query the Kubernetes API linkerd-version -------------- √ cli version is up-to-date √ control plane version is up-to-date control-plane -------------- √ all pods are running data-plane -------------- √ no data plane pods found Status check results are happy.
This command lists all the Linkerd pods running in the linkerd namespace to confirm the control plane components are active.
Terminal
kubectl get pods -n linkerd
Expected OutputExpected
NAME READY STATUS RESTARTS AGE linkerd-controller-5d7f9f7d7b-8x9z2 3/3 Running 0 2m linkerd-destination-6f7d9c7f7b-9x8y1 2/2 Running 0 2m linkerd-proxy-injector-7f8d9c7f7b-6y7z3 2/2 Running 0 2m
Key Concept

If you remember nothing else from this pattern, remember: Linkerd adds secure, reliable communication between Kubernetes services with minimal setup and resource use.

Common Mistakes
Not running 'linkerd check --pre' before installation
This can cause the installation to fail due to missing permissions or cluster requirements.
Always run 'linkerd check --pre' to verify your cluster is ready before installing Linkerd.
Skipping 'linkerd check' after installation
You might miss errors or issues with the Linkerd control plane that prevent it from working properly.
Run 'linkerd check' after installation to confirm everything is running smoothly.
Not adding Linkerd CLI to PATH after installation
You won't be able to run Linkerd commands easily from your terminal.
Add the Linkerd CLI directory to your PATH as instructed after installation.
Summary
Install the Linkerd CLI tool to manage the service mesh.
Check your Kubernetes cluster readiness with 'linkerd check --pre'.
Install Linkerd control plane using 'linkerd install | kubectl apply -f -'.
Verify the installation with 'linkerd check' and check pods in the linkerd namespace.