istio - enabling debugging

Normally we would be able to do it using the following yaml 

apiVersion: install.istio.io/v1

kind: IstioOperator
metadata:
  name: istio-default
  namespace: istio-system
spec:
  meshConfig:
    accessLogFile: /dev/stdout

 

But sometimes we dont have istio operator crds install on our local testing cluster. So to quicky enable logging, we can do this accessLogFile to dev/stdout as shown here:- 


kubectl -n istio-system edit configmap istio

And ensure we set

apiVersion: v1
data:
  mesh: |-
    defaultConfig:
      discoveryAddress: istiod.istio-system.svc:15012
    defaultProviders:
      metrics:
      - prometheus
    enablePrometheusMerge: true
    rootNamespace: istio-system
    trustDomain: cluster.local
    accessLogFile: /dev/stdout
    accessLogFormat: |
        [%START_TIME%] "%REQ(:METHOD)% %REQ(X-ENVOY-ORIGINAL-PATH?:PATH)% %PROTOCOL%"
        %RESPONSE_CODE% %RESPONSE_FLAGS% %RESPONSE_CODE_DETAILS%
        "%UPSTREAM_HOST%" %BYTES_RECEIVED% %BYTES_SENT%
  meshNetworks: 'networks: {}'





And then restart istio

kubectl rollout restart deploy -n istio-system istiod

kubectl rollout restart deploy -n istio-system istio-ingressgateway

kubectl rollout restart deploy -n istio-system istio-egressgateway


You can enable debuggin on the pod level by running the command 

istioctl proxy-config log  <pod>  --level debug

We can also do this 

kubectl exec -n istio-system deploy/istiod -c discovery -- \

  curl -X POST "localhost:15014/debug?level=debug"




Comments

Popular posts from this blog

gemini cli getting file not defined error

NodeJS: Error: spawn EINVAL in window for node version 20.20 and 18.20

vllm : Failed to infer device type