kubernetesistioenvoyproxyservicemesh

Access log entries are not logged in istio sidecar for ingress traffic


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


Solution

  • The service port name should be there:

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

    This solves the issue.