Linkerd

打印 上一主题 下一主题

主题 805|帖子 805|积分 2415

Linkerd is a service mesh for Kubernetes. It makes running services easier and safer by giving you runtime debugging, observability, reliability, and security—all without requiring any changes to your code.
Installation

Ensure you have access to the Kubernetes cluster and a functioning kubectl, if not, you could set up Kubernetes cluster on your local machine through Minikube, docker desktop, or kind, etc.
Install linked CLI

For Linux

Follow the instructions from the official site: https://linkerd.io/2.14/getting-started/
  1. curl --proto '=https' --tlsv1.2 -sSfL https://run.linkerd.io/install | sh
复制代码
For Windows

Download the Windows execution file from Github: https://github.com/linkerd/linkerd2/releases/

No need to install, change the file name to linkerd and add it to the Path environment.
Check whether linked cli is running correctly by
  1. linkerd version
复制代码
 Install Linkerd control plane

Check if your cluster is ready for installing Linkerd.
  1. linkerd check --pre
复制代码
Install Linkerd’s Custom Resource Definitions (CRDs), it must be installed first.
  1. linkerd install --crds | kubectl apply -f -
复制代码
Install Linkerd control panel.
  1. linkerd install | kubectl apply -f -
复制代码
You may encounter some installation errors, for example, the one below, based on the error message, change the install command accordingly.
  1. linkerd install --set proxyInit.runAsRoot=true | kubectl apply -f -
复制代码
 Check whether the control plane is installed successfully, linkerd control plane will be deployed to your cluster, a couple of images will be pulled, so make sure you have a workable network.
  1. linkerd check
复制代码
Deploy Linkerd to your application

First, you need an application deployed in your cluster, you can use the emojivoto application in https://linkerd.io/2.14/getting-started/.
After the application is deployed, add Linkerd's data plane proxy to it.
  1. kubectl get -n emojivoto deploy -o yaml  | linkerd inject - | kubectl apply -f -
复制代码
After emojivoto is 'meshed', check the data plane
  1. linkerd -n emojivoto check --proxy
复制代码
Dashboard

Install Linkerd's dashboard extension
  1. linkerd viz install | kubectl apply -f -
复制代码
This is the official way to access the dashboard
  1. linkerd viz dashboard &
复制代码
While this doesn't work when I using Windows docker desktop Kubernetes, I got this error

 Looks like the normal way doesn't work, so let's inspect the web service
  1. kubectl get service web -n linkerd-viz -o yaml
复制代码
And, got this, service type is ClusterIP and listening at port 8080 port
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4.   annotations:
  5.     kubectl.kubernetes.io/last-applied-configuration: |
  6.       {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{"linkerd.io/created-by":"linkerd/helm stable-2.14.7","linkerd.io/inject":"enabled"},"labels":{"component":"web","linkerd.io/extension":"viz","namespace":"linkerd-viz"},"name":"web","namespace":"linkerd-viz"},"spec":{"ports":[{"name":"http","port":8084,"targetPort":8084},{"name":"admin-http","port":9994,"targetPort":9994}],"selector":{"component":"web","linkerd.io/extension":"viz"},"type":"ClusterIP"}}
  7.     linkerd.io/created-by: linkerd/helm stable-2.14.7
  8.     linkerd.io/inject: enabled
  9.   creationTimestamp: "2023-12-29T05:06:38Z"
  10.   labels:
  11.     component: web
  12.     linkerd.io/extension: viz
  13.     namespace: linkerd-viz
  14.   name: web
  15.   namespace: linkerd-viz
  16.   resourceVersion: "5396830"
  17.   uid: ba0b70ec-89f3-4f9a-a407-492744f3f90b
  18. spec:
  19.   clusterIP: 10.106.135.240
  20.   clusterIPs:
  21.   - 10.106.135.240
  22.   internalTrafficPolicy: Cluster
  23.   ipFamilies:
  24.   - IPv4
  25.   ipFamilyPolicy: SingleStack
  26.   ports:
  27.   - name: http
  28.     port: 8084
  29.     protocol: TCP
  30.     targetPort: 8084
  31.   - name: admin-http
  32.     port: 9994
  33.     protocol: TCP
  34.     targetPort: 9994
  35.   selector:
  36.     component: web
  37.     linkerd.io/extension: viz
  38.   sessionAffinity: None
  39.   type: ClusterIP
  40. status:
  41.   loadBalancer: {}
复制代码
Then we can do a workaround, expose the service outside the cluster
  1. kubectl -n linkerd-viz port-forward svc/web 8084
复制代码
Bingo!!!

 

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

渣渣兔

金牌会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表