Skip to content

NimTechnology

Trình bày các công nghệ CLOUD một cách dễ hiểu.

  • Kubernetes & Container
    • Docker
    • Kubernetes
      • Ingress
      • Pod
    • Helm Chart
    • OAuth2 Proxy
    • Isito-EnvoyFilter
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Vault
    • Longhorn – Storage
    • VictoriaMetrics
    • MetalLB
    • Kong Gateway
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Argo Events
    • Spinnaker
    • Jenkins
    • Harbor
    • TeamCity
    • Git
      • Bitbucket
  • Coding
    • DevSecOps
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
      • Azure Cloud
    • Golang
    • Laravel
    • Python
    • Jquery & JavaScript
    • Selenium
  • Log, Monitor & Tracing
    • DataDog
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
    • NextCloud
  • Toggle search form

[istio] There are a few problems inside mode “POD to POD” when using Istio

Posted on December 4, 2021December 4, 2021 By nim No Comments on [istio] There are a few problems inside mode “POD to POD” when using Istio

Trong k8s thì bạn biết ràng chúng ta sẽ thiết kế các pod gọi qua nhau thông:
– ingress
– service

Nhưng sẽ có 1 số trường hợp đặt biệt mà mình rút ra ở thực tế và mình tạm gọi là pod to pod
Nghĩ là pod A call sang pod B bằng IP của pod B và đây là mấu chốt để mình tìm hiểu ở đây

Contents

Toggle
  • 1) Introduction
  • 2) Discover the inbound traffics through istio.
    • 2.1) There are traffics that Istio understands
    • 2.2) There are traffics that Istio doesn’t understand

1) Introduction

Vậy pod to pod thì có bị istio chặn hay không? thì mình đã trình bày ở bài viết này:

[istio] Discover route TCP in Cluster Istio
POD to POD.

Mình có gặp 1 case khá nguy hiểm.
Pod B có 1 serivce ở pod 8000 và trên app của dev cấu hình allow bind trên ip của pod đó. Chứ dev ko bind 0.0.0.0:8000 hay 127.0.0.1:8000

Bạn để ý khi mình nestat thì thấy là container của chỉ cho phép kết nối vào container bằng ip của pod thôi

Trước đó nếu chưa inject istio thì nó sẽ ntn:

Mọi thứ vấn đang hoạt động ổn định

Đùng cái bạn injected istio thế là pod B bị 503 các bạn.
Đố các bạn biết tại sao?

210 Ảnh chế (1) ý tưởng | hài hước, chuyện vui, chuyện cười

2) Discover the inbound traffics through istio.

Mình sẽ có 1 vài links:

https://stackoverflow.com/questions/64979572/in-a-k8s-pod-with-istio-injected-why-envoy-call-localhost-the-packets-pass-prer
https://github.com/istio/istio/wiki/Understanding-IPTables-snapshot#iptables-schematic

Iptables schematic
Nhìn hình loạn vl
root@work-space-u20:~/istio-1.11.2/bin# ./istioctl pc l tcp-echo-5b8f599579-gxcks.default --port 15006
ADDRESS PORT  MATCH                                                                                           DESTINATION
0.0.0.0 15006 Addr: *:15006                                                                                   Non-HTTP/Non-TCP
0.0.0.0 15006 Trans: tls; App: istio-http/1.0,istio-http/1.1,istio-h2; Addr: ::0/0                            InboundPassthroughClusterIpv6
0.0.0.0 15006 Trans: tls; Addr: ::0/0                                                                         InboundPassthroughClusterIpv6
0.0.0.0 15006 Trans: raw_buffer; Addr: ::0/0                                                                  InboundPassthroughClusterIpv6
0.0.0.0 15006 Trans: raw_buffer; App: HTTP; Addr: ::0/0                                                       InboundPassthroughClusterIpv6
0.0.0.0 15006 Trans: tls; App: TCP TLS; Addr: ::0/0                                                           InboundPassthroughClusterIpv6
0.0.0.0 15006 Trans: tls; Addr: 0.0.0.0/0                                                                     InboundPassthroughClusterIpv4
0.0.0.0 15006 Trans: raw_buffer; Addr: 0.0.0.0/0                                                              InboundPassthroughClusterIpv4
0.0.0.0 15006 Trans: tls; App: TCP TLS; Addr: 0.0.0.0/0                                                       InboundPassthroughClusterIpv4
0.0.0.0 15006 Trans: raw_buffer; App: HTTP; Addr: 0.0.0.0/0                                                   InboundPassthroughClusterIpv4
0.0.0.0 15006 Trans: tls; App: istio-http/1.0,istio-http/1.1,istio-h2; Addr: 0.0.0.0/0                        InboundPassthroughClusterIpv4
0.0.0.0 15006 Trans: tls; App: istio,istio-peer-exchange,istio-http/1.0,istio-http/1.1,istio-h2; Addr: *:9001 Cluster: inbound|9001||
0.0.0.0 15006 Trans: tls; Addr: *:9001                                                                        Cluster: inbound|9001||
0.0.0.0 15006 Trans: raw_buffer; Addr: *:9001                                                                 Cluster: inbound|9001||
0.0.0.0 15006 Trans: tls; App: istio,istio-peer-exchange,istio-http/1.0,istio-http/1.1,istio-h2; Addr: *:9000 Cluster: inbound|9000||
0.0.0.0 15006 Trans: tls; Addr: *:9000                                                                        Cluster: inbound|9000||
0.0.0.0 15006 Trans: raw_buffer; Addr: *:9000                                                                 Cluster: inbound|9000||

Ok từ bảng route inbound bên trên thì mình phần làm 2 loại là

There are traffics that Istio understands: InboundPassthroughClusterIpv6, InboundPassthroughClusterIpv4, Cluster: inbound|9001||

There are traffics that Istio doesn’t understand: Non-HTTP/Non-TCP

Mình lấy màu gần giống trong picture của istio

và làm sao để biết được traffic của bạn khi đi qua istio nó hiểu được hay không thì chúng ta mở access log trên workload đó và link này he.
https://nimtechnology.com/2021/09/05/istio-recheck-envoy-test-cac-features-lien-quan-den-envoy/#43_Partially_enable_accesslog

2.1) There are traffics that Istio understands

Với các loại inbount bên dưới và cộng với container chỉ bind trên Pod IP sẽ chị chặn (status 5xx)
InboundPassthroughClusterIpv6, (không cấu hình service port)
InboundPassthroughClusterIpv4, (không cấu hình service port)
Cluster: inbound|9001|| (trường hợp này bạn có cấu hinh service với pod 9001)

Traffic đi vào pod 8000 pod -> đi qua iptable -> forward đến port 15006 -> istio proxy sẽ tranfer tiếp bằng cách gọi 127.0.0.1:8000, để gửi sang bên container App.
Mà IP chỉ bind trên Pod IP (10.42.6.114:8000) thì tạch

Bạn sẽ thấy access như ảnh nếu istio hiểu được traffic của bạn

2.2) There are traffics that Istio doesn’t understand

Non-HTTP/Non-TCP và và cộng với container chỉ bind trên Pod IP thì nó chả sao cả

mình có khoanh lại traffic Non-HTTP/Non-TCP

Bạn thấy traffic Non-HTTP/Non-TCP thì gọi thằng vào App Container luôn 10.42.6.114:8000
và access log sẽ như thế này:

[2021-12-02T04:36:52.028Z] "- - -" 0 NR "-" "-" 0 0 0 - "-" "-" "-" "-" "-" - - 10.42.20.169:8000 10.42.21.131:50464 - -
[2021-12-02T04:36:52.147Z] "- - -" 0 NR "-" "-" 0 0 0 - "-" "-" "-" "-" "-" - - 10.42.20.169:8000 10.42.21.131:50474 - -

Bạn thấy nó chả có InboundPassthroughClusterIpv6, InboundPassthroughClusterIpv4, Cluster: inbound.

Ngoài ra có các đại ca của mình debug bằng nhiều cách nữa là:
Cũng phải nhờ đến các anh/em thì mình hiểu được

Xin gửi ngàn respect respect respect …. đến anh em.


Isito-EnvoyFilter

Post navigation

Previous Post: [istio] Discover route TCP in Cluster Istio
Next Post: [Jenkins] Scripted Pipeline lesson 5: Parallel_FailFast

More Related Articles

[Ingress-nginx/Istio] How do ingress-nginx work with istio smoothly. Reducing status 503 or 5xx. Isito-EnvoyFilter
[Istio] why does workload inject Istio that workload always connects fail database? – hold Application Isito-EnvoyFilter
[Istio] Analyzing Istio Performance by pprof Isito-EnvoyFilter
[Istio] Explain MutatingWebhookConfiguration to auto-injected istio-proxy. Isito-EnvoyFilter
[Istio] Authenticator KubeJWTAuthenticator at index 1 got error: failed to validate the JWT from cluster – When you update K8s version 1.20 to 1.21 Isito-EnvoyFilter
[Istio] Research tracing in Istio Isito-EnvoyFilter

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Tham Gia Group DevOps nhé!
Để Nim có nhiều động lực ra nhiều bài viết.
Để nhận được những thông báo mới nhất.

Recent Posts

  • [Azure] The subscription is not registered to use namespace ‘Microsoft.ContainerService’ May 8, 2025
  • [Azure] Insufficient regional vcpu quota left May 8, 2025
  • [WordPress] How to add a Dynamic watermark on WordPress. May 6, 2025
  • [vnet/Azure] VNet provisioning via Terraform. April 28, 2025
  • [tracetcp] How to perform a tracert command using a specific port. April 3, 2025

Archives

  • May 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • December 2024
  • November 2024
  • October 2024
  • September 2024
  • August 2024
  • July 2024
  • June 2024
  • May 2024
  • April 2024
  • March 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • September 2023
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • April 2023
  • March 2023
  • February 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

Categories

  • BareMetal
    • NextCloud
  • CI/CD
    • Argo Events
    • ArgoCD
    • ArgoWorkflows
    • Git
      • Bitbucket
    • Harbor
    • Jenkins
    • Spinnaker
    • TeamCity
  • Coding
    • DevSecOps
    • Golang
    • Jquery & JavaScript
    • Laravel
    • NextJS 14 & ReactJS & Type Script
    • Python
    • Selenium
    • Terraform
      • AWS – Amazon Web Service
      • Azure Cloud
      • GCP – Google Cloud
  • Kubernetes & Container
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Docker
    • Helm Chart
    • Isito-EnvoyFilter
    • Kong Gateway
    • Kubernetes
      • Ingress
      • Pod
    • Longhorn – Storage
    • MetalLB
    • OAuth2 Proxy
    • Vault
    • VictoriaMetrics
  • Log, Monitor & Tracing
    • DataDog
    • ELK
      • Kibana
      • Logstash
    • Fluent
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2025 NimTechnology.