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] Sử dụng istio-operator và istioctl để cài đặt Istio

Posted on August 5, 2021October 16, 2021 By nim 2 Comments on [istio] Sử dụng istio-operator và istioctl để cài đặt Istio

https://istio.io/latest/docs/setup/install/

Ở đây mình cài đặt istio version 1.9.9

Đầu tiền tải và cài đặt istioctl:

curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.9.9 TARGET_ARCH=x86_64 sh -

giờ có 2 cách để run istioctl:

Cách 1:

cd istio-1.9.9
export PATH=$PWD/bin:$PATH
istioctl version

Cách 2

cd istio-1.9.9
mv bin/istioctl /usr/local/bin/
istioctl version

Mình sài cách 3 vì mình cấn switch qua các version khách nhau

root@spinnaker-ubuntu16:~/mylab-istio# /root/istio-1.9.9/bin/istioctl version
client version: 1.9.9

Istio có rất nhiều profile

https://istio.io/latest/docs/setup/additional-setup/config-profiles/

Sử dụng istioctl để dump istio-operator với profile default

./istio-1.9.9/bin/istioctl profile dump default > /root/istio-operator-1.9.9-default.yaml

Giờ chúng ta nói 1 chút về file istio-operator-1.9.7-default.yaml

apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
  components:
    base:
      enabled: true
      k8s:  
        overlays: 
          - kind: ValidatingWebhookConfiguration  
            name: istiod-istio-system 
            patches:  
              - path: webhooks.[name:validation\.istio\.io].clientConfig.service.name # << json path to reach the target value to fix 
                value: istiod-1-9-8
    cni:
      enabled: false
    egressGateways:
    - enabled: false
      name: istio-egressgateway
    ingressGateways:
    - enabled: true
      name: istio-ingressgateway
      k8s:  
        env:  
          - name: ISTIO_META_ROUTER_MODE  
            value: "sni-dnat"
    istiodRemote:
      enabled: false
    pilot:
      enabled: true
  hub: docker.io/istio
  meshConfig:
    defaultConfig:
      proxyMetadata: {}
    enablePrometheusMerge: true
  profile: default
  tag: 1.9.8
  revision: 1-9-8

Update Sun 5 Sep -> pull image từ private

Nhưng mà mình nghĩ nếu mạng công ty mạnh nên sài repo của isito trên docker hub để họ có động lực phát triển opensource
[Harbor] Cấu hình Proxy Cache <- Docker Hub trên Harbor.
Bạn có thể tham khảo Proxy cache Docker Hub làm được dụ pull images private he

Bình thường các tutorial trên mạng họ chỉ bạn là auto inject istio theo namespace
Chỉ cần workload của bạn deploy trong namespace đó là được inject sidecar ngay

kubectl label namespace default istio-injection=enabled --overwrite
Ảnh minh hoạ

Nhưng mà mình ko sài command trên

Tiếp đến khi đã custom file Operator theo ý của bạn xong chúng ta tiếp tục gen file manifest để có thể apply bằng k8s nhé
Nếu bạn muốn apply được file Operatior trên thì một bạn sử dụng istioctl hoặc bạn cài 1 service tên là istio-operator link bên dưới bạn tự đọc nhé:

https://istio.io/latest/docs/setup/install/operator/

Vì mình không muốn cài nhiều thứ ko quá cần thiết nên gen file manifest

./istio-1.9.9/bin/istioctl manifest generate -f /root/istio-operator-1.9.9-default.yaml > /root/mylab-istio/istio-1.9.9.yaml

Tiếp đến create ns và apply

kubectl create ns istio-system

kubectl -n istio-system apply -f /root/mylab-istio/istio-1.9.7.yaml
Đây là workload nhé
Đây là service

Nếu bạn sử dụng k8s ở local tự cài thì bạn cần cài trước metrics-server và metallb nhé

Giờ bạn muốn auto inject sidecar thì làm như sau

kubectl label namespace default istio-injection- istio.io/rev=1-9-7 --overwrite

>>>>bạn file sai command này vì chúng ra đánh revision cho istio

Có lần mình quên và đã run “kubectl label namespace default istio-injection=enabled –overwrite” nó bị lỗi vì nó call về service là istiod nhưng bạn nhìn service của mình là istio-1-9-7 bạn cần run command mình chỉ nhé

Nếu workload nào bạn muốn inject sidecar istio thi thêm annotation như hình nhé
spec:
  template: # template for the pods
    metadata:
      annotations:
        sidecar.istio.io/inject: "true"

Nếu bạn install GCP và muốn sử dụng “internal load balancer on GCP” cho ingress thì làm như sau:

    ingressGateways:
    - enabled: true
      k8s:
        service_annotations:
          cloud.google.com/load-balancer-type: Internal
      name: istio-ingressgateway
Isito-EnvoyFilter, Kubernetes & Container

Post navigation

Previous Post: [ArgoCD] Hướng dẫn tạo “local user” trên argocd
Next Post: [Istio] Fix lỗi validationController khi sử dụng istio-operator [revision] cài đặt istio.

More Related Articles

[OPA Gatekeeper] Sử dụng openpolicyagent để ngăn chặn việc apply yaml tuỳ tiện và sai lên kubernetes! Kubernetes & Container
[Helm Chart] Learning Helm on Kubernetes in 60 minutes!! Helm Chart
[Kubernetes] How to delete Persistent Volume is Terminating and very stubborn Kubernetes
[Helm Chart] Tìm hiểu fullnameOverride và .fullname trong helm chart. Helm Chart
[Sonarqube] Install Sonarqube on Kubernetes and integrate with GitHub Action. Kubernetes & Container
[Keycloak/OAuth2] Install Keycloak by helm on Kubernetes Kubernetes & Container

Comments (2) on “[istio] Sử dụng istio-operator và istioctl để cài đặt Istio”

  1. Pingback: [Istio/Recheck] Hướng dẫn kiểm tra cụm istio mới cài lên đã work ngon lành chưa? – NimTechnology
  2. Pingback: [Istio] Canary Upgrade Istio by Operator. This way is very easy!! – NimTechnology

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.