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
    • Helm Chart
    • Isito-EnvoyFilter
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Vault
    • Longhorn – Storage
    • VictoriaMetrics
    • MetalLB
    • Kong Gateway
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Spinnaker
    • Jenkins
    • Harbor
    • TeamCity
    • Git
      • Bitbucket
  • Coding
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
    • Golang
    • Laravel
    • Python
    • Jquery & JavaScript
    • Selenium
  • Log & Monitor
    • DataDog
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
    • NextCloud
  • Toggle search form

[Case dị – istio] Những case khó đỡ khiến chúng ra suy nghĩ là istio có chạy được hay ko?

Posted on September 28, 2021November 15, 2021 By nim No Comments on [Case dị – istio] Những case khó đỡ khiến chúng ra suy nghĩ là istio có chạy được hay ko?

Contents

  • Case 1: Bạn đã cài đặt inject sidecar istio, virtualService, Gateway. Đùng cái owner của workload tự gỡ inject sidecar istio thì sẽ bị j?
  • Case 2: 2 virtualService, Gateway giống domain nhưng lại khác path.
  • Case 3: Bạn đang phân vân workload có inject sidecar isito hay ko????, workload có đang sử dung ingress-nginx hay gateway của isito???? Dưới đây là cách:
  • Case 4: There are too few istiod pod to understand why istiod hang – update Sat 6 Nov 2021
    • sovle problem
    • Note
      • 1) Min scale HPA of istiod
      • 2) request resource ram and cpu of Istiod shouldn’t too much
  • Case 5: container “istio-proxy” to inject to workload that is timeout.

Case 1: Bạn đã cài đặt inject sidecar istio, virtualService, Gateway. Đùng cái owner của workload tự gỡ inject sidecar istio thì sẽ bị j?

Bạn thấy app httpbin của mình đang có sidecar isito nhé

while true; do curl http://fleetman-webapp.nimtechnology.com/ip; echo; sleep 0.5; done

Mình curl vào link đó liên tục và quan sát kiali

thấy dashboard hiển thị ngon rồi ha

GIờ chán đơì gỡ inject ra thử hihi

Chỉnh annotation thành false và save lại
Đã không con side car
Ầu ơ mất đồ thị mũi tên òi
Nhưng curl vẫn có kết quả nhé.

Lúc này thì virtualService, Gateway sẽ chạy như 1 ingress bình thường và đưa traffic xuống service nhé.
Đương nhiên là mấy canary, header, bala bala khả năng ko chạy được

Case 2: 2 virtualService, Gateway giống domain nhưng lại khác path.

trong đâu chúng ta nghĩ là:
– workload a sẽ truy cập bằng đường link: a.nimtechnology.com
– workload b sẽ truy cập bằng đường link: b.nimtechnology.com

Bạn thử sem mình nghịch j ko giống như case bên trên nhé

Mình tạo app trên là httpbin:

Mình cấu hình là với app này thì chỉ truy cập vào domain: fleetman-webapp.nimtechnology.com và path là: /ip

Kiểm tra truy cập:

Ngon lành hà

Mình tạo app để upload file

mà mình cho phép truy cập vào app này với domain: fleetman-webapp.nimtechnology.com và path là: /

Vẫn dô được nè

Case 3: Bạn đang phân vân workload có inject sidecar isito hay ko????, workload có đang sử dung ingress-nginx hay gateway của isito????
Dưới đây là cách:

Case 4: There are too few istiod pod to understand why istiod hang – update Sat 6 Nov 2021

Gần đây mình bắt gặp 1 số case như có 1 lỗi chung istio-proxy call về pilot bị lỗi và istio-proxy ko trong status ready
Đại loại các bạn sẽ hiểu istio-proxy sidecar ở workload nó sẽ gửi về pilot(istiod) một thứ là ADS.
Lúc này istiod nhận được thì new connection và push trả cho istio-proxy sidecar là XDS

Lúc đó bạn thấy istiod cluster primary ko có lỗi error j hết

Chỉ lạ là nó ko trả về các XDS như trên 1 hình.

Hoặc là ở istiod ở cluster remote thì nó bị lỗi: unable to get node ….. not fount

sovle problem

Lúc đó thì ở istiod cần tăng scale hày replicate lên thì tạo ra pod istiod mới là hết lỗi và xoá các istiod có biêủ hiện lại.

Note

Mình có 2 điều muốn note lại.

1) Min scale HPA of istiod

ở cluster primary thì HPA min scale cho istiod nên là 5
ở cluster remote thì HPA min scale cho istiod nên là 2

2) request resource ram and cpu of Istiod shouldn’t too much

