In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
On November 19th, Rancher Labs (hereinafter referred to as Rancher), the creator of the industry's most widely used Kubernetes management platform, announced that Rio has released the beta version, which is an application deployment engine based on Kubernetes. It was launched in May this year, and the latest version is v0.6.0. Rio combines a variety of cloud native technologies to simplify the process of releasing code from a test environment to a production environment while ensuring a powerful and secure code experience.
What is Rio?
The following figure shows the architecture of Rio:
Rio adopts technologies such as Kubernetes, knative, linkerd, cert-manager, buildkit and gloo, and combines them to provide users with a complete application deployment environment.
Rio has the following features:
Build code from source code and deploy it to a Kubernetes cluster
Automatically create DNS records for the application and protect these endpoints with Let's Encrypt's TLS certificate
Automatic capacity expansion based on QPS and workload indicators
Support for canary release, blue-green release, and Aamp B deployment
Support for routing traffic through the service grid
Serverless workloads that support downsizing to zero
Deployment triggered by Git
Product Ecology of Rancher
Rio is part of Rancher's entire product ecosystem, which supports application deployment and container operations, from operating systems to applications. When Rio is used in conjunction with products such as Rancher 2.3, K3s, and RKE, enterprises can gain a complete experience of deploying and managing applications and containers.
Learn more about Rio
To understand how Rio implements the above functions, let's take a closer look at some concepts and how they work.
Install Rio pre-preparation Kubernetes clusters with Kubernetes version 1.15 or above
The kubeconfig configured for the cluster (that is, the context is the cluster to which you want to install Rio)
For the Rio CLI tools installed in $PATH, refer to the following link to learn how to install CLI:
Https://github.com/rancher/rio/blob/master/README.md installation
Using the installed Rio CLI tool, call rio install. You may need to consider the following situations:
Ip-address: a comma-separated list of IP addresses of nodes. You can use it in the following situations:
You do not use (or cannot use) layer-4 's load balancer
Your node IP is not the IP address you want traffic to reach (for example, you use an EC2 instance with a public IP)
Service
In Rio, service is a basic unit of execution. After instantiation from a Git repository or container image, a service consists of a single container and the associated sidecar of the service grid (enabled by default). For example, run a simple "hello world" application built using Golang.
Rio run https://github.com/ebauman/rio-demo
Or run the container image version:
Rio run ebauman/demo-rio:v1
Other options can also be passed to rio run, such as any port that needs to be exposed (- p 80:8080/http), or a configuration that automatically expands and shrinks (--scale 1-10). You can view all the options that can be passed through this command rio help run.
To see the service you are running, execute rio ps:
$rio psNAME IMAGE ENDPOINTdemo-service default-demo-service-4dqdw:61825 https://demo-service...
Every time you run a new service, Rio will generate a global endpoint for the service:
$rio endpointsNAME ENDPOINTSdemo-service https://demo-service-default.op0kj0.on-rio.io:30282
Note that this endpoint does not include a version-it points to a service identified by a common name, and traffic is routed according to the weight of the service.
Automatic DNS&TLS
By default, all Rio clusters will create an on-rio.io hostname for themselves, starting with a random string (such as lkjsdf.on-rio.io). The domain name becomes a wildcard domain name, and its record is resolved to the gateway of the cluster. If a NodePort service is used, the gateway can be an layer-4 load balancer or the node itself.
In addition to creating the wildcard domain name, Rio uses Let's Encrypt to generate a wildcard certificate for the domain name. This allows automatic encryption of any HTTP workload without the need for user configuration. To start this feature, pass the-p parameter to specify http as the protocol, for example:
Rio run-p 80:8080/http... Automatic expansion and reduction
Rio can automatically expand and shrink the service according to the metrics queried per second. To enable this feature, pass-- scale 1-10 as an argument to rio run, for example:
Rio run-p 80:8080/http-n demo-service-- scale 1-10 ebauman/rio-demo:v1
Executing this command will build the ebauman/rio-demo and deploy it. If we use a tool to add load to the endpoint, we can observe automatic scaling. To prove this, we need to use HTTP endpoints (instead of HTTPS) because the tools we use do not support TLS:
$rio inspect demo-serviceendpoints:- https://demo-service-v0-default.op0kj0.on-rio.io:30282- http://demo-service-v0-default.op0kj0.on-rio.io:31976
Rio inspect displays other information besides endpoints, but what we need now is endpoint information. Using the HTTP endpoint and the HTTP benchmark tool rakyll / hey, we can add a comprehensive load:
Hey-n 10000 http://demo-service-v0-default.op0kj0.on-rio.io:31976
This will send 10000 requests to the HTTP endpoint, Rio will increase the QPS and scale up appropriately, and executing another rio ps will show the scale that has been expanded:
$rio psNAME... SCALE WEIGHTdemo-service... 2 + 5 (40%) 100% phased release, canary deployment, and weight
Be careful
For each service, a global endpoint is created that routes traffic based on the weight of the underlying service.
Rio can deliver a new version of the service before rolling it out to a production environment. Releasing a new version in phases is simple:
Rio stage-image ebauman/rio-demo:v2 demo-service v2
This command uses version v2, releases a new version of demo-service in phases, and uses a container image of ebauman/rio-demo:v2. By executing the rio ps command, we can see the new phase of the release:
$rio psNAME IMAGE ENDPOINT WEIGHTdemo-service@v2 ebauman/rio-demo:v2 https://demo-service-v2... 0%demo-service ebauman/rio-demo:v1 https://demo-service-v0... 100%
Please note that the endpoint of the new service has the new function of v2, so even if the weight is set to 0%, accessing this endpoint will still take you into the v2 of the service. This allows you to verify the operation of the service before sending traffic to it.
Speaking of sending traffic:
$rio weight demo-service@v2=5%$ rio psNAME IMAGE ENDPOINT WEIGHTdemo-service@v2 ebauman/rio-demo:v2 https://demo-service-v2... 5%demo-service ebauman/rio-demo:v1 https://demo-service-v0... 95%
Using the rio weight command, we will now send 5% of our traffic (from global service endpoints) to the new version. When we are satisfied with the v2 performance of demo-service, we can increase it to 100%:
$rio promote-- duration 60s demo-service@v2demo-service@v2 promoted
After more than 60 seconds, our demo-service@v2 service will gradually increase to receive 100% of the traffic. At any endpoint in the process, we can execute rio ps and look at the process:
$rio psNAME IMAGE ENDPOINT WEIGHTdemo-service@v2 ebauman/rio-demo:v2 https://demo-service-v2... 34%demo-service ebauman/rio-demo:v1 https://demo-service-v0... 66% routing (Routing)
Rio can route traffic to endpoints based on any combination of hostname, path, method, header, and cookie. Rio also supports mirrored traffic, injection failures, configuration of retry logic, and timeouts.
Create a router
In order to start making routing decisions, we must first create a router. The router represents a hostname and a set of rules that determine how traffic sent to the hostname is routed within the Rio cluster. If you want to define a router, you need to execute rio router add. For example, to create a router that receives traffic and sends it to demo-service during the default test, use the following command:
Rio route add testing to demo-service
This creates the following routers:
$rio routersNAME URL OPTS ACTION TARGETrouter/testing https://testing-default.0pjk... To demo-service,port=80
Send to https://testing-default... Will be forwarded to demo-service over port 80.
Notice that the route created here is testing-default. Rio will always use namespace resources, so in this case, the hostname test has been named in the default namespace. To create a router in another namespace, pass-n to the rio command:
Rio-n route add... Path-based routing
To define a path-based route, specify a hostname plus a path when calling rio route add. This can be a new router or an existing router.
$rio route add testing/old to demo-service@v1
The above command creates a path-based route that receives traffic at https://testing-default./old and forwards traffic to the `demo-service@ v1` service. Br/ > the above command creates a path-based route that receives traffic at https://testing-default./old and forwards traffic to the `demo-service@ v1` service.
Headers and method-based routing
Rio supports routing policies based on HTTP headers and the value of HTTP verbs. If you want to create rules based on specific header routing, specify headers in the rio route add command:
$rio route add-header X-Header=SomeValue testing to demo-service
The above command creates a routing rule that forwards traffic to demo-service using a HTTP header of X-Header and the value of SomeValue. Similarly, you can define rules for the HTTP method:
$rio route add-- method POST testing to demo-service fault injection
An interesting feature of Rio routing is the ability to inject a fault into the response. By defining fault routing rules, you can set the percentage of failed traffic with a specified delay and HTTP code:
$rio route add-- fault-httpcode 502-- fault-delay-milli-seconds 1000-- fault-percentage 75 testing to demo-service other routing options
Rio supports allocating traffic by weight, retrying logic for failed requests, redirecting to other services, defining timeouts, and adding rewriting rules. To view these options, refer to the following link:
Https://github.com/rancher/rio
Automatic construction
Passing the git repository to rio run instructs Rio to build the code after it is submitted to the monitored branch (default: master). For Github repositories, you can start this feature through Github webhooks. For any other git repo, or you don't want to use webhooks,Rio, there is a "gitwatcher" service that periodically checks your warehouse for changes.
Rio can also build code based on pull requests from the monitored branch. If you want to configure, pass-- build-pr to rio run. There are other options for configuring this feature, including passing the name of the Dockerfile, the name of the custom built image, and pushing the image to the specified image repository.
Stack and Riofile
Rio uses a docker-compose-style manifest called Riofile to define resources
Configs: conf: index.html:-Hello World services: nginx: image: nginx ports:-80/http configs:-conf/index.html:/usr/share/nginx/html/index.html
Riofile defines a simple nginx Hello World page with all the necessary components. Deploying it through rio up creates a Stack (stack), which is a collection of resources defined by Riofile.
Riofile has many features, such as observing changes in the Git library and templating using Golang templates.
Other Rio components
Rio also has many features, such as configs, secrets, and role-based access control (RBAC). For details, please refer to:
Https://rio.io/
Rio visual Rio Dashboard
The beta version of Rio includes a brand new dashboard that makes Rio components visible. To access this dashboard, execute the command: rio dashboard. On operating systems with GUI and a default browser, Rio automatically opens the browser and loads the dashboard.
You can use the dashboard to create and edit stacks, services, routes, etc. In addition, objects used for various component technologies (Linkerd, gloo, and so on) can be viewed and edited directly, although this is not recommended. The dashboard is currently in the early stages of development, so visualization of some features, such as automatic scaling and service grids, is not yet available.
Linkerd
As the default service grid for Rio, Linked comes with a dashboard as part of the product. This dashboard can be used by performing rio linkerd, which will proxy local host traffic to the linkerd dashboard (which will not be exposed externally). Similar to the Rio dashboard, on operating systems with GUI and the default browser, Rio automatically opens the browser and loads the dashboard:
The Linkerd dashboard shows the grid configuration, traffic, and grid components of the Rio cluster. Linkerd provides some functional components of Rio routing, so these configurations may be displayed on this dashboard. There are also tools that can be used to test and debug grid configuration and traffic.
Conclusion theory
Rio provides users with many functions and is a powerful application deployment engine. These components provide powerful capabilities for developers when deploying applications, making the process stable and secure, while at the same time easy and fun. In the Rancher product ecosystem, Rio provides powerful capabilities for enterprises to deploy and manage applications and containers.
If you want to learn more about Rio, you are welcome to visit the Rio home page or Github home page:
Https://rio.io
Https://github.com/rancher/rio
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.