Longhorn in Cloud-Native Engineering
Category: storage
Status: Graduated
Stars: 4,800
Last Updated: 2026-04-22
Primary Language: Go
Documentation: https://longhorn.io/
Purpose and Use Cases
What Problem Does It Solve?
Longhorn addresses the critical gap in Kubernetes-native storage by providing a distributed block storage system that integrates seamlessly with Kubernetes. Traditional storage solutions were either cloud-specific, complex to deploy, or lacked Kubernetes-native features like automated failover, backups, and snapshots.
When to Use This Project
Use Longhorn when you need:
- Kubernetes-native block storage with PVC support
- Automatic data replication across nodes
- Built-in backup and disaster recovery
- Storage class integration with dynamic provisioning
- High availability for stateful workloads
- Easy management through Kubernetes APIs
Key Use Cases
- Database Storage: Run PostgreSQL, MySQL, MongoDB with persistent, replicated storage
- Stateful Applications: Deploy Redis, Elasticsearch, Kafka with reliable storage
- CI/CD Pipelines: Store build artifacts and caches with redundancy
- AI/ML Workloads: Provide high-throughput storage for training data
- Backup and DR: Automated snapshots and off-cluster backups
- Multi-Cluster Storage: Sync data across multiple Kubernetes clusters
Architecture Design Patterns
Core Components
- Engine: Handles block device operations and data replication
- Replica: Individual copy of volume data on a node
- Controller: Manages the engine and coordinates replication
- Instance Manager: Manages engine and replica processes
- Driver: Kubernetes CSI driver for volume provisioning
- Scheduler: Schedules volumes to nodes with available resources
- Reconciler: Ensures desired state matches actual state
- Backup Controller: Manages backup creation and restoration
Component Interactions
- User → Kubernetes API: Create PVC requesting Longhorn storage
- Provisioner → Controller: Volume provisioning request
- Controller → Engine: Engine management for block device
- Engine → Replicas: Data write operations to all replicas
- Replica → Instance Manager: Process lifecycle management
- Instance Manager → Node: Schedule processes on appropriate nodes
- Reconciler → All Components: Continuously sync desired state
- Backup Controller → Object Store: Off-cluster backup storage
Data Flow Patterns
- Volume Creation: PVC request → Provisioner → Controller → Engine → Replicas → Storage
- Write Operation: Application → Block device → Engine → Replicas (parallel writes)
- Read Operation: Application → Block device → Engine → Replica (quorum read)
- Rebuild Process: Failed replica detected → New replica created → Data synced from healthy replicas
- Backup Process: Trigger backup → Create snapshot → Send to object store → Update backup metadata
- Restore Process: Restore backup → Download from object store → Create replica → Sync to engine
Design Principles
- Kubernetes-Native: Full CSI driver integration
- Self-Healing: Automatic recovery from node and disk failures
- Data Redundancy: Configurable replica count with automatic rebuild
- Decoupled Architecture: Engine and replica separation for flexibility
- Conflict Detection: Detect and prevent split-brain scenarios
- Backup Integration: Native integration with S3-compatible storage
Integration Approaches
Integration with Other CNCF Projects
- Kubernetes: Full CSI integration for PVC management
- Prometheus: Expose metrics for monitoring and alerting
- Grafana: Pre-built dashboards for storage metrics
- Tekton: Storage provisioned for CI/CD pipeline workloads
- Helm: Deploy Longhorn using Helm chart
- Rancher: Manage Longhorn through Rancher UI
- Velero: Backup and restore Longhorn volumes
API Patterns
- CSI RPCs: CreateVolume, DeleteVolume, ControllerPublish/Unpublish, NodeStage/Unstage
- Kubernetes API: PVC, PV, StorageClass, Snapshot, RestoreCRD
- Longhorn API: Direct API for volume management and operations
- Webhook: Admission controller for validation and mutation
Configuration Patterns
- StorageClass: Define Longhorn storage classes with parameters
- Volume Settings: Replica count, data locality, snapshot count
- Backup Configuration: S3 bucket, credential, and policy settings
- Node Tags: Assign nodes to specific storage pools
- Disk Configuration: Allocate disk space on nodes
Extension Mechanisms
- Custom Storage Classes: Create storage classes for specific needs
- Backup Policies: Define custom backup schedules and retention
- Volume Hooks: Execute hooks before/after operations
- Monitoring Integration: Extend metrics with custom queries
Common Pitfalls and How to Avoid Them
Configuration Issues
- Insufficient Disk Space: Monitor free space and configure cleanup policies
- Replica Scheduling: Ensure enough nodes have available disk space
- Network Partition: Configure proper network and firewall rules between nodes
- Backup Configuration: Verify S3 credentials and bucket accessibility
- Resource Limits: Set appropriate resource requests for engines and replicas
Performance Issues
- Slow I/O: Check disk utilization and network connectivity between nodes
- Rebuild Delays: Monitor rebuild progress and adjust priority
- Snapshot Overhead: Limit snapshot count and frequency
- Engine Contention: Avoid overprovisioning engines on single node
- Network Bottleneck: Use dedicated network for replica communication
Operational Challenges
- Node Failure: Implement automated recovery and monitoring
- Disk Failure: Replace failed disks and trigger rebuilds
- Data Corruption: Use checksums and detect silent corruption
- Backup Failures: Monitor backup status and retry mechanisms
- Upgrade Complexity: Plan upgrades carefully with rollback strategies
Security Pitfalls
- Access Control: Restrict access to Longhorn API and backend storage
- Secret Management: Use Kubernetes secrets for credentials
- Encryption: Enable encryption at rest for sensitive data
- Network Security: Isolate storage network from public access
- Audit Logging: Enable audit logs for compliance
Coding Practices
Idiomatic Configuration
- StorageClass Parameters: Use specific Longhorn parameters for fine-grained control
- Volume Settings: Configure settings at volume level for specific workloads
- Node Management: Tag nodes for storage pool organization
- Backup Policies: Define backup schedules and retention policies
API Usage Patterns
- PVC Creation: Standard Kubernetes PVC with Longhorn StorageClass
- Snapshot Management: Create and manage snapshots through Kubernetes API
- Backup Operations: Trigger backups via Longhorn API or Kubernetes Snapshot
- Restore Operations: Restore from backup through Longhorn API
- Volume Expansion: Expand PVC and trigger volume expansion
Observability Best Practices
- Metrics Collection: Prometheus scrape Longhorn metrics endpoint
- Alerting: Set up alerts for disk space, replica status, and rebuild status
- Dashboard: Use pre-built Grafana dashboards for storage monitoring
- Log Analysis: Monitor Longhorn component logs for issues
- Health Checks: Implement automated health checks for storage availability
Development Workflow
- Local Development: Use Longhorn for local Kubernetes storage needs
- Testing: Test storage operations in staging environment
- CI/CD Integration: Provision storage for CI/CD workloads
- Disaster Recovery: Test backup and restore procedures regularly
Fundamentals
Essential Concepts
- Volume: Block device exposed to Kubernetes as PVC
- Replica: Individual copy of volume data on a node
- Engine: Process managing volume I/O and replica coordination
- Snapshot: Point-in-time copy of volume data
- Backup: Snapshot copied to external object storage
- Data Locality: Preference for replicas on same node as pod
- Automated Failover: Automatic volume failover on node failure
- Rebuild: Process of creating new replica after failure
Terminology Glossary
- Volume: Kubernetes PVC backed by Longhorn block storage
- Replica: Individual copy of volume data stored on a node
- Engine: Manages volume I/O and replica coordination
- Controller: Kubernetes CSI controller for Longhorn volumes
- Replica Manager: Manages replica processes on a node
- Snapshot: Point-in-time copy of volume data
- Backup: Snapshot copied to external object storage
- Data Locality: Scheduling preference for pods and replicas
- Auto-Disaster Recovery: Automatic failover for volumes
Data Models and Types
- Volume: Configuration, status, and metadata for block device
- Replica: Disk path, node, status, and sync status
- Snapshot: Creation time, size, children, and backup status
- Backup: Volume name, snapshot name, and S3 metadata
- Node: Disk configuration, tags, and scheduling status
- Setting: Global configuration for Longhorn behavior
Lifecycle Management
- Volume Lifecycle: Create → Attach → Mount → Use → Unmount → Detach → Delete
- Replica Lifecycle: Create → Sync → Healthy → Failed → Rebuild
- Snapshot Lifecycle: Create → Use → Expire → Delete
- Backup Lifecycle: Trigger → Snapshot → Upload → Update → Cleanup
State Management
- Volume State: Creating, attached, detaching, detached, faulted
- Replica State: Running, stopped, error, unknown
- Engine State: Running, stopped, error, unknown
- Backup State: Created, creating, error, completed
Scaling and Deployment Patterns
Horizontal Scaling
- Storage Capacity: Add nodes with dedicated disks for Longhorn
- Replica Distribution: Distribute replicas across failure domains
- Volume Distribution: Spread volumes across multiple nodes
- Network Scaling: Use dedicated network for replica communication
High Availability
- Multi-Node Deployment: Deploy across multiple availability zones
- Automatic Failover: Fail volumes to replicas on other nodes
- Disk Failure Recovery: Automatic rebuild on disk replacement
- Node Failure Recovery: Automatic failover and rebuild
Production Deployments
- Production Cluster: Deploy Longhorn with 3+ nodes for redundancy
- Storage Class: Define storage classes for different performance needs
- Backup Destination: Configure off-cluster backup to S3-compatible storage
- Monitoring: Set up Prometheus and Grafana for monitoring
Upgrade Strategies
- Minor Version: In-place upgrade with zero-downtime
- Major Version: Follow upgrade guide with backup and testing
- Rollback Plan: Keep previous version images for rollback
- Pre-Upgrade Check: Run health checks before upgrade
Resource Management
- Disk Space: Monitor and alert on free disk space
- Memory: Configure resource requests for engine and replica processes
- CPU: Balance CPU usage across nodes
- Network: Monitor network utilization between nodes
Additional Resources
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: longhorn3description: "Longhorn in Cloud Native Storage - cloud native architecture, patterns" pitfalls, and best practices4license: MIT5---678910# Longhorn in Cloud-Native Engineering1112**Category:** storage 13**Status:** Graduated 14**Stars:** 4,800 15**Last Updated:** 2026-04-22 16**Primary Language:** Go 17**Documentation:** [https://longhorn.io/](https://longhorn.io/) 1819---2021## Purpose and Use Cases2223### What Problem Does It Solve?2425Longhorn addresses the critical gap in Kubernetes-native storage by providing a distributed block storage system that integrates seamlessly with Kubernetes. Traditional storage solutions were either cloud-specific, complex to deploy, or lacked Kubernetes-native features like automated failover, backups, and snapshots.2627### When to Use This Project2829Use Longhorn when you need:30- Kubernetes-native block storage with PVC support31- Automatic data replication across nodes32- Built-in backup and disaster recovery33- Storage class integration with dynamic provisioning34- High availability for stateful workloads35- Easy management through Kubernetes APIs3637### Key Use Cases3839- **Database Storage**: Run PostgreSQL, MySQL, MongoDB with persistent, replicated storage40- **Stateful Applications**: Deploy Redis, Elasticsearch, Kafka with reliable storage41- **CI/CD Pipelines**: Store build artifacts and caches with redundancy42- **AI/ML Workloads**: Provide high-throughput storage for training data43- **Backup and DR**: Automated snapshots and off-cluster backups44- **Multi-Cluster Storage**: Sync data across multiple Kubernetes clusters4546---4748## Architecture Design Patterns4950### Core Components5152- **Engine**: Handles block device operations and data replication53- **Replica**: Individual copy of volume data on a node54- **Controller**: Manages the engine and coordinates replication55- **Instance Manager**: Manages engine and replica processes56- **Driver**: Kubernetes CSI driver for volume provisioning57- **Scheduler**: Schedules volumes to nodes with available resources58- **Reconciler**: Ensures desired state matches actual state59- **Backup Controller**: Manages backup creation and restoration6061### Component Interactions62631. **User → Kubernetes API**: Create PVC requesting Longhorn storage642. **Provisioner → Controller**: Volume provisioning request653. **Controller → Engine**: Engine management for block device664. **Engine → Replicas**: Data write operations to all replicas675. **Replica → Instance Manager**: Process lifecycle management686. **Instance Manager → Node**: Schedule processes on appropriate nodes697. **Reconciler → All Components**: Continuously sync desired state708. **Backup Controller → Object Store**: Off-cluster backup storage7172### Data Flow Patterns73741. **Volume Creation**: PVC request → Provisioner → Controller → Engine → Replicas → Storage752. **Write Operation**: Application → Block device → Engine → Replicas (parallel writes)763. **Read Operation**: Application → Block device → Engine → Replica (quorum read)774. **Rebuild Process**: Failed replica detected → New replica created → Data synced from healthy replicas785. **Backup Process**: Trigger backup → Create snapshot → Send to object store → Update backup metadata796. **Restore Process**: Restore backup → Download from object store → Create replica → Sync to engine8081### Design Principles8283- **Kubernetes-Native**: Full CSI driver integration84- **Self-Healing**: Automatic recovery from node and disk failures85- **Data Redundancy**: Configurable replica count with automatic rebuild86- **Decoupled Architecture**: Engine and replica separation for flexibility87- **Conflict Detection**: Detect and prevent split-brain scenarios88- **Backup Integration**: Native integration with S3-compatible storage8990---9192## Integration Approaches9394### Integration with Other CNCF Projects9596- **Kubernetes**: Full CSI integration for PVC management97- **Prometheus**: Expose metrics for monitoring and alerting98- **Grafana**: Pre-built dashboards for storage metrics99- **Tekton**: Storage provisioned for CI/CD pipeline workloads100- **Helm**: Deploy Longhorn using Helm chart101- **Rancher**: Manage Longhorn through Rancher UI102- **Velero**: Backup and restore Longhorn volumes103104### API Patterns105106- **CSI RPCs**: CreateVolume, DeleteVolume, ControllerPublish/Unpublish, NodeStage/Unstage107- **Kubernetes API**: PVC, PV, StorageClass, Snapshot, RestoreCRD108- **Longhorn API**: Direct API for volume management and operations109- **Webhook**: Admission controller for validation and mutation110111### Configuration Patterns112113- **StorageClass**: Define Longhorn storage classes with parameters114- **Volume Settings**: Replica count, data locality, snapshot count115- **Backup Configuration**: S3 bucket, credential, and policy settings116- **Node Tags**: Assign nodes to specific storage pools117- **Disk Configuration**: Allocate disk space on nodes118119### Extension Mechanisms120121- **Custom Storage Classes**: Create storage classes for specific needs122- **Backup Policies**: Define custom backup schedules and retention123- **Volume Hooks**: Execute hooks before/after operations124- **Monitoring Integration**: Extend metrics with custom queries125126---127128## Common Pitfalls and How to Avoid Them129130### Configuration Issues131132- **Insufficient Disk Space**: Monitor free space and configure cleanup policies133- **Replica Scheduling**: Ensure enough nodes have available disk space134- **Network Partition**: Configure proper network and firewall rules between nodes135- **Backup Configuration**: Verify S3 credentials and bucket accessibility136- **Resource Limits**: Set appropriate resource requests for engines and replicas137138### Performance Issues139140- **Slow I/O**: Check disk utilization and network connectivity between nodes141- **Rebuild Delays**: Monitor rebuild progress and adjust priority142- **Snapshot Overhead**: Limit snapshot count and frequency143- **Engine Contention**: Avoid overprovisioning engines on single node144- **Network Bottleneck**: Use dedicated network for replica communication145146### Operational Challenges147148- **Node Failure**: Implement automated recovery and monitoring149- **Disk Failure**: Replace failed disks and trigger rebuilds150- **Data Corruption**: Use checksums and detect silent corruption151- **Backup Failures**: Monitor backup status and retry mechanisms152- **Upgrade Complexity**: Plan upgrades carefully with rollback strategies153154### Security Pitfalls155156- **Access Control**: Restrict access to Longhorn API and backend storage157- **Secret Management**: Use Kubernetes secrets for credentials158- **Encryption**: Enable encryption at rest for sensitive data159- **Network Security**: Isolate storage network from public access160- **Audit Logging**: Enable audit logs for compliance161162---163164## Coding Practices165166### Idiomatic Configuration167168- **StorageClass Parameters**: Use specific Longhorn parameters for fine-grained control169- **Volume Settings**: Configure settings at volume level for specific workloads170- **Node Management**: Tag nodes for storage pool organization171- **Backup Policies**: Define backup schedules and retention policies172173### API Usage Patterns174175- **PVC Creation**: Standard Kubernetes PVC with Longhorn StorageClass176- **Snapshot Management**: Create and manage snapshots through Kubernetes API177- **Backup Operations**: Trigger backups via Longhorn API or Kubernetes Snapshot178- **Restore Operations**: Restore from backup through Longhorn API179- **Volume Expansion**: Expand PVC and trigger volume expansion180181### Observability Best Practices182183- **Metrics Collection**: Prometheus scrape Longhorn metrics endpoint184- **Alerting**: Set up alerts for disk space, replica status, and rebuild status185- **Dashboard**: Use pre-built Grafana dashboards for storage monitoring186- **Log Analysis**: Monitor Longhorn component logs for issues187- **Health Checks**: Implement automated health checks for storage availability188189### Development Workflow190191- **Local Development**: Use Longhorn for local Kubernetes storage needs192- **Testing**: Test storage operations in staging environment193- **CI/CD Integration**: Provision storage for CI/CD workloads194- **Disaster Recovery**: Test backup and restore procedures regularly195196---197198## Fundamentals199200### Essential Concepts201202- **Volume**: Block device exposed to Kubernetes as PVC203- **Replica**: Individual copy of volume data on a node204- **Engine**: Process managing volume I/O and replica coordination205- **Snapshot**: Point-in-time copy of volume data206- **Backup**: Snapshot copied to external object storage207- **Data Locality**: Preference for replicas on same node as pod208- **Automated Failover**: Automatic volume failover on node failure209- **Rebuild**: Process of creating new replica after failure210211### Terminology Glossary212213- **Volume**: Kubernetes PVC backed by Longhorn block storage214- **Replica**: Individual copy of volume data stored on a node215- **Engine**: Manages volume I/O and replica coordination216- **Controller**: Kubernetes CSI controller for Longhorn volumes217- **Replica Manager**: Manages replica processes on a node218- **Snapshot**: Point-in-time copy of volume data219- **Backup**: Snapshot copied to external object storage220- **Data Locality**: Scheduling preference for pods and replicas221- **Auto-Disaster Recovery**: Automatic failover for volumes222223### Data Models and Types224225- **Volume**: Configuration, status, and metadata for block device226- **Replica**: Disk path, node, status, and sync status227- **Snapshot**: Creation time, size, children, and backup status228- **Backup**: Volume name, snapshot name, and S3 metadata229- **Node**: Disk configuration, tags, and scheduling status230- **Setting**: Global configuration for Longhorn behavior231232### Lifecycle Management233234- **Volume Lifecycle**: Create → Attach → Mount → Use → Unmount → Detach → Delete235- **Replica Lifecycle**: Create → Sync → Healthy → Failed → Rebuild236- **Snapshot Lifecycle**: Create → Use → Expire → Delete237- **Backup Lifecycle**: Trigger → Snapshot → Upload → Update → Cleanup238239### State Management240241- **Volume State**: Creating, attached, detaching, detached, faulted242- **Replica State**: Running, stopped, error, unknown243- **Engine State**: Running, stopped, error, unknown244- **Backup State**: Created, creating, error, completed245246---247248## Scaling and Deployment Patterns249250### Horizontal Scaling251252- **Storage Capacity**: Add nodes with dedicated disks for Longhorn253- **Replica Distribution**: Distribute replicas across failure domains254- **Volume Distribution**: Spread volumes across multiple nodes255- **Network Scaling**: Use dedicated network for replica communication256257### High Availability258259- **Multi-Node Deployment**: Deploy across multiple availability zones260- **Automatic Failover**: Fail volumes to replicas on other nodes261- **Disk Failure Recovery**: Automatic rebuild on disk replacement262- **Node Failure Recovery**: Automatic failover and rebuild263264### Production Deployments265266- **Production Cluster**: Deploy Longhorn with 3+ nodes for redundancy267- **Storage Class**: Define storage classes for different performance needs268- **Backup Destination**: Configure off-cluster backup to S3-compatible storage269- **Monitoring**: Set up Prometheus and Grafana for monitoring270271### Upgrade Strategies272273- **Minor Version**: In-place upgrade with zero-downtime274- **Major Version**: Follow upgrade guide with backup and testing275- **Rollback Plan**: Keep previous version images for rollback276- **Pre-Upgrade Check**: Run health checks before upgrade277278### Resource Management279280- **Disk Space**: Monitor and alert on free disk space281- **Memory**: Configure resource requests for engine and replica processes282- **CPU**: Balance CPU usage across nodes283- **Network**: Monitor network utilization between nodes284285---286287## Additional Resources288289- **Official Documentation:** [https://longhorn.io/docs/](https://longhorn.io/docs/)290- **GitHub Repository:** [github.com/longhorn/longhorn](https://github.com/longhorn/longhorn)291- **CNCF Project Page:** [cncf.io/projects/longhorn/](https://www.cncf.io/projects/longhorn/)292- **Community:** Check the GitHub repository for community channels293- **Versioning:** Refer to project's release notes for version-specific features294295---296297## Troubleshooting298299### Common Issues3003011. **Deployment Failures**302 - Check pod logs for errors303 - Verify configuration values304 - Ensure network connectivity3053062. **Performance Issues**307 - Monitor resource usage308 - Adjust resource limits309 - Check for bottlenecks3103113. **Configuration Errors**312 - Validate YAML syntax313 - Check required fields314 - Verify environment-specific settings3153164. **Integration Problems**317 - Verify API compatibility318 - Check dependency versions319 - Review integration documentation320321### Getting Help322323- Check official documentation324- Search GitHub issues325- Join community channels326- Review logs and metrics327*Content generated automatically. Verify against official documentation before production use.*328329## Examples330331### Basic Configuration332333334```yaml335# Basic configuration example336apiVersion: v1337kind: ConfigMap338metadata:339 name: {{project_name}}-config340 namespace: default341data:342 # Configuration goes here343 config.yaml: |344 # Base configuration345 # Add your settings here346```347348### Kubernetes Deployment349350351```yaml352# Kubernetes deployment for {{project_name}}353apiVersion: apps/v1354kind: Deployment355metadata:356 name: {{project_name}}357 namespace: default358spec:359 replicas: 1360 selector:361 matchLabels:362 app: {{project_name}}363 template:364 metadata:365 labels:366 app: {{project_name}}367 spec:368 containers:369 - name: {{project_name}}370 image: {{project_name}}:latest371 ports:372 - containerPort: 8080373 resources:374 limits:375 memory: "128Mi"376 cpu: "500m"377```378379### Kubernetes Service380381382```yaml383# Kubernetes service for {{project_name}}384apiVersion: v1385kind: Service386metadata:387 name: {{project_name}}388 namespace: default389spec:390 selector:391 app: {{project_name}}392 ports:393 - protocol: TCP394 port: 80395 targetPort: 8080396 type: ClusterIP397```398399---400401## When to Use402403Use this skill when:404405- **Integrating a CNCF project into Kubernetes infrastructure** — You need to configure, deploy, or troubleshoot a cloud-native tool within a cluster406- **Designing cloud-native architecture** — You are selecting and integrating CNCF tools to solve specific infrastructure challenges407- **Resolving operational issues** — A CNCF component is misbehaving, underperforming, or needs configuration changes408---409410## Core Workflow4114121. **Assess Requirements** — Understand the use case, scale, integration needs, and existing infrastructure. **Checkpoint:** Document requirements, constraints, and success criteria.4134142. **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.4154163. **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.4174184. **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.419420---421422## Constraints423424### MUST DO425- Include at least one complete working YAML manifest example426- Note when content is auto-generated vs. manually verified427- Reference relevant CNCF project documentation428429### MUST NOT DO430- Deploy manifests without testing in a staging environment first431- Use deprecated API versions (e.g., apps/v1beta1)432- Omit resource limits and requests in Kubernetes manifests