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
  • CI/CD
    • ArgoCD
    • ArgoWorkflows
    • Spinnaker
    • Jenkins
  • Coding
    • Terraform
      • GCP – Google Cloud
      • AWS – Amazon Web Service
    • Golang
    • Laravel
    • Jquery & JavaScript
    • Git
    • Selenium
  • Log & Monitor
    • Prometheus
    • Grafana
    • ELK
      • Kibana
      • Logstash
  • BareMetal
  • 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

[Rancher/K8s] Install rancher on K8s by Helm 3 Kubernetes
[Udemy] Download khóa học Udemy giá rẻ chỉ với 55k/khóa Kubernetes & Container
[Docker] Comand Docker hay quên!! Docker
[Postgresql] Install Postgresql in Kubernetes by helm. Kubernetes & Container
[Kubecost] Đánh giá chi phí và hiệu quả sử dụng của hệ thống Kubernetes của bạn. Kubernetes & Container
[Kubernetes] How to delete Persistent Volume is Terminating and very stubborn Kubernetes

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

  • Protected: My Assignment  June 24, 2022
  • [Spinnaker] Spinnaker writes too many logs – Reduce spinnaker log level June 22, 2022
  • [Jenkins] Jobs will be created automatically by Jenkins Job Builder June 20, 2022
  • [Postgresql] Install postgresql client and trying a few command postgresql. June 20, 2022
  • [Mount/Nextcloud] How do you mount a hard disk that was used windows into Linux. June 19, 2022

Archives

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

Copyright © 2022 NimTechnology.