![](/img/trans.png)
[英]Azure Kubernetes - prometheus is deployed as a part of ISTIO not showing the deployments?
[英]Azure Kubernetes - Jaeger UI is not showing the Service deployed as a part of ISTIO?
我使用以下配置来设置 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 文档
要查看跟踪数据,您必须向您的服务发送请求。 请求的数量取决于 Istio 的采样率。 您在安装 Istio 时设置此速率。 默认采样率为 1%。 在第一个跟踪可见之前,您需要发送至少 100 个请求。 您能否尝试发送至少 100 个请求并检查它是否有效?
如果您不想更改默认采样率,则可以使用 istio 文档。
自定义跟踪采样
采样率选项可用于控制向跟踪系统报告的请求百分比。 这应该根据网格中的流量和要收集的跟踪数据量进行配置。 默认利率为 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 作为此处的值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.