In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
How to carry out the Istio service grid deployment practice, in view of this problem, this article introduces the corresponding analysis and answer in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.
As the infrastructure layer to deal with service communication, ServiceMesh technology has been highly concerned by the community by introducing lightweight network agents to achieve key functions such as service access, traffic governance, observability and so on. Istio is an open source ServiceMesh product, which provides a complete solution to meet the needs of micro-service applications.
Based on the newly released Istio1.7.3 version, the project introduces the installation and deployment process of Istio from the installation and deployment, and combines the Bookinfo sample application to facilitate readers to understand the various components and functions of Istio.
Prepare for the Kubernetes cluster
Before installation, you need to prepare a set of available Kubernetes clusters. Here we use Istio 1.7.3 for installation. The officially recommended Kubernetes versions include 1.16,1.17,1.18.
This article uses the container engine service CCE provided by Baidu Smart Cloud, which provides the lifecycle management of containers and can meet the requirements of Istio installation and deployment. The selected Kubernetes version is 1.16.8, including two nodes, configured as CentOS 7.3x86x64 (64bit), and 4 cores 12G.
Istio installation files
Download Istio, including installation files, samples, and istioctl command-line tools.
1. Here we use the MAC system, and you can download the latest version of Istio with the following command:
$curl-L https://istio.io/downloadIstio | sh-
You can also directly visit the Istio release (https://github.com/istio/istio/releases/tag/1.7.3) page to download the installation files corresponding to the current operating system.
Note: the current latest version is 1.7.3. If you need to download the installation history version, you can specify the environment variable ISTIO_VERSION on the command line. If you download the installation package for a specific system architecture, you need to set the environment variable TARGET_ARCH.
2. Change to the directory where the Istio package is located. Here our directory is called istio-1.7.3, and the installation directory contains the following:
$cd istio-1.7.3/
Manifests/ directory: install istio related manifest files, including charts, profiles, etc.
Samples/ directory: contains a set of sample applications covering a variety of application scenarios
Bin/ directory: the client file that contains istioctl. The istioctl command line tool is used to manually inject Envoy sidecar agents
Tools/ directory: scripts related to istio installation and usage
Add the istioctl client path to the path environment variable and execute the following command under the MAC system:
$export PATH=$PWD/bin:$PATHIstio deployment practice
Istio mainly provides the following three installation methods, which users can choose according to their actual needs.
1. Install using Istioctl: istioctl is a command line tool that supports a variety of custom options, and users can configure flexibly to customize the installation of Istio components. Istio officially recommends this method for installation and deployment, which can be used in production environments.
2. Use Helm custom installation: this installation method uses Helm charts to define the installation option of Istio, which has been deprecated.
3. Install independent Operator: this method uses a separate Istio operator to install istio and manage the installation configuration in a declarative way. It is still in the experimental stage and is not recommended in production environment.
Next we mainly use istioctl installation mode to introduce the installation steps and component information of istio.
Deploy Istio
1. Use demo configuration file for installation
Istio officially provides configuration files for different scenarios, and these built-in profiles provide customization of the Istio control plane and data plane. Users can select a specific configuration file according to the actual scenario, and then complete the customized installation combined with custom options. The following built-in profiles are currently available:
Default: components are enabled based on default installation options and are recommended for deployment in production environments.
Demo: used to demonstrate the basic functions of Istio and support running Bookinfo applications and related tasks.
Minimal: the minimum number of components required to use the traffic management capabilities of Istio.
Remote: used to configure remote clusters in a multi-cluster service grid scenario.
Empty: the base file that no components are deployed and can be used to customize the configuration.
Preview: contains experimental features to explore new features of Istio, but does not guarantee stability.
After the above configuration file is selected, you can add one or more-- set = options to the command line when installing Istio to complete the configuration of other options for the Istio installation plug-in.
For the convenience of testing here, we directly use the built-in demo configuration file to install it, and execute the following command:
$istioctl install-set profile=demoDetected that your cluster does not support third party JWT authentication. Falling back to less secure first party JWT. See https://istio.io/docs/ops/best-practices/security/#configure-third-party-service-account-tokens for details. ✔ Istio core installed ✔ Istiod installed ✔ Egress gateways installed ✔ Ingress gateways installed ✔ Installation complete
This command indicates that the Istio component is installed on the Kubernetes cluster as described in the default configuration file.
2. View the status of components
Then check whether the Kubernetes service has been created successfully:
$kubectl get svc-n istio-systemNAME TYPE CLUSTER-IP EXTERNAL-IP PORT (S) AGEistio-egressgateway ClusterIP 172.18.2.116 80 15443/TCP 5m35sistio-ingressgateway LoadBalancer 172.18.177.126 154.85.54.75 15021:30059/TCP,80:31088/TCP,443:31806/TCP,31400:30831/TCP,15443:32665/TCP 5m35sistiod ClusterIP 172.18.167.120 15010/TCP,15012/TCP,443/TCP,15014/TCP 853/TCP 6m1s
Check to see if Kubernetes pod has been properly deployed and is in a Running state:
$kubectl get pod-n istio-systemNAME READY STATUS RESTARTS AGEistio-egressgateway-7bf76dd59-vtsj9 1 6m13s 1 Running 0 5m46sistio-ingressgateway-586dbbc45d-2l6sz 1 Running 0 5m46sistiod-6cc5758d8c-mgdcb 1 6m13s
3. Turn on automatic injection
After Istio installation, you need to enable automatic injection of sidecar before deploying the application. Here, you can tag the namespace by executing the following command:
$kubectl label namespace default istio-injection=enablednamespace/default labeled deploys Bookinfo sample application
A variety of sample applications are included in the downloaded Istio installation file. Here we take Bookinfo as an example to introduce the deployment and use of the service. The application consists of four separate microservices:
Productpage: this service invokes two microservices, details and reviews, to generate pages.
Details: this service contains information about books.
Reviews: this service contains book-related reviews and invokes the ratings microservice.
Ratings: this service contains rating information made up of book reviews.
These micro-services are implemented in different programming languages and implement a simple online bookstore platform for displaying basic information such as description and rating of books.
1. Deploy the sample application using kubectl
Enter the istio installation directory istio-1.7.3 and execute the following command to complete the application deployment.
$kubectl apply-f samples/bookinfo/platform/kube/bookinfo.yamlservice/details createdserviceaccount/bookinfo-details createddeployment.apps/details-v1 createdservice/ratings createdserviceaccount/bookinfo-ratings createddeployment.apps/ratings-v1 createdservice/reviews createdserviceaccount/bookinfo-reviews createddeployment.apps/reviews-v1 createddeployment.apps/reviews-v2 createddeployment.apps/reviews-v3 createdservice/productpage createdserviceaccount/bookinfo-productpage createddeployment.apps/productpage-v1 created
2. Check whether the service and instance are created normally.
$kubectl get svcNAME TYPE CLUSTER-IP EXTERNAL-IP PORT (S) AGEdetails ClusterIP 172.18.44.247 9080/TCP 26skubernetes ClusterIP 172.18.0.1 443/TCP 35mproductpage ClusterIP 172.18.106.238 9080/TCP 26sratings ClusterIP 172.18.2.59 9080/TCP 26sreviews ClusterIP 172.18.10.251 9080/TCP 26s $kubectl get podNAME READY STATUS RESTARTS AGEdetails-v1-5974b67c8-cpw96 2 5974b67c8-cpw96 2 Running 0 3m31sproductpage-v1-64794f5db4-svfk2 2 Running 0 3m30sratings-v1-c6cdf8d98-skc4q 2 3m30sratings-v1-c6cdf8d98-skc4q 2 Running 0 3m30sreviews-v1-7f6558b974-cwsh9 2 Running 0 3m30sreviews-v2-6cb6ccd848-5fzgc 2 3m31s 2 Running 0 3m31sreviews-v3-cc56b578-qqmn2 2 3m31s 2 Running 0
You can see that both the service and the instance have been created successfully.
3. Determine the IP and port of Ingress
After the Bookinfo service is up and running normally, you need to set up the Istio gateway so that the application can be accessed outside the Kubernetes cluster.
$kubectl apply-f samples/bookinfo/networking/bookinfo-gateway.yamlgateway.networking.istio.io/bookinfo-gateway createdvirtualservice.networking.istio.io/bookinfo created
The Kubernetes cluster we use here supports external load balancers, and you can see that it has been assigned to EXTERNAL-IP:
$kubectl get svc istio-ingressgateway-n istio-systemNAME TYPE CLUSTER-IP EXTERNAL-IP PORT (S) AGEistio-ingressgateway LoadBalancer 172.18.177.126 154.85.575 15021 154.85.75 15021V 30059max TCP 14m
Set up ingress IP and port:
$export INGRESS_HOST=$ (kubectl-n istio-system get service istio-ingressgateway-o jsonpath=' {.status.loadBalancer.ingress [0] .ip}') $export INGRESS_PORT=$ (kubectl-n istio-system get service istio-ingressgateway-o jsonpath=' {.spec.ports [? (@ .name = = "http2")] .port}') $export GATEWAY_URL=$INGRESS_HOST:$INGRESS_PORT
4. Application access
Open the address http://${GATEWAY_URL}/productpage on the browser side, and the address we get here is 154.85.54.75 http://${GATEWAY_URL}/productpage 80. You can see the following interface.
This is the answer to the practical question on how to deploy Istio service grid. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.