Zhao Mingshan (Liheng)
Kruise Rollout [1] is an open-source progressive delivery framework from the OpenKruise community. Kruise Rollout supports canary rollout, blue-green rollout, and A/B Testing rollout in conjunction with traffic and instance grayscale. In the rollout process, Kruise Rollout can automatically perform batch rollout and pause the rollout automatically based on the Prometheus Metrics. It also provides non-inductive docking of the by-pass and compatibility with multiple existing workloads (Deployment and CloneSet).
Ingress API is an abstraction for service gateways in Kubernetes. It is also the most widely used gateway resource in the Kubernetes community, with the most representative being the Nginx Ingress Controller. However, there are also some problems with Ingress resources, mainly because the definition of Ingress is relatively simple and cannot meet some complex network requirements. In many scenarios, Ingress controllers need to be extended by defining Annotations or CRD. For example, Istio extends Virtual Service and DestinationRule resources.
The SIG-NETWORK community proposed the Gateway API resource to solve the problems above and promote the community to use unified standards, which is a collection of API resources in Kubernetes, including GatewayClass, Gateway, HTTPRoute, TCPRoute, and Service. Together, these resources build models for various network use cases. Currently, this interface has been implemented in many community open-source projects (such as Istio, Nginx, and Kong). As a progressive delivery framework, Kruise Rollout should support the Gateway API. The following is an example of using the Gateway API for canary rollout:
apiVersion: gateway.networking.Kubernetes.io/v1alpha2 kind: HTTPRoute metadata: name: echoserver spec: hostnames: - test.app.domain rules: - backendRefs: - group: "" name: echoserver port: 80 --- apiVersion: rollouts.kruise.io/v1alpha1 kind: Rollout spec: objectRef: ... strategy: canary: steps: - weight: 20 pause: {} trafficRoutings: - service: echoserver gateway: httpRouteName: echoserver
Kruise Rollout supports the batch rollout of stateless applications (Deployments and CloneSets) in Version 0.1.0, while stateful applications have similar demands. The StatefulSet community supports retaining the number of Pods in the old version during the rollout process (old-version Pods with an Order smaller than Partition should be retained), so Kruise Rollout can easily integrate stateful workloads based on this feature (including Advanced StatefulSet of Kruise). The following is an example of a rollout in three batches:
apiVersion: apps/v1 kind: StatefulSet metadata: name: echoserver spec: replicas: 5 template: spec: containers: - name: echoserver image: cilium/echoserver:latest --- apiVersion: rollouts.kruise.io/v1alpha1 kind: Rollout metadata: name: rollouts-demo spec: objectRef: workloadRef: apiVersion: apps/v1 kind: StatefulSet name: echoserver strategy: canary: steps: - replicas: 1 pause: {} - replicas: 2 pause: {duration: 60} - replicas: 2
Developers considered many ease-of-use issues of Kruise Rollout at the beginning of its design. It can be quickly integrated with many excellent deployment solutions in the community. For example, users can use Helm to complete the Rollout delivery of applications. With the increase of Kruise Rollout users and scale, new requirements for ease of use have been put forward, such as:
Kruise Rollout has added the Batch Tagging on Pod capability to meet the requirements above. In the Rollout process, each batch of Pods can be tagged with the corresponding batch label[apps.kruise.io/rollout-batch-id]={Value
as the corresponding batch, such as 1,2,3...}. The usage is listed below:
apiVersion: rollouts.kruise.io/v1alpha1 kind: Rollout metadata: name: rollouts-demo spec: ... # required rolloutID: v1
KubeVela [2] is a cloud-native application management platform based on the OAM model. It provides comprehensive application delivery, application distribution, and multi-cluster management capabilities. Currently, Kruise Rollout has been integrated into KubeVela, and the Helm Charts canary rollout can be easily implemented using trait. For more information, please see the doument[3] at the end of this article:
apiVersion: core.oam.dev/v1beta1 kind: Application spec: components: - name: canary-demo type: webservice properties: image: barnett/canarydemo:v1 traits: - type: kruise-rollout properties: canary: steps: # The first batch of Canary releases 20% Pods, and 20% traffic imported to the new version, require manual confirmation before subsequent releases are completed - weight: 20 trafficRoutings: - type: nginx
As a by-pass progressive delivery framework, Kruise Rollout can be easily integrated with excellent application delivery platforms in the community. Users don't need to make additional changes; they only need a Kruise Rollout CRD definition.
You are welcome to try it! If you encounter any problem, please submit an issue.
[1] Kruise Rollout:https://github.com/openkruise/rollouts
[2] KubeVela:https://kubevela.io/
[3] Document: https://kubevela.net/docs/end-user/traits/rollout
Github:https://github.com/openkruise/rollouts
Official:https://openkruise.io/
Slack: Channel in Kubernetes Slack
Kruise Rollout Enables Progressive Delivery for All Workloads
503 posts | 48 followers
FollowAlibaba Cloud Community - September 23, 2022
Alibaba Cloud Native Community - September 20, 2022
Alibaba Cloud Native Community - July 27, 2023
Alibaba Cloud Native Community - November 22, 2023
Alibaba Cloud Native Community - August 12, 2022
Alibaba Cloud Native Community - September 20, 2022
503 posts | 48 followers
FollowAlibaba Cloud Container Service for Kubernetes is a fully managed cloud container management service that supports native Kubernetes and integrates with other Alibaba Cloud products.
Learn MoreAlibaba Cloud Function Compute is a fully-managed event-driven compute service. It allows you to focus on writing and uploading code without the need to manage infrastructure such as servers.
Learn MoreProvides a control plane to allow users to manage Kubernetes clusters that run based on different infrastructure resources
Learn MoreHigh Performance Computing (HPC) and AI technology helps scientific research institutions to perform viral gene sequencing, conduct new drug research and development, and shorten the research and development cycle.
Learn MoreMore Posts by Alibaba Cloud Native Community