OpenKruise is a set of standard extensions for Kubernetes. It can be used with native Kubernetes to efficiently manage application pods, sidecar containers, and image distribution. This topic describes how to use OpenKruise to deploy cloud-native applications.
Prerequisites
Background information
OpenKruise is an open source automation engine that Alibaba Cloud provides for cloud-native applications. It is used as a deployment base to migrate the business of Alibaba Group to the cloud. OpenKruise has joined the Cloud Native Computing Foundation (CNCF) Sandbox project.
OpenKruise contains various types of custom workloads. You can use the workloads to deploy and manage stateless applications, stateful applications, sidecar containers, and daemon applications. OpenKruise also supports advanced strategies such as in-place upgrades, canary releases, stream upgrades, and priority configuration.
Component architecture

Component | Description |
---|---|
Kruise-manager | Kruise-manager is a control plane component that runs controllers and webhooks. It is deployed by a Deployment in the kruise-system namespace. It uses controllers and webhooks to implement key features such as in-place upgrades and sidecar management. |
Kruise-daemon | Kruise-daemon is deployed by a DaemonSet on every node, and manages features such as image pre-download and container restart. |
Usage notes
OpenKruise provides controllers such as CloneSet, Advanced StatefulSet, and Advanced DaemonSet. The following section describes the features of commonly used controllers.
Controller | Feature | Star rating |
---|---|---|
CloneSet |
CloneSets are equivalent to Kubernetes-native Deployments. CloneSets are used to manage stateless applications. For more information, see CloneSet. The fields in a CloneSet YAML file do not completely match those in a Deployment YAML file. However, CloneSets support all features of Deployments and provide more strategies. |
✩✩✩✩✩ |
Advanced StatefulSet |
Advanced StatefulSets are equivalent to Kubernetes-native StatefulSets. Advanced StatefulSets are used to manage stateful applications. For more information, see Advanced StatefulSet. The fields in an Advanced StatefulSet YAML file completely match those in a StatefulSet
YAML file. You need only to change the value of |
✩✩✩✩ |
Advanced DaemonSet |
Advanced DaemonSets are equivalent to Kubernetes-native DaemonSets. Advanced DaemonSets are used to manage daemon applications. For more information, see Advanced DaemonSet. The fields in an Advanced DaemonSet YAML file completely match those in a DaemonSet
YAML file. You need only to change the value of |
✩✩✩✩ |
SidecarSet |
The SidecarSet controller independently manages sidecar containers and injects sidecar containers to pods. For more information, see SidecarSet. After you define a sidecar container and a label selector in an independent custom resource (CR), OpenKruise injects the defined sidecar container to the pod that matches the conditions when the pod is created. You can also perform in-place upgrades for the injected sidecar container by using a SidecarSet. |
✩✩✩✩ |
UnitedDeployment |
The UnitedDeployment controller manages multiple sub-workloads in different regions. For more information, see UnitedDeployment. The UnitedDeployment controller supports the following sub-workloads: CloneSets, StatefulSets, and Advanced StatefulSets. You can use one UnitedDeployment to manage sub-workloads in different regions and replicated pods of these sub-workloads. |
✩✩✩ |
The following section compares the CloneSet, Advanced StatefulSet, and Advanced DaemonSet controllers of OpenKruise with the equivalent controllers provided by the Kubernetes community.
Feature | CloneSet VS Deployment | Advanced StatefulSet VS StatefulSet | Advanced DaemonSet VS DaemonSet | |||
---|---|---|---|---|---|---|
CloneSet | Deployment | Advanced StatefulSet | StatefulSet | Advanced DaemonSet | DaemonSet | |
Stream scaling | Not supported (coming soon) | Not supported | Not supported | Not supported | Supported | Not supported |
Selective pod deletion | Supported | Not supported | Supported | Not supported | Not supported | Not supported |
Upgrade pods upon recreation | Supported | Supported | Supported | Supported | Supported | Supported |
In-place pod upgrade | Supported | Not supported | Supported | Not supported | Not supported (coming soon) | Not supported |
Canary release | Supported | Not supported | Supported | Supported | Supported | Not supported |
Maximum available pods | Supported | Supported | Supported | Not supported | Supported | Supported |
MaxSurge | Supported | Supported | Not supported | Not supported | Supported | Not supported |
Custom release sequence by using the priority or scatter strategy | Supported | Not supported | Supported | Not supported | Supported | Not supported |
Pod lifecycle management by using the lifecycle hook | Supported | Not supported | Not supported | Not supported | Not supported | Not supported |
Install OpenKruise
CustomResourceWebhookConversion
feature gate in kube-apiserver before you install OpenKruise. For more information,
see Feature gates.
- Install OpenKruise through the Add-ons page: You can click one button to install OpenKruise. You can also upgrade or uninstall OpenKruise based on your requirements.
- Install OpenKruise through the App Catalog page: You can click one button to install
OpenKruise. However, after OpenKruise is installed, you can upgrade it only by running
the
helm upgrade
command.
Install OpenKruise through the Add-ons page
Install OpenKruise through the App Catalog page
- Log on to the ACK console.
- In the left-side navigation pane of the ACK console, choose .
- On the Marketplace page, click the App Catalog tab, find and click ack-kruise.
- On the ack-kruise page, click Deploy.
- In the Deploy panel, select a cluster and namespace, and click Next.
- On the Parameters wizard page, specify the parameters and click OK.