
Linkerd is a lightweight, open-source service mesh for Kubernetes that provides observability, security, and traffic management features. It uses a sidecar proxy model where lightweight proxies handle pod-to-pod communication, while a control plane manages configuration and routing.
This guide explains how to install Linkerd on a Vultr Kubernetes Engine (VKE) cluster. You will deploy a sample application, configure Ingress for external access, and implement traffic management features.
Before you begin, you need to:
linkerd.example.com).Install the Linkerd command-line interface on your workstation to manage your service mesh deployment.
Update the system package index.
Download and install the Linkerd CLI.
Add Linkerd to your PATH.
Make the PATH change permanent.
Verify the CLI installation.
Output:
The server version appears unavailable because the control plane has not yet been installed.
Ensure your cluster meets Linkerd's requirements before installation.
Run pre-installation checks.
All checks should pass with the message Status check results are √. If any checks fail, resolve the issues before proceeding.
Deploy Linkerd's core components to your cluster.
Install the Gateway API CRDs.
Install Linkerd CRDs.
Install the control plane.
Verify the installation.
Check control plane pods.
Output:
The viz extension provides observability features and the web dashboard.
Install the viz extension.
Verify the viz installation.
You can expose the Linkerd dashboard securely via Kubernetes Ingress. In this section, expose the Linkerd dashboard securely using TLS encryption.
Deploy Nginx Ingress Controller to handle external traffic routing.
Add the Nginx Ingress Helm repository.
Update Helm.
Install Nginx Ingress Controller.
Wait for the LoadBalancer to get an external IP.
Sample output:
Note the EXTERNAL-IP address value. This is where you should point your domain's A record.
Verify that the Nginx Ingress controller pods are running.
Create basic authentication credentials to secure dashboard access.
Install the htpasswd utility.
Generate authentication credentials. Replace admin with your preferred username.
Enter a strong password when prompted.
Create a Kubernetes secret with the credentials.
Remove the local auth file.
Using cert-manager, you can secure your dashboard with HTTPS using Let's Encrypt TLS certificates.
Add the Jetstack repository to Helm.
Update Helm.
Install cert-manager and all required CRDs in your Kubernetes cluster.
Check the cert-manager resources and wait until they become ready.
Create a ClusterIssuer for Let's Encrypt.
Add the following content. Replace admin@example.com with your email.
Save the file and close the editor.
Apply the ClusterIssuer.
Create an Ingress resource to expose the Linkerd dashboard externally.
Update the ingress-nginx-controller ConfigMap so the latest version of cert-manager can verify your domain. Without this change, a strict Nginx setting may block cert-manager’s automatic domain check, stopping it from issuing TLS certificates.
Create an Ingress manifest file.
Add the following content. Replace linkerd.example.com with your domain.
Save the file and close the editor.
This Ingress routes external traffic from your domain to the Linkerd dashboard service running in the linkerd-viz namespace. It enforces basic authentication, sets proxy timeouts, and ensures the request is sent to the correct backend service on port 8084.
Apply the Ingress manifest.
Verify the Ingress resource.
Verify the TLS certificate creation.
Wait until the certificate shows READY as True.
Access your secured Linkerd dashboard through the configured domain.
Open a web browser and navigate to your domain.
Enter the username and password you created earlier.
Explore the dashboard to view cluster metrics, service mesh topology, and traffic flow.
Test Linkerd's features with the Emojivoto sample application.
Deploy the Emojivoto application.
Verify the deployment.
Add the application to the mesh.
View the meshed application in the dashboard or via CLI.
Implement canary deployments using HTTPRoute to split the traffic.
Create a second version of the web deployment.
This command copies the existing web Deployment, renames the copy to web-v2, and applies it to create a new Deployment.
Create a service for the new version.
This Service exposes the web-v2 pods on port 80 inside the emojivoto namespace. It routes traffic to pods labeled app: web, version: v2.
Add the new deployment to the mesh.
This command injects the Linkerd proxy into the web-v2 Deployment and updates the cluster so new pods run with the proxy.
Create a manifest to split the traffic.
Add the following content to the file:
Save the file and close the editor.
This HTTPRoute configuration routes 80% of traffic to the original web-svc service and 20% to the new web-v2 service.
Apply the manifest.
Verify traffic distribution in the dashboard or via CLI.
You have successfully installed Linkerd on a VKE cluster, exposed the dashboard securely through Nginx Ingress with TLS encryption and authentication, and deployed a sample application with traffic splitting capabilities. For more information about advanced Linkerd features, visit the official Linkerd documentation.
0 Comments
Be the first to comment and share your perspective with the community.