【问题标题】:Azure Kubernetes - Jaeger UI is not showing the Service deployed as a part of ISTIO?Azure Kubernetes - Jaeger UI 未显示作为 ISTIO 的一部分部署的服务?
【发布时间】:2021-02-05 14:01:10
【问题描述】:

我使用以下配置来设置 Istio

cat << EOF | kubectl apply -f -
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
  namespace: istio-system
  name: istio-control-plane
spec:
  # Use the default profile as the base
  # More details at: https://istio.io/docs/setup/additional-setup/config-profiles/
  profile: default
  # Enable the addons that we will want to use
  addonComponents:
    grafana:
      enabled: true
    prometheus:
      enabled: true
    tracing:
      enabled: true
    kiali:
      enabled: true
  values:
    global:
      # Ensure that the Istio pods are only scheduled to run on Linux nodes
      defaultNodeSelector:
        beta.kubernetes.io/os: linux
    kiali:
      dashboard:
        auth:
          strategy: anonymous
  components:
    egressGateways:
    - name: istio-egressgateway
      enabled: true
EOF

并暴露了如下所述的 jaeger-query 服务

kubectl expose service jaeger-query  --type=LoadBalancer --name=jaeger-query-svc --namespace istio-system
kubectl get svc jaeger-query-svc -n istio-system -o json
export JAEGER_URL=$(kubectl get svc jaeger-query-svc -n istio-system  -o jsonpath="{.status.loadBalancer.ingress[0]['hostname','ip']}"):$(kubectl get svc jaeger-query-svc -n istio-system -o 'jsonpath={.spec.ports[0].port}')
echo http://${JAEGER_URL}
curl http://${JAEGER_URL}

我在 Jaeger 中看不到以下部署的应用程序

并已部署如下所述的应用程序

cat << EOF | kubectl apply -f -
apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
  name: nginx-deployment
  namespace: akv2k8s-test
spec:
  selector:
    matchLabels:
      app: nginx
  replicas: 1
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: stenote/nginx-hostname
        ports:
        - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: web
  namespace: akv2k8s-test
spec:
  selector:
    app: nginx
  ports:
  - protocol: TCP
    port: 80
EOF

cat <<EOF | kubectl apply -f -
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: public-gateway
  namespace: akv2k8s-test
spec:
  selector:
    istio: ingressgateway # use istio default ingress gateway
  servers:
  - port:
      number: 443
      name: https
      protocol: HTTPS
    tls:
      mode: SIMPLE
      credentialName: "${KEY_CERT2_NAME}"
    hosts:
    - web.zaalion.com
EOF


cat <<EOF | kubectl apply -f -
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: helloworld
  namespace: akv2k8s-test
spec:
  hosts:
    - web.zaalion.com
  gateways:
    - public-gateway
  http:
    - route:
      - destination:
          host: web.akv2k8s-test.svc.cluster.local
          port:
            number: 80
EOF

我可以访问如下所示的服务

export EXTERNAL_IP=$(kubectl get svc istio-ingressgateway -n istio-system -o jsonpath='{.status.loadBalancer.ingress[0].ip}')

curl -v --resolve web.zaalion.com:443:$EXTERNAL_IP --cacert cert2.crt https://web.zaalion.com

我知道为什么 Jaeger UI 中没有列出该服务?

【问题讨论】:

  • 根据 istio documentation To see trace data, you must send requests to your service. The number of requests depends on Istio’s sampling rate. You set this rate when you install Istio. The default sampling rate is 1%. You need to send at least 100 requests before the first trace is visible. 你能尝试发送至少 100 个请求并检查它是否有效吗?
  • 感谢您的信息,有什么办法可以减少这个限制吗?

标签: kubernetes istio azure-aks jaeger


【解决方案1】:

根据 istio documentation

要查看跟踪数据,您必须向您的服务发送请求。请求的数量取决于 Istio 的采样率。您在安装 Istio 时设置此速率。默认采样率为 1%。在第一个跟踪可见之前,您需要发送至少 100 个请求。你能尝试发送至少 100 个请求并检查它是否有效吗?

如果您不想更改默认采样率,那么 istio documentation 可以解决这个问题。

自定义跟踪采样

采样率选项可用于控制向您的跟踪系统报告的请求百分比。这应该根据您在网格中的流量和您要收集的跟踪数据量进行配置。默认率为 1%。

要将默认随机抽样修改为 50,请将以下选项添加到您的 tracking.yaml 文件中。

apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
  meshConfig:
    defaultConfig:
      tracing:
        sampling: 50

采样率应在 0.0 到 100.0 的范围内,精度为 0.01。例如,要跟踪每 10000 个请求中的 5 个请求,请在此处使用 0.05 作为值。

【讨论】:

    猜你喜欢
    • 2021-02-05
    • 1970-01-01
    • 1970-01-01
    • 2020-02-06
    • 2021-02-04
    • 2018-11-16
    • 2017-10-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多