访问日志条目未记录在ISTIO SIDECAR中以进行入学流量

发布于 2025-02-12 02:21:52 字数 1133 浏览 1 评论 0原文

我的ALB入口将其流量路由到Istio-Ingressgateway。

从那里我有一个网关:

---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: "X-gateway"
  namespace: dev
spec: 
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "dev.xxx.com"

还设有虚拟服务:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: vs-istio-ingress
  namespace: dev
spec:
  gateways:
    - X-gateway
  hosts:
    - "dev.xxx.com"
  http:
     - route:
        - destination:
            host: serviceX
            port:
              number: 8080

从那里定义了服务:

apiVersion: v1
kind: Service
metadata:
  namespace: dev
  name: serviceX
  labels:
    app: appX
spec:
  selector:
    app: podX
  ports:
    - port: 8080

通过设置,我可以在操作员中启用访问日志:

spec:
  meshConfig:
    accessLogFile: /dev/stdout

问题是当我从Ingress点击服务时,Ingressgateway本身那里有访问日志条目,但没有服务的边路! (它是单个POD),但是,当请求通过服务网格之一到达服务时,日志条目在Sidecar代理访问日志中存在。

ISTIO版本是:1.10.0 K8S版本是:V1.21.4

I have alb ingress which routes its traffic to istio-ingressgateway.

From there I have a gateway:

---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
  name: "X-gateway"
  namespace: dev
spec: 
  selector:
    istio: ingressgateway
  servers:
  - port:
      number: 80
      name: http
      protocol: HTTP
    hosts:
    - "dev.xxx.com"

Also I have the virtual service in place:

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: vs-istio-ingress
  namespace: dev
spec:
  gateways:
    - X-gateway
  hosts:
    - "dev.xxx.com"
  http:
     - route:
        - destination:
            host: serviceX
            port:
              number: 8080

From there I have the service defined:

apiVersion: v1
kind: Service
metadata:
  namespace: dev
  name: serviceX
  labels:
    app: appX
spec:
  selector:
    app: podX
  ports:
    - port: 8080

I have access log enabled in the operator by setting:

spec:
  meshConfig:
    accessLogFile: /dev/stdout

The issue is when I hit the service from the ingress, the ingressgateway itself has the access log entry there, but not the sidecar of the service! (it's single pod), however, when the request is coming to the service via one of the service mesh the log entry is there in sidecar proxy access log.

Istio version is : 1.10.0
k8s version is : v1.21.4

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无戏配角 2025-02-19 02:21:52

服务端口名称应该在那里:

spec:
  selector:
    app: podX
  ports:
    - name: http
      port: 8080

这解决了问题。

The service port name should be there:

spec:
  selector:
    app: podX
  ports:
    - name: http
      port: 8080

This solves the issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文