目录

一、Jaeger training简介

二、创建pod:

三、创建service

四、外部访问


一、Jaeger tracing简介

Jaeger是CNCF力推的OpenTelemetry的监控部分。官网:https://www.jaegertracing.io/

二、创建pod:

K8S 创建jaeger-all-in-one 所需yaml文件:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: jaegertracing-all-in-one
  namespace: monitoring
spec:
  replicas: 1
  selector:
    matchLabels:
      app: jaegertracing-all-in-one
  template:
    metadata:
      labels:
        app: jaegertracing-all-in-one
    spec:
      containers:
      - name: jaeger-all-in-one
        image: companyname.com.cn:30100/fromupstream/jaegertracing-all-in-one:1.20.0
        ports:
        - containerPort: 5775
          protocol: UDP
        - containerPort: 6831
          protocol: UDP
        - containerPort: 6832
          protocol: UDP
        - containerPort: 5778
          protocol: TCP
        - containerPort: 16686
          protocol: TCP
        - containerPort: 14268
          protocol: TCP
        - containerPort: 9411
          protocol: TCP

验证:

看pod:

kubectl get pod -n monitoring -owide | grep jaeger
jaegertracing-all-in-one-68dd5db976-dqbx5   1/1     Running   0          4d20h   100.91.194.189    host-172-18-195-245   <none>           <none>

访问:http://100.91.194.189:16686/ 有结果,表示pod没问题了。

三、创建service

service所需yaml文件

apiVersion: v1
kind: Service
metadata:
  name: jaeger-service
  namespace: monitoring
  labels:
    app: jaegertracing-all-in-one
spec:
  type: NodePort
  selector:
    app: jaegertracing-all-in-one
  ports:
  - port: 16686
    targetPort: 16686
    nodePort: 32686
    name: jaegerservice

验证:

看service:

kubectl get service -n monitoring | grep jaeger
jaeger-service          NodePort    10.107.96.130    <none>        16686:32686/TCP              4d2h

访问:10.107.96.130:16686 有结果,表示service没问题了。

四、外部访问

浏览器输入:http://hostip:32686,出现如下图所示,没问题了。

参考文档: https://www.jaegertracing.io/docs/1.19/getting-started/#all-in-one

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