gpt4 book ai didi

kubernetes - Azure Kubernetes-Jaeger UI是否未显示作为ISTIO的一部分部署的服务?

转载 作者:行者123 更新时间:2023-12-02 12:25:00 25 4
gpt4 key购买 nike

我使用以下配置来设置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中看不到下面部署的应用程序
enter image description here
并按如下所述部署了应用程序
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. Could you try to send at least 100 requests and check if it works?


如果您不想更改默认采样率,则可以使用istio documentation

Customizing Trace sampling

The sampling rate option can be used to control what percentage of requests get reported to your tracing system. This should be configured depending upon your traffic in the mesh and the amount of tracing data you want to collect. The default rate is 1%.

To modify the default random sampling to 50, add the following option to your tracing.yaml file.

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

The sampling rate should be in the range of 0.0 to 100.0 with a precision of 0.01. For example, to trace 5 requests out of every 10000, use 0.05 as the value here.

关于kubernetes - Azure Kubernetes-Jaeger UI是否未显示作为ISTIO的一部分部署的服务?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64484169/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com