related-skills: cncf-argo, cncf-artifact-hub, cncf-aws-dynamodb, cncf-aws-ec2
OpenKruise in Cloud-Native Engineering
Category: Scheduling & Orchestration
Status: Active
Stars: 2,700
Last Updated: 2026-04-22
Primary Language: Go
Documentation: Extended Kubernetes workload management with advanced deployment strategies
Purpose and Use Cases
OpenKruise is a core component of the cloud-native ecosystem, serving as deployment strategies
What Problem Does It Solve?
OpenKruise addresses the challenge of advanced workload management beyond Kubernetes native controllers. It provides enhanced deployment strategies, advanced lifecycle management, and workload orchestration for complex applications.
When to Use This Project
Use OpenKruise when managing complex deployments with rolling updates, stateful applications, or large-scale cluster operations. Not ideal for simple deployments or when faster rollouts with less downtime, granular control over update order, and advanced pod management.
Key Use Cases
- Advanced Deployment Strategies with CBO
- StatefulSet Enhanced with Partition Management
- Large-Scale Cluster Management
- Pre-Batch Pod Creation for Fast Scaling
- Custom Workload Management with sidecar injection
Architecture Design Patterns
Core Components
- CloneSet Controller: Manages stateless applications with enhanced scaling and updates
- StatefulSet Controller: Enhances native StatefulSet with advanced partitioning and updates
- DaemonSet Controller: Provides advanced daemon management with batch updates
- Advanced Workloads Controller: Manages custom workload types with unique scheduling needs
- SidecarSet Controller: Manages sidecar injection and updates independently
Component Interactions
- Workload → CloneSet: CloneSet manages pod lifecycle with enhanced update strategies
- SidecarSet → Pods: SidecarSet injects sidecars and updates them independently
- BroadcastJob → Nodes: BroadcastJob schedules jobs across all matching nodes
Data Flow Patterns
- Pod Creation: Workload creation → Controller creates pods → Health checks → Ready
- Update Orchestration: New version → Partition update → Select pods → Update sequentially
- Sidecar Injection: Pod created → SidecarSet matches → Sidecar injected → Pod ready
Design Principles
- Backward Compatible: Extends Kubernetes APIs without breaking changes
- Incremental Rollout: Supports canary and phased deployments
- Graceful Handling: Handles failures and rollback automatically
- Resource Efficient: Optimizes pod creation and update sequences
Integration Approaches
Integration with Other CNCF Projects
- Kubernetes: Core platform with extended controllers
- Helm: Installation and upgrade management
- Prometheus: Metrics collection for workloads
- Istio: Service mesh integration for traffic management
API Patterns
- Custom Resources: CloneSet, StatefulSetEnhanced, SidecarSet APIs
- Webhooks: Admission webhooks for validation
- Kubernetes Controllers: Reconciliation loops for desired state
Configuration Patterns
- CRD YAML: Define workload specifications in YAML
- Helm Values: Configure OpenKruise settings
- Admission Webhook Config: Configure webhook behavior
Extension Mechanisms
- Custom Controllers: Build controllers for custom workload types
- Mutation Webhooks: Modify pod specs before creation
- Validation Webhooks: Validate workload configurations
Common Pitfalls and How to Avoid Them
Misconfigurations
- Version Mismatch: Controller and Kubernetes version incompatibility
- How to Avoid: Check compatibility matrix, upgrade together, test in staging
- Resource Conflicts: Multiple controllers managing same pods
- How to Avoid: Use distinct workload types, separate namespaces, label management
Performance Issues
- Performance Overhead: Additional controllers impacting cluster performance
- How to Avoid: Tune controller replicas, optimize requeues, monitor metrics
- StatefulSet Partition: Incorrect partition configuration
- How to Avoid: Understand partition semantics, test upgrade order, document strategy
Operational Challenges
- Migration Complexity: Migrating existing workloads to OpenKruise
- How to Avoid: Gradual migration, test one workload, document changes
- Cluster Scaling: Controller not scaling with cluster
- How to Avoid: Vertical pod autoscaler, monitor resource usage, scale replicas
Security Pitfalls
- Security Context: Insufficient RBAC for controllers
- How to Avoid: Define least-privilege RBAC, audit permissions, test in namespace
Coding Practices
Idiomatic Configuration
- Declarative Workloads: Define workload specs in YAML manifests
- Update Policies: Configure update strategies and batch sizes
- Health Checks: Define proper readiness and liveness probes
API Usage Patterns
- kubectl apply: Apply custom workload definitions
- kubectl describe: Inspect workload status and update history
- kubectl logs: Check controller logs for issues
Observability Best Practices
- Controller Metrics: Monitor reconciliation duration and error rates
- Pod Status Metrics: Track pod health and update status
- Webhook Performance: Monitor webhook latency and success rates
Testing Strategies
- Unit Tests: Test controller reconciliation logic
- Integration Tests: Test workload updates in Kubernetes
- Stress Tests: Validate performance under load
Development Workflow
- Local Development: Use kind for local testing
- Debug Commands: Use kubectl describe and logs
- Test Environment: Set up dedicated test cluster
- CI/CD Integration: Automate testing with GitHub Actions
- Monitoring Setup: Configure Prometheus and Grafana
- Documentation: Maintain comprehensive docs
Fundamentals
Essential Concepts
- CloneSet: Controller for stateless workload management
- StatefulSetEnhanced: Enhanced StatefulSet with advanced features
- SidecarSet: Sidecar injection and management
- BroadcastJob: Job that runs on all matching nodes
- AdvancedDeployment: Enhanced deployment with advanced strategies
- InjectPod: Pod injection mechanism
- Reconciler: Controller reconciliation loop
- UpdateStrategy: Configuration for update behavior
- Partition: Control update batch size
- ReadySeconds: Wait period before considering pod healthy
Terminology Glossary
- MaxUnavailable: Maximum pods unavailable during update
- MaxSurge: Maximum pods above desired count
- UpdateOrder: Order of pod updates (NewFirst/OldFirst)
- Partition: Number of pods to skip during update
- InPlaceUpdate: In-place pod updates without recreation
Data Models and Types
- CloneSetSpec: Desired state for CloneSet
- UpdateStrategy: Update configuration
- SidecarSetSpec: Sidecar configuration
- BroadcastJobSpec: Batch job configuration
Lifecycle Management
- Workload Creation: CR created → Controller reconciles → Pods created → Ready
- Update Initiation: Spec changed → Controller detects → Update starts
- Batch Update: Select batch → Update pods → Health checks → Next batch
- Pod Recreation: Old pod deleted → New pod created → Health checks
- Update Completion: All pods updated → Update complete → Status updated
State Management
- Update Phase: Pending, Updating, Completed
- Pod Status: Ready, Updating, Failed
- Controller Phase: Reconciling, Waiting, Completed
- Partition Status: Current partition index
Scaling and Deployment Patterns
Horizontal Scaling
- Horizontal Pod Scaling: Scale pods based on load
- Controller Scaling: Scale controller replicas
- Cluster Scaling: Add nodes for more capacity
High Availability
- Controller HA: Multiple controller replicas
- Pod Spread: Spread pods across nodes
- Graceful Degradation: Continue serving during updates
- Update Rollback: Rollback to previous version if issues
Production Deployments
- Installation: Deploy using official Helm chart
- RBAC Setup: Configure appropriate cluster roles
- Webhook Configuration: Set up admission webhooks
- Monitoring Setup: Configure Prometheus metrics
- Security Hardening: Enable network policies and PodSecurityPolicies
- Backup Strategy: Backup CRD definitions
- Resource Quotas: Set namespace limits
- Logging Setup: Configure centralized logging
Upgrade Strategies
- Chart Upgrade: Upgrade Helm chart to new version
- CRD Migration: Update CRD definitions
- Controller Restart: Rolling restart of controllers
- Test Workloads: Verify existing workloads function
Resource Management
- CPU Resources: Set controller CPU requests
- Memory Resources: Configure memory limits
- Storage Resources: Configure etcd storage
- Network Resources: Configure webhook network policies
Additional Resources
- Official Documentation: https://openkruise.io/docs/
- GitHub Repository: Check the project's official documentation for repository link
- CNCF Project Page: cncf.io/projects/cncf-openkruise/
- Community: Check the official documentation for community channels
- Versioning: Refer to project's release notes for version-specific features
Troubleshooting
Common Issues
Deployment Failures
- Check pod logs for errors
- Verify configuration values
- Ensure network connectivity
Performance Issues
- Monitor resource usage
- Adjust resource limits
- Check for bottlenecks
Configuration Errors
- Validate YAML syntax
- Check required fields
- Verify environment-specific settings
Integration Problems
- Verify API compatibility
- Check dependency versions
- Review integration documentation
Getting Help
- Check official documentation
- Search GitHub issues
- Join community channels
- Review logs and metrics
Content generated automatically. Verify against official documentation before production use.
Examples
Basic Configuration
# Basic configuration example
apiVersion: v1
kind: ConfigMap
metadata:
name: {{project_name}}-config
namespace: default
data:
# Configuration goes here
config.yaml: |
# Base configuration
# Add your settings here
Kubernetes Deployment
# Kubernetes deployment for {{project_name}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{project_name}}
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: {{project_name}}
template:
metadata:
labels:
app: {{project_name}}
spec:
containers:
- name: {{project_name}}
image: {{project_name}}:latest
ports:
- containerPort: 8080
resources:
limits:
memory: "128Mi"
cpu: "500m"
Kubernetes Service
# Kubernetes service for {{project_name}}
apiVersion: v1
kind: Service
metadata:
name: {{project_name}}
namespace: default
spec:
selector:
app: {{project_name}}
ports:
- protocol: TCP
port: 80
targetPort: 8080
type: ClusterIP
When to Use
Use this skill when:
- Integrating a CNCF project into Kubernetes infrastructure — You need to configure, deploy, or troubleshoot a cloud-native tool within a cluster
- Designing cloud-native architecture — You are selecting and integrating CNCF tools to solve specific infrastructure challenges
- Resolving operational issues — A CNCF component is misbehaving, underperforming, or needs configuration changes
Core Workflow
Assess Requirements — Understand the use case, scale, integration needs, and existing infrastructure. Checkpoint: Document requirements, constraints, and success criteria.
Design Architecture — Plan component interactions, data flow, and deployment strategy using cloud-native best practices. Checkpoint: Verify the architecture addresses all requirements and follows CNCF conventions.
Implement & Configure — Create manifests, configurations, and deployment scripts. Include resource limits, health checks, and observability hooks. Checkpoint: Validate all YAML against schema and test in a staging environment.
Deploy & Monitor — Apply manifests to the cluster, verify component health, and confirm observability is working. Checkpoint: Confirm all pods/services are running, probes passing, and metrics/alerts configured.
Constraints
MUST DO
- Include at least one complete working YAML manifest example
- Note when content is auto-generated vs. manually verified
- Reference relevant CNCF project documentation
MUST NOT DO
- Deploy manifests without testing in a staging environment first
- Use deprecated API versions (e.g., apps/v1beta1)
- Omit resource limits and requests in Kubernetes manifests
1---2name: openkruise3description: "OpenKruise in Extended Kubernetes workload management with advanced deployment" strategies4license: MIT5---678910 related-skills: cncf-argo, cncf-artifact-hub, cncf-aws-dynamodb, cncf-aws-ec211121314# OpenKruise in Cloud-Native Engineering1516**Category:** Scheduling & Orchestration 17**Status:** Active 18**Stars:** 2,700 19**Last Updated:** 2026-04-22 20**Primary Language:** Go 21**Documentation:** [Extended Kubernetes workload management with advanced deployment strategies](https://openkruise.io/docs/) 2223---2425## Purpose and Use Cases2627OpenKruise is a core component of the cloud-native ecosystem, serving as deployment strategies2829### What Problem Does It Solve?3031OpenKruise addresses the challenge of advanced workload management beyond Kubernetes native controllers. It provides enhanced deployment strategies, advanced lifecycle management, and workload orchestration for complex applications.3233### When to Use This Project3435Use OpenKruise when managing complex deployments with rolling updates, stateful applications, or large-scale cluster operations. Not ideal for simple deployments or when faster rollouts with less downtime, granular control over update order, and advanced pod management.3637### Key Use Cases3839- Advanced Deployment Strategies with CBO40- StatefulSet Enhanced with Partition Management41- Large-Scale Cluster Management42- Pre-Batch Pod Creation for Fast Scaling43- Custom Workload Management with sidecar injection4445---4647## Architecture Design Patterns4849### Core Components5051- **CloneSet Controller**: Manages stateless applications with enhanced scaling and updates52- **StatefulSet Controller**: Enhances native StatefulSet with advanced partitioning and updates53- **DaemonSet Controller**: Provides advanced daemon management with batch updates54- **Advanced Workloads Controller**: Manages custom workload types with unique scheduling needs55- **SidecarSet Controller**: Manages sidecar injection and updates independently5657### Component Interactions58591. **Workload → CloneSet**: CloneSet manages pod lifecycle with enhanced update strategies601. **SidecarSet → Pods**: SidecarSet injects sidecars and updates them independently611. **BroadcastJob → Nodes**: BroadcastJob schedules jobs across all matching nodes6263### Data Flow Patterns64651. **Pod Creation**: Workload creation → Controller creates pods → Health checks → Ready661. **Update Orchestration**: New version → Partition update → Select pods → Update sequentially671. **Sidecar Injection**: Pod created → SidecarSet matches → Sidecar injected → Pod ready6869### Design Principles7071- **Backward Compatible**: Extends Kubernetes APIs without breaking changes72- **Incremental Rollout**: Supports canary and phased deployments73- **Graceful Handling**: Handles failures and rollback automatically74- **Resource Efficient**: Optimizes pod creation and update sequences7576---7778## Integration Approaches7980### Integration with Other CNCF Projects8182- **Kubernetes**: Core platform with extended controllers83- **Helm**: Installation and upgrade management84- **Prometheus**: Metrics collection for workloads85- **Istio**: Service mesh integration for traffic management8687### API Patterns8889- **Custom Resources**: CloneSet, StatefulSetEnhanced, SidecarSet APIs90- **Webhooks**: Admission webhooks for validation91- **Kubernetes Controllers**: Reconciliation loops for desired state9293### Configuration Patterns9495- **CRD YAML**: Define workload specifications in YAML96- **Helm Values**: Configure OpenKruise settings97- **Admission Webhook Config**: Configure webhook behavior9899### Extension Mechanisms100101- **Custom Controllers**: Build controllers for custom workload types102- **Mutation Webhooks**: Modify pod specs before creation103- **Validation Webhooks**: Validate workload configurations104105---106107## Common Pitfalls and How to Avoid Them108109### Misconfigurations110111- **Version Mismatch**: Controller and Kubernetes version incompatibility112 - **How to Avoid**: Check compatibility matrix, upgrade together, test in staging113- **Resource Conflicts**: Multiple controllers managing same pods114 - **How to Avoid**: Use distinct workload types, separate namespaces, label management115116### Performance Issues117118- **Performance Overhead**: Additional controllers impacting cluster performance119 - **How to Avoid**: Tune controller replicas, optimize requeues, monitor metrics120- **StatefulSet Partition**: Incorrect partition configuration121 - **How to Avoid**: Understand partition semantics, test upgrade order, document strategy122123### Operational Challenges124125- **Migration Complexity**: Migrating existing workloads to OpenKruise126 - **How to Avoid**: Gradual migration, test one workload, document changes127- **Cluster Scaling**: Controller not scaling with cluster128 - **How to Avoid**: Vertical pod autoscaler, monitor resource usage, scale replicas129130### Security Pitfalls131132- **Security Context**: Insufficient RBAC for controllers133 - **How to Avoid**: Define least-privilege RBAC, audit permissions, test in namespace134135---136137## Coding Practices138139### Idiomatic Configuration140141- **Declarative Workloads**: Define workload specs in YAML manifests142- **Update Policies**: Configure update strategies and batch sizes143- **Health Checks**: Define proper readiness and liveness probes144145### API Usage Patterns146147- **kubectl apply**: Apply custom workload definitions148- **kubectl describe**: Inspect workload status and update history149- **kubectl logs**: Check controller logs for issues150151### Observability Best Practices152153- **Controller Metrics**: Monitor reconciliation duration and error rates154- **Pod Status Metrics**: Track pod health and update status155- **Webhook Performance**: Monitor webhook latency and success rates156157### Testing Strategies158159- **Unit Tests**: Test controller reconciliation logic160- **Integration Tests**: Test workload updates in Kubernetes161- **Stress Tests**: Validate performance under load162163### Development Workflow164165- **Local Development**: Use kind for local testing166- **Debug Commands**: Use kubectl describe and logs167- **Test Environment**: Set up dedicated test cluster168- **CI/CD Integration**: Automate testing with GitHub Actions169- **Monitoring Setup**: Configure Prometheus and Grafana170- **Documentation**: Maintain comprehensive docs171172---173174## Fundamentals175176### Essential Concepts177178- **CloneSet**: Controller for stateless workload management179- **StatefulSetEnhanced**: Enhanced StatefulSet with advanced features180- **SidecarSet**: Sidecar injection and management181- **BroadcastJob**: Job that runs on all matching nodes182- **AdvancedDeployment**: Enhanced deployment with advanced strategies183- **InjectPod**: Pod injection mechanism184- **Reconciler**: Controller reconciliation loop185- **UpdateStrategy**: Configuration for update behavior186- **Partition**: Control update batch size187- **ReadySeconds**: Wait period before considering pod healthy188189### Terminology Glossary190191- **MaxUnavailable**: Maximum pods unavailable during update192- **MaxSurge**: Maximum pods above desired count193- **UpdateOrder**: Order of pod updates (NewFirst/OldFirst)194- **Partition**: Number of pods to skip during update195- **InPlaceUpdate**: In-place pod updates without recreation196197### Data Models and Types198199- **CloneSetSpec**: Desired state for CloneSet200- **UpdateStrategy**: Update configuration201- **SidecarSetSpec**: Sidecar configuration202- **BroadcastJobSpec**: Batch job configuration203204### Lifecycle Management205206- **Workload Creation**: CR created → Controller reconciles → Pods created → Ready207- **Update Initiation**: Spec changed → Controller detects → Update starts208- **Batch Update**: Select batch → Update pods → Health checks → Next batch209- **Pod Recreation**: Old pod deleted → New pod created → Health checks210- **Update Completion**: All pods updated → Update complete → Status updated211212### State Management213214- **Update Phase**: Pending, Updating, Completed215- **Pod Status**: Ready, Updating, Failed216- **Controller Phase**: Reconciling, Waiting, Completed217- **Partition Status**: Current partition index218219---220221## Scaling and Deployment Patterns222223### Horizontal Scaling224225- **Horizontal Pod Scaling**: Scale pods based on load226- **Controller Scaling**: Scale controller replicas227- **Cluster Scaling**: Add nodes for more capacity228229### High Availability230231- **Controller HA**: Multiple controller replicas232- **Pod Spread**: Spread pods across nodes233- **Graceful Degradation**: Continue serving during updates234- **Update Rollback**: Rollback to previous version if issues235236### Production Deployments237238- **Installation**: Deploy using official Helm chart239- **RBAC Setup**: Configure appropriate cluster roles240- **Webhook Configuration**: Set up admission webhooks241- **Monitoring Setup**: Configure Prometheus metrics242- **Security Hardening**: Enable network policies and PodSecurityPolicies243- **Backup Strategy**: Backup CRD definitions244- **Resource Quotas**: Set namespace limits245- **Logging Setup**: Configure centralized logging246247### Upgrade Strategies248249- **Chart Upgrade**: Upgrade Helm chart to new version250- **CRD Migration**: Update CRD definitions251- **Controller Restart**: Rolling restart of controllers252- **Test Workloads**: Verify existing workloads function253254### Resource Management255256- **CPU Resources**: Set controller CPU requests257- **Memory Resources**: Configure memory limits258- **Storage Resources**: Configure etcd storage259- **Network Resources**: Configure webhook network policies260261---262263## Additional Resources264265- **Official Documentation:** https://openkruise.io/docs/266- **GitHub Repository:** Check the project's official documentation for repository link267- **CNCF Project Page:** [cncf.io/projects/cncf-openkruise/](https://www.cncf.io/projects/cncf-openkruise/)268- **Community:** Check the official documentation for community channels269- **Versioning:** Refer to project's release notes for version-specific features270271---272273## Troubleshooting274275### Common Issues2762771. **Deployment Failures**278 - Check pod logs for errors279 - Verify configuration values280 - Ensure network connectivity2812822. **Performance Issues**283 - Monitor resource usage284 - Adjust resource limits285 - Check for bottlenecks2862873. **Configuration Errors**288 - Validate YAML syntax289 - Check required fields290 - Verify environment-specific settings2912924. **Integration Problems**293 - Verify API compatibility294 - Check dependency versions295 - Review integration documentation296297### Getting Help298299- Check official documentation300- Search GitHub issues301- Join community channels302- Review logs and metrics303*Content generated automatically. Verify against official documentation before production use.*304305## Examples306307### Basic Configuration308309310```yaml311# Basic configuration example312apiVersion: v1313kind: ConfigMap314metadata:315 name: {{project_name}}-config316 namespace: default317data:318 # Configuration goes here319 config.yaml: |320 # Base configuration321 # Add your settings here322```323324### Kubernetes Deployment325326327```yaml328# Kubernetes deployment for {{project_name}}329apiVersion: apps/v1330kind: Deployment331metadata:332 name: {{project_name}}333 namespace: default334spec:335 replicas: 1336 selector:337 matchLabels:338 app: {{project_name}}339 template:340 metadata:341 labels:342 app: {{project_name}}343 spec:344 containers:345 - name: {{project_name}}346 image: {{project_name}}:latest347 ports:348 - containerPort: 8080349 resources:350 limits:351 memory: "128Mi"352 cpu: "500m"353```354355### Kubernetes Service356357358```yaml359# Kubernetes service for {{project_name}}360apiVersion: v1361kind: Service362metadata:363 name: {{project_name}}364 namespace: default365spec:366 selector:367 app: {{project_name}}368 ports:369 - protocol: TCP370 port: 80371 targetPort: 8080372 type: ClusterIP373```374375---376377## When to Use378379Use this skill when:380381- **Integrating a CNCF project into Kubernetes infrastructure** — You need to configure, deploy, or troubleshoot a cloud-native tool within a cluster382- **Designing cloud-native architecture** — You are selecting and integrating CNCF tools to solve specific infrastructure challenges383- **Resolving operational issues** — A CNCF component is misbehaving, underperforming, or needs configuration changes384---385386## Core Workflow3873881. **Assess Requirements** — Understand the use case, scale, integration needs, and existing infrastructure. **Checkpoint:** Document requirements, constraints, and success criteria.3893902. **Design Architecture** — Plan component interactions, data flow, and deployment strategy using cloud-native best practices. **Checkpoint:** Verify the architecture addresses all requirements and follows CNCF conventions.3913923. **Implement & Configure** — Create manifests, configurations, and deployment scripts. Include resource limits, health checks, and observability hooks. **Checkpoint:** Validate all YAML against schema and test in a staging environment.3933944. **Deploy & Monitor** — Apply manifests to the cluster, verify component health, and confirm observability is working. **Checkpoint:** Confirm all pods/services are running, probes passing, and metrics/alerts configured.395396---397398## Constraints399400### MUST DO401- Include at least one complete working YAML manifest example402- Note when content is auto-generated vs. manually verified403- Reference relevant CNCF project documentation404405### MUST NOT DO406- Deploy manifests without testing in a staging environment first407- Use deprecated API versions (e.g., apps/v1beta1)408- Omit resource limits and requests in Kubernetes manifests