[Cloud Native | Learn istio from scratch] 4. Installation of istio on actual k8s and introduction to online bookstore

insert image description here

Install Isito

Prepare to install Istio is the required compressed package

Official website download address: https://github.com/istio/istio/

1. Upload the compressed package to the control node of k8s and decompress it manually:

[root@k8smaster ~]# tar zxvf istio-1.10.1-linux-amd64.tar.gz

Switch to the directory where the istio package is located

In the samples/ directory, there are sample applications, and in the bin/ directory, there are client files for istioctl. The istioctl tool is used to manually inject the Envoy sidecar proxy.

[root@k8smaster ~]# cd istio-1.10.1 
[root@k8smaster istio-1.10.1]# ls
bin  LICENSE  manifests  manifest.yaml  README.md  samples  tools

Add the istioctl client path to the path environment variable, and the way to add the macOS or Linux system is as follows:

[root@k8smaster istio-1.10.1]# export PATH=$PWD/bin:$PATH 

Copy the executable file istioctl to the /usr/bin/directory

[root@k8smaster istio-1.10.1]# cd /root/istio-1.10.1/bin/ 
[root@k8smaster bin]# cp -ar istioctl /usr/bin/ 

The image required to install istio is pulled from the official website by default, but there will be problems when we pull the image from the official website. You can contact me to download the image on WeChat, then upload it to each node of your k8s cluster, and manually decompress the image through docker load -i

[root@k8snode1 ~]# mkdir istio
[root@k8snode1 ~]# mkdir bookinfo
[root@k8snode1 ~]# cd bookinfo/

上传六个bookinfo到这个目录。
[root@k8snode1 bookinfo]# docker load -i examples-bookinfo-details.tar.gz
[root@k8snode1 bookinfo]# docker load -i examples-bookinfo-reviews-v1.tar.gz
[root@k8snode1 bookinfo]# docker load -i examples-bookinfo-productpage.tar.gz 
[root@k8snode1 bookinfo]# docker load -i examples-bookinfo-reviews-v2.tar.gz 
[root@k8snode1 bookinfo]# docker load -i examples-bookinfo-ratings.tar.gz 
[root@k8snode1 bookinfo]# docker load -i examples-bookinfo-reviews-v3.tar.gz 
[root@k8snode1 bookinfo]# cd
[root@k8snode1 ~]# cd istio/
[root@k8snode1 istio]# docker load -i istio-1-10-1.tar.gz 
[root@k8snode1 istio]# docker load -i engress-proxyv2-1-10-1.tar.gz 
[root@k8snode1 istio]# docker load -i httpbin.tar.gz

Install and operate on the control node of k8s

[root@k8smaster istio-1.10.1]# istioctl install --set profile=demo -y

See the following, indicating that the initialization of istio is completed:
✔ Istio core installed
✔ Istiod installed
✔ Egress gateways installed
✔ Ingress gateways installed
✔ Installation complete

Uninstall the istio cluster, do not execute it for now, just remember this command.

istioctl manifest generate --set profile=demo | kubectl delete -f -

Deploy online bookstore bookinfo through Istio

Function introduction of online bookstore

Online bookstore-bookinfo
This application is composed of four separate microservices. This application imitates a classification of an online bookstore, displays information about a book, and displays a description of the book on the page. The details of the book (ISBN, page count, etc.) ), and some comments about the book.

The Bookinfo application is divided into four separate
microservices 1) The productpage microservice will call the details and reviews microservices to generate pages;
2) The details microservice contains book information;
3) The reviews microservice contains book-related comments, and it will also call the ratings microservice;
4) ratings This microservice contains rating information composed of book reviews.

The reviews microservice has 3 versions
1) The v1 version will not call the ratings service;
2) The v2 version will call the ratings service and use 1 to 5 black star icons to display rating information;
3) The v3 version will call the ratings service, And use 1 to 5 red star icons to display rating information.

The figure below shows the end-to-end architecture of this application

insert image description here
Several microservices in the Bookinfo application are written in different languages. These services have no dependencies on istio, but constitute a representative example of a service mesh: it consists of multiple services, multiple languages, and the reviews service has multiple versions.

write at the end

It is not easy to create, if you think the content is helpful to you, please support me by giving me three consecutive attentions! If there is an error, please point it out in the comment area, and I will change it in time!

The series currently being updated: learn istio from scratch

Thank you for watching, the article is mixed with personal understanding, if there is any mistake, please contact me to point out~

Guess you like

Origin blog.csdn.net/qq_45400861/article/details/127527078