Linkerd is a dedicated infrastructure layer that helps manage communication between services by automatically encrypting connections, handling retries, and timeouts. Installing the Linkerd add-on ensures load balancing for gRPC traffic as HUMMIX services scale. It also provides telemetry (success rates, latencies) and more..
Linkerd is essential for enabling scalable service support on the HUMMIX application side. Without it, scaling HUMMIX microservices will not function.
For instructions on preparing certificates using openssl for Linkerd and its installation, read the article Install Linkerd.
This article will cover how to:
- Automate certificate preparation using the Cert-manager tool and install Linkerd;
Installing Linkerd involves four steps:
- Prepare certificates for Linkerd.
- Download the Helm chart and configuration file.
- Fill out the configuration file.
- Install the Linkerd chart using Helm in a Kubernetes cluster.
Step 1: Prepare certificates for Linkerd
- Install Cert-manager and create namespaces. Cert-manager will use these to store resources related to the web interceptor:
kubectl create namespace linkerd
kubectl label namespace linkerd linkerd.io/is-control-plane=true config.linkerd.io/admission-webhooks=disabled linkerd.io/control-plane-ns=linkerd
kubectl annotate namespace linkerd linkerd.io/inject=disabled
- Install the step tool to create a key pair for signing each certificate:
wget https://dl.smallstep.com/cli/docs-cli-install/latest/step-cli_amd64.deb
sudo dpkg -i step-cli_amd64.deb
- Generate certificates using step to use them for signing:
- Web interceptor certificates;
|
- Control Plane certificate.
|
Step 2: Download the Helm chart and configuration file
To install Linkerd via the internet, retrieve the configuration file values-linkerd.yaml by executing the following command:
helm repo add hummix https://charts.hummix.co
helm repo update
helm show values hummix/linkerd > values-linkerd.yaml
Obtaining the configuration file for installation in an offline environment:
helm repo add hummix https://charts.hummix.co
tar -xf linkerd-X.Y.Z.tgz
|
Step 3: Fill out the configuration file
Fill in the configuration file values-linkerd.yaml for installing Linkerd:
- Specify the DNS domain name of the Kubernetes cluster in the parameter
linkerd.clusterDomain. In this example, the domain name iscluster.local:
# Linkerd settings
linkerd:
# DNS name of the Kubernetes domain
clusterDomain: cluster.local
# adds PodSecurityPolicy resource (deprecated as of k8s v1.21)
enablePSP: false
# disable heartbeat
disableHeartBeat: false
...
- To ensure high availability, you may uncomment the parameters in the high availability settings section.
Example of enabling high availability
|
- If you have installed monitoring tools, specify the parameter for Linkerd metrics:
# Connection parameter for metrics collection
podMonitor:
enabled: true
- If you install Linkerd in an isolated environment without internet access, fill out the connection parameters for the private registry.
How to fill out the connection parameters for the private registry
# linkerd settings Where the format is:
|
Step 4: Install the Linkerd chart using Helm in a Kubernetes cluster
Install the Linkerd chart in namespace linkerd. The namespace will be created during installation if it has not been created earlier. Below is the installation command from the directory where the certificates were created in Step 1. If you are running the command from a different directory, specify the paths to the certificates created in Step 1 (caRoot.crt, caWebhook.crt).
For installation via the internet:
helm upgrade --install linkerd hummix/linkerd -f values-linkerd.yaml -n linkerd --create-namespace \
--set-file linkerd.identityTrustAnchorsPEM=caRoot.crt \
--set linkerd.identity.issuer.scheme=kubernetes.io/tls \
--set linkerd.policyValidator.externalSecret=true \
--set-file linkerd.policyValidator.caBundle=caWebhook.crt \
--set linkerd.proxyInjector.externalSecret=true \
--set-file linkerd.proxyInjector.caBundle=caWebhook.crt \
--set linkerd.profileValidator.externalSecret=true \
--set-file linkerd.profileValidator.caBundle=caWebhook.crt
For offline installation without internet access:
helm upgrade --install linkerd ./linkerd -f values-linkerd.yaml -n linkerd --create-namespace \
--set-file linkerd.identityTrustAnchorsPEM=caRoot.crt \
--set linkerd.identity.issuer.scheme=kubernetes.io/tls \
--set linkerd.policyValidator.externalSecret=true \
--set-file linkerd.policyValidator.caBundle=caWebhook.crt \
--set linkerd.proxyInjector.externalSecret=true \
--set-file linkerd.proxyInjector.caBundle=caWebhook.crt \
--set linkerd.profileValidator.externalSecret=true \
--set-file linkerd.profileValidator.caBundle=caWebhook.crt
Attention
After installing Linkerd, change the HUMMIX application settings and set up autoscaling of services. Read more in the Enable service autoscaling in HUMMIX On-Premises article.
Uninstall the Linkerd chart with Helm in a Kubernetes cluster
Attention
Before removing the Linkerd add-on component, disable autoscaling on the HUMMIX application side.
To delete the Linkerd chart in namespace linkerd, run the following command:
helm uninstall linkerd -n linkerd