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

[Istio] Canary Upgrade Istio by Operator. This way is very easy!!

Posted on September 9, 2021September 10, 2021 By nim No Comments on [Istio] Canary Upgrade Istio by Operator. This way is very easy!!

Để làm được bài này thì bạn cần có 1 cụm isito đã được cài trước đó và với version thấp hơn
Istio trước mình cài version 1.9.8 và đặt tên nó là primary.
Và giờ mình có nhu cầu nâng lên version 1.10.4
Tham khảo cách cài isito bằng operator ở bài viết bên dưới

[istio] Sử dụng istio-operator và istioctl để cài đặt Istio
Safe and sound canary upgrade for your Istio control plane · Banzai Cloud
Hình đẹp nên xin về sài nhuôn

Giờ bạn thực hiện download package mới của isito version 1.10.4 và để lựa chọn version phù hơp thì vào link sau:

https://github.com/istio/istio/releases/

Dông dài quá rồi action thôi.

curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.10.4 TARGET_ARCH=x86_64 sh -
./istio-1.10.4/bin/istioctl profile dump default > /root/istio-operator-1.10.4-default.yaml

Thực hiện sửa file operator, điều quan trong ở đây bạn cần phải giữ file operator của isito primary nhé.
Chứ bạn mà dục mất thì chỉnh file cho canary hơi phiêu đấy

Màu đò là file primary cũ của mình

Trên file operator của canary thì mình sẽ đánh revision là canary nhé.

Thêm revision là canary để upgrade

Sau khi sửa xong thì mình gen file manifest để apply trên k8s

mkdir canary-upgrade
./istio-1.10.4/bin/istioctl manifest generate -f /root/istio-operator-1.10.4-default.yaml > /root/canary-upgrade/istio-canary-1.10.4.yaml

xong apply, Dưới đây là screen shot 2 thanh niên isito primary và isito canary .
Bạn sẽ thấy nó sài chung 1 số thứ he và có 1 số thứ ở 2 thằng sẽ riêng
Giờ chơi trò tìm điểm khác nhau của picture khá thú dị.

Đây là ảnh của isito-canary sau khi apply
Anh isito primary sau khi apply file canary

Lúc đâù thì workload đang sử dụng isito version 1.9.8

Để namespace nào inject sidecar của version mới thì bạn chạy câu lệnh như bên dưới he.

kubectl label namespace default istio-injection- istio.io/rev=canary --overwrite

Rồi bạn redeploy workload đó.

Giờ nó qua isito 1.10.4 rồi.

Giờ chán quá muốn trở về cũ thì sao.

kubectl label namespace default istio.io/rev- istio-injection=enabled --overwrite
>>>>Chiều các bạn được hết.

Có điển bạn cần chú ý ở “ValidatingWebhookConfiguration” của canary, thì nó vẫn đang trỏ vào isitod chứ không isito canary.

mà isitod của canary là tên trong hình cơ.

Xin để nguyên văn câu nói của Isito

Nó sẽ có 1 bước là bạn chuyển tất cả các workload qua canary he.

>>>> Dùng lệnh này để kiểm tra
./istio-1.10.4/bin/istioctl version

Sau khi đã chắc chắn là ko con workload bên 1.9.8 thì gõ lệnh, thôi lên argocd xoá đi.

delete isitod của isito primary nhé.
Xong đã xoá check thử sem có vấn đề gì ko?
log istiod-canary
Log của isito-ingressgateway cũng bung từa lưa.

isito-ingressgateway thì ko thấy nhảy log nữa

các app của mình đang chạy phà phà.

Giờ cấu hình file operator cho Primary từ file operator canary trước đó.

cp istio-operator-1.10.4-default.yaml istio-operator-primary-1.10.4-default.yaml

Loại bỏ revision canary đi như ảnh

>>>> gen file manifest và apply

./istio-1.10.4/bin/istioctl manifest generate -f /root/istio-operator-primary-1.10.4-default.yaml > /root/istio-1.10.4.yaml

Giờ apply và sem kết quả?

Đây là isito primary sau khi upgrade.
>>>>move các workload về primary

kubectl label namespace default istio.io/rev- istio-injection=enabled --overwrite

>>>> rồi kiểm tra lại
./istio-1.10.4/bin/istioctl version

Giờ bạn trờ qua bên canary và xoá các components có chữ canary.

Bạn xoá app isito-canary như hình, bạn mà chọn khác bay cum isito nhé

các Cứ từ xoá nhé. chứ production tay nhanh là mệt đấy.

Giờ qua primary xoá tiếp.

Bạn xoá component có dâú (x) nhé.
Thấy màu như hình là có vẻ ngon nhé

Giờ check log

Log isitod vẫn đẹp ha.
Log của isito-ingressgateway cũng ok he

Rồi giờ bạn check app của bạn đi qua istio có lỗi không? bằng các bài viết ở link dưới.

https://notes.nimtechnology.com/?s=Istio%2FRecheck+Envoy

Có video cho các bạn tham khảo:

https://istio.io/latest/docs/setup/upgrade/canary/

Isito-EnvoyFilter

Post navigation

Previous Post: [Spinnaker] Install Spinnaker on Kubernetes through Helm from OpsMx
Next Post: [Telegram] Hướng dẫn tạo 1 con bot nhắn tin trong telegram

More Related Articles

[Istio] Workload injected Istio that can’t connect Database(Redis, PostgreSQL) – excludeOutboundPorts or excludeIPRanges Isito-EnvoyFilter
[Istio] Change resource request and limit (RAM-CPU) for components of Istio Isito-EnvoyFilter
[Istio] Analyzing Istio Performance by pprof Isito-EnvoyFilter
[Istio/multi cluster] Install multi-cluster Istio with mode “Primary-Remote” for Kubernetes on Google Cloud Platform. Isito-EnvoyFilter
[Istio] Fix lỗi validationController khi sử dụng istio-operator [revision] cài đặt istio. Isito-EnvoyFilter
[Istio] why does workload inject Istio that workload always connects fail database? – hold Application 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

  • [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.