Có gặp 1 case là istiod bị treo ở tại thời điểm treo nhó cũng nắm kha khá connected.
Ví dụ để request cpu là 2
lúc đầu start istiod đang usage cpu là 500m, số lượng connected istio-proxy trên istiod tăng lên đột biến thế là cpu usage lên 1 ở đây thì nó bị treo và ko nhận connected nữa và cpu cũng ko tăng nữa.
HPA set cho CPU là 80%

Và thể istiod cũng ko scale thêm pod mới luôn thế là làm các connected trên dashboard rớt ầm ầm.

Case 5: container “istio-proxy” to inject to workload that is timeout.

theo như một master debug:
có check log con istio-proxy thấy báo mấy lỗi liên quan tới access log tcp_proxy, nên e thử gỡ ra

rất tiếc là ko chụp lại được.


apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  name: email
  namespace: istio-system
spec:
  configPatches:
  - applyTo: NETWORK_FILTER
    match:
      listener:
        filterChain:
          filter:
            name: envoy.filters.network.tcp_proxy
    patch:
      operation: MERGE
      value:
        typed_config:
          '@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
          access_log:
          - name: envoy.access_loggers.file
            typed_config:
              '@type': type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog
              format: |
                [%START_TIME%] "%REQ(:METHOD)% %REQ(X-ENVOY-ORIGINAL-PATH?:PATH)% %PROTOCOL%" %RESPONSE_CODE% %RESPONSE_FLAGS% "%DYNAMIC_METADATA(istio.mixer:status)%" "%UPSTREAM_TRANSPORT_FAILURE_REASON%" %BYTES_RECEIVED% %BYTES_SENT% %DURATION% %RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)% "%REQ(X-FORWARDED-FOR)%" "%REQ(USER-AGENT)%" "%REQ(X-REQUEST-ID)%" "%REQ(:AUTHORITY)%" "%UPSTREAM_HOST%" %UPSTREAM_CLUSTER% %UPSTREAM_LOCAL_ADDRESS% %DOWNSTREAM_LOCAL_ADDRESS% %DOWNSTREAM_REMOTE_ADDRESS% %REQUESTED_SERVER_NAME% %ROUTE_NAME%
              path: /dev/stdout
  workloadSelector:
    labels:
      workload.user.cattle.io/workloadselector: deployment-default-email

Đang nghi vấn là istio 1.9.9 không hợp với name: envoy.filters.network.tcp_proxy

Isito-EnvoyFilter, Kubernetes & Container

Post navigation

Previous Post: [OPA Gatekeeper] Sử dụng openpolicyagent để ngăn chặn việc apply yaml tuỳ tiện và sai lên kubernetes!
Next Post: [note – link] Note các links về tài liệu hay

More Related Articles

[Longhorn] fix No schedule volumes in Taint Toleration Nodes Kubernetes & Container
[wordpress] Install WordPress so easily. Kubernetes & Container
[Istio] Canary Upgrade Istio by Operator. This way is very easy!! Isito-EnvoyFilter
[Istio-Multi Cluster] Tutorial is very detailed to install Primary-Remote on different networks Isito-EnvoyFilter
[Istio/Recheck Envoy] Test các features liên quan đến EnvoyFilter trên Istio . Isito-EnvoyFilter
[Cosign/Kyverno]Signing And Verifying Container Images With Sigstore Cosign And Kyverno Kubernetes

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

  • [Prometheus/Grafana] Install Prometheus and Grafana on ubuntu. March 27, 2023
  • [Kong Gateway] WebSocket connection failed March 26, 2023
  • [Nextcloud] Can’t download files to have a size bigger than 2Gi on NextCloud – RaspBerry March 24, 2023
  • [Datadog] Using DataDog to monitor all services on kubernetes March 19, 2023
  • [Metrics Server] Failed to make webhook authorizer request: the server could not find the requested resource March 17, 2023

Archives

  • 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
    • ArgoCD
    • ArgoWorkflows
    • Git
      • Bitbucket
    • Harbor
    • Jenkins
    • Spinnaker
    • TeamCity
  • Coding
    • Golang
    • Jquery & JavaScript
    • Laravel
    • Python
    • Selenium
    • Terraform
      • AWS – Amazon Web Service
      • GCP – Google Cloud
  • Kubernetes & Container
    • Apache Kafka
      • Kafka
      • Kafka Connect
      • Lenses
    • Docker
    • Helm Chart
    • Isito-EnvoyFilter
    • Kong Gateway
    • Kubernetes
      • Ingress
    • Longhorn – Storage
    • MetalLB
    • Vault
    • VictoriaMetrics
  • Log & Monitor
    • DataDog
    • ELK
      • Kibana
      • Logstash
    • Grafana
    • Prometheus
  • Uncategorized
  • Admin

Copyright © 2023 NimTechnology.