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] 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

[Jenkins] Hướng dẫn sử dụng Jenkins pipeline to control Jenkins agent in k8s and deploy on k8s CI/CD
[Longhorn] fix No schedule volumes in Taint Toleration Nodes Kubernetes & Container
[Chartmuseum] Build yourself a Helm Chart Repository server Kubernetes & Container
[Datadog] Using DataDog to monitor all services on kubernetes DataDog
[Istio] Analyzing Istio Performance by pprof Isito-EnvoyFilter
[ArgoCD/KSOPS] Encrypting Resource on kustomize and Argocd. ArgoCD

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

  • Experiences for IP Addresses Shortage on EKS Clusters March 29, 2023
  • [Talisman] Discover the sensitive information in your code. March 28, 2023
  • [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

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.