Exposing services through Linkerd Ingress

Ingressing and Egressing with Linkerd

Linkerd's control plane does not include ingress or egress gateways. Linkerd allows you choice of your preferred ingress (and egress) controller.

How to use Ingress with Linkerd

In case you're anticipating infusing Linkerd into your ingress controller's pods there is some setup required. Linkerd discovers services dependent on the :authority or Host header. This permits Linkerd to comprehend what service a request is bound for without being subject to DNS or IPs.

In this workshop, you will use the NGINX Ingress Controller with Linkerd.

Installing NGINX Ingress Controller

Using Meshery, select the Linkerd from the Management menu, and:

  1. Enter ingress-nginx into the namespace field.
  2. Click the (+) icon on the Apply Service Mesh Configuration card and select NGINX Ingress Controller to install the latest version of KIC.

Alternative: Manual installation

Follow this if the above steps did not work for you

Installing NGINX Ingress Controller

Install ingress controller using Docker Desktop

1kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.40.2/deploy/static/provider/cloud/deploy.yaml

Install the ingress controller using Minikube

1minikube addons enable ingress

Setting up Ingress controller with the sample application deployed

Using Meshery, click the ➡️ icon on the Apply Custom Configuration card and apply the following manifest to your cluster:

1apiVersion: extensions/v1beta1
2kind: Ingress
3metadata:
4 name: web-ingress
5 namespace: emojivoto
6 annotations:
7 kubernetes.io/ingress.class: "nginx"
8 nginx.ingress.kubernetes.io/configuration-snippet: |
9 proxy_set_header l5d-dst-override $service_name.$namespace.svc.cluster.local:$service_port;
10 grpc_set_header l5d-dst-override $service_name.$namespace.svc.cluster.local:$service_port;
11
12spec:
13 rules:
14 - host: example.com
15 http:
16 paths:
17 - backend:
18 serviceName: web-svc
19 servicePort: 80

Nginx ingress will include the l5d-dst-override header to tell Linkerd where to direct the request. You'll need to include both the Kubernetes administration FQDN (web-svc.emojivoto.svc.cluster.local) and the destination servicePort.

To test this, you need to get the external IP of your controller.

Docker Desktop

You may use http://localhost or http://kubernetes.docker.internal or your host's IP address.

Minikube

Expose your Kubernetes's cluster services to your localhost network:

1minikube tunnel

You may use http://localhost or You may use http://localhost: provided by the output of minikube tunnel.

Hosted Kubernetes

Retrieve the external IP address by running:

1kubectl get svc --all-namespaces \
2 -l app=nginx-ingress,component=controller \
3 -o=custom-columns=EXTERNAL-IP:.status.loadBalancer.ingress[0].ip

You can now curl to your service without using port-forward, like this:

1curl -H "Host: example.com" http://{external-ip}

NEXT CHAPTER

Getting Started

Layer5, the cloud native management company

An empowerer of engineers, Layer5 helps you extract more value from your infrastructure. Creator and maintainer of cloud native standards. Maker of Meshery, the cloud native manager.