A comprehensive learning resource for Crossplane v2.1+, the cloud-native control plane framework for building platforms without writing code.
- About This Repository
- What is Crossplane
- Prerequisites
- Directory Structure
- Getting Started
- Learning Path
- Key Concepts
- Hands-On Labs
- Best Practices
- Resources
- Contributing
- License
This repository serves as a structured learning resource for mastering Crossplane, covering everything from basic concepts to advanced composition functions and production deployments. It includes practical examples, hands-on labs, and real-world patterns for building cloud-native control planes.
Current Crossplane Version Coverage: v2.1 (November 2025) Status: CNCF Graduated Project (October 28, 2025)
Crossplane is a framework for building cloud-native control planes without needing to write code. It provides:
- Universal Control Plane: Orchestrate applications and infrastructure across any cloud
- Declarative API: Define resources using familiar Kubernetes patterns
- Extensible Backend: Build control planes using providers and composition functions
- Configurable Frontend: Control the schema of your declarative API
- Platform Engineering: Enable self-service infrastructure for development teams
- Namespaced Composite Resources: XRs are now namespaced by default
- Simplified Architecture: No more need for Claims abstraction
- Enhanced Composition Functions: Advanced templating with Python, Go, KCL, and more
- Better Application Support: First-class support for managing apps alongside infrastructure
- Improved Developer Experience: Streamlined workflows and better tooling
- Basic understanding of Kubernetes concepts (Pods, Services, Deployments)
- Familiarity with YAML syntax
- Command-line interface (CLI) experience
- Basic cloud infrastructure concepts
- Kubernetes Cluster: v1.25+ (can use kind, minikube, or cloud provider)
- kubectl: v1.25+ (Installation Guide)
- Crossplane CLI: v1.17+ (Installation Guide)
- Docker: v24+ (for testing composition functions)
- Helm: v3.0+ (for Crossplane installation)
- k9s: Terminal UI for Kubernetes
- yq: YAML processor
- jq: JSON processor
- VS Code: With Kubernetes and YAML extensions
learning-crossplane/ β βββ README.md # This file βββ LICENSE # MIT License βββ .gitignore # Git ignore patterns β βββ 01-fundamentals/ # Crossplane fundamentals β βββ README.md # Fundamentals overview β βββ 01-installation/ # Installation methods β β βββ helm-install.yaml β β βββ helm-values.yaml β β βββ verify-installation.sh β βββ 02-providers/ # Provider basics β β βββ provider-aws.yaml β β βββ provider-azure.yaml β β βββ provider-gcp.yaml β β βββ provider-kubernetes.yaml β β βββ provider-config.yaml β βββ 03-managed-resources/ # Managed resources β β βββ s3-bucket.yaml β β βββ rds-instance.yaml β β βββ vpc.yaml β β βββ README.md β βββ 04-basic-concepts/ # Core concepts β βββ crds.yaml β βββ custom-resources.yaml β βββ resource-lifecycle.md β βββ 02-compositions/ # Composition fundamentals β βββ README.md # Composition overview β βββ 01-xrd-basics/ # XRD fundamentals β β βββ simple-xrd.yaml β β βββ namespaced-xrd.yaml β β βββ cluster-scoped-xrd.yaml β β βββ schema-definition.yaml β βββ 02-basic-compositions/ # Basic compositions β β βββ patch-and-transform.yaml β β βββ resource-templates.yaml β β βββ composition-metadata.yaml β βββ 03-composite-resources/ # Working with XRs β β βββ namespaced-xr.yaml β β βββ cluster-xr.yaml β β βββ xr-status.yaml β β βββ README.md β βββ 04-v2-migration/ # v1 to v2 migration β βββ legacy-composition.yaml β βββ v2-composition.yaml β βββ migration-guide.md β βββ 03-composition-functions/ # Composition functions β βββ README.md # Functions overview β βββ 01-patch-and-transform/ # P&T function β β βββ function-install.yaml β β βββ simple-transform.yaml β β βββ conditional-patching.yaml β β βββ examples/ β βββ 02-function-pipeline/ # Function pipelines β β βββ pipeline-composition.yaml β β βββ multi-function.yaml β β βββ function-chaining.yaml β βββ 03-templating-functions/ # Template-based functions β β βββ go-templating/ β β β βββ function-config.yaml β β β βββ template-examples.yaml β β βββ kcl-function/ β β β βββ function-install.yaml β β β βββ kcl-examples/ β β βββ helm-function/ β β βββ helm-composition.yaml β βββ 04-custom-functions/ # Writing custom functions β β βββ python-function/ β β β βββ function.py β β β βββ Dockerfile β β β βββ requirements.txt β β β βββ README.md β β βββ go-function/ β β β βββ main.go β β β βββ go.mod β β β βββ Dockerfile β β β βββ README.md β β βββ function-testing/ β β βββ test-inputs.yaml β β βββ render-tests.sh β βββ 05-advanced-patterns/ # Advanced function patterns β βββ conditional-logic.yaml β βββ loops-iteration.yaml β βββ external-data.yaml β βββ error-handling.yaml β βββ 04-real-world-examples/ # Production-ready examples β βββ README.md # Examples overview β βββ 01-database-platform/ # Database self-service β β βββ xrd/ β β β βββ database-xrd.yaml β β βββ compositions/ β β β βββ postgres-composition.yaml β β β βββ mysql-composition.yaml β β β βββ mongodb-composition.yaml β β βββ claims/ β β β βββ sample-database.yaml β β βββ README.md β βββ 02-application-platform/ # App deployment platform β β βββ xrd/ β β β βββ app-xrd.yaml β β βββ composition/ β β β βββ app-composition.yaml β β βββ examples/ β β β βββ frontend-app.yaml β β β βββ backend-app.yaml β β βββ README.md β βββ 03-network-platform/ # Network infrastructure β β βββ vpc-xrd.yaml β β βββ vpc-composition.yaml β β βββ subnet-composition.yaml β β βββ security-group-composition.yaml β βββ 04-observability-platform/ # Monitoring & logging β β βββ monitoring-xrd.yaml β β βββ prometheus-composition.yaml β β βββ grafana-composition.yaml β β βββ loki-composition.yaml β βββ 05-multi-cloud/ # Multi-cloud patterns β βββ provider-selection.yaml β βββ aws-composition.yaml β βββ azure-composition.yaml β βββ gcp-composition.yaml β βββ 05-security/ # Security best practices β βββ README.md # Security overview β βββ 01-rbac/ # Access control β β βββ roles.yaml β β βββ rolebindings.yaml β β βββ service-accounts.yaml β βββ 02-secrets-management/ # Secrets handling β β βββ external-secrets.yaml β β βββ sealed-secrets.yaml β β βββ vault-integration.yaml β βββ 03-policy-enforcement/ # Policy as code β β βββ opa-policies/ β β βββ kyverno-policies/ β β βββ admission-control.yaml β βββ 04-compliance/ # Compliance patterns β βββ audit-logging.yaml β βββ compliance-checks.yaml β βββ 06-operations/ # Operational excellence β βββ README.md # Operations overview β βββ 01-monitoring/ # Monitoring setup β β βββ prometheus-rules.yaml β β βββ grafana-dashboards/ β β βββ alerts.yaml β βββ 02-troubleshooting/ # Debug procedures β β βββ debug-commands.sh β β βββ common-issues.md β β βββ logs-analysis.md β βββ 03-backup-restore/ # DR procedures β β βββ backup-strategy.md β β βββ restore-procedures.md β βββ 04-upgrades/ # Upgrade strategies β β βββ upgrade-checklist.md β β βββ rollback-plan.md β β βββ version-migration.yaml β βββ 05-performance/ # Performance tuning β βββ scaling-config.yaml β βββ optimization-guide.md β βββ 07-ci-cd-integration/ # CI/CD pipelines β βββ README.md # CI/CD overview β βββ 01-gitops/ # GitOps workflows β β βββ argocd/ β β β βββ application.yaml β β β βββ app-of-apps.yaml β β βββ flux/ β β βββ kustomization.yaml β β βββ helmrelease.yaml β βββ 02-github-actions/ # GitHub workflows β β βββ validate-composition.yaml β β βββ test-functions.yaml β β βββ deploy-crossplane.yaml β βββ 03-gitlab-ci/ # GitLab pipelines β β βββ .gitlab-ci.yaml β βββ 04-testing/ # Automated testing β βββ composition-tests/ β βββ function-tests/ β βββ integration-tests/ β βββ 08-advanced-topics/ # Advanced scenarios β βββ README.md # Advanced topics overview β βββ 01-custom-providers/ # Building providers β β βββ provider-template/ β β βββ upjet-provider/ β βββ 02-function-development/ # Advanced function dev β β βββ sdk-usage/ β β βββ grpc-implementation/ β β βββ optimization-patterns/ β βββ 03-webhooks/ # Validation webhooks β β βββ admission-webhook.yaml β β βββ validation-logic.go β βββ 04-event-driven/ # Event-driven patterns β βββ triggers.yaml β βββ event-handlers/ β βββ 09-reference/ # Reference materials β βββ README.md # Reference overview β βββ 01-api-reference/ # API documentation β β βββ xrd-api.md β β βββ composition-api.md β β βββ function-api.md β βββ 02-cli-reference/ # CLI commands β β βββ crossplane-cli.md β β βββ kubectl-crossplane.md β βββ 03-glossary/ # Terms & definitions β β βββ glossary.md β βββ 04-cheat-sheets/ # Quick references β βββ commands.md β βββ patterns.md β βββ troubleshooting.md β βββ 10-labs/ # Hands-on laboratories β βββ README.md # Labs overview β βββ lab-01-installation/ # Lab 1: Setup β β βββ instructions.md β β βββ lab-files/ β β βββ solutions/ β βββ lab-02-first-composition/ # Lab 2: Basic composition β β βββ instructions.md β β βββ lab-files/ β β βββ solutions/ β βββ lab-03-functions/ # Lab 3: Functions β β βββ instructions.md β β βββ lab-files/ β β βββ solutions/ β βββ lab-04-database-platform/ # Lab 4: Database platform β β βββ instructions.md β β βββ lab-files/ β β βββ solutions/ β βββ lab-05-production/ # Lab 5: Production β βββ instructions.md β βββ lab-files/ β βββ solutions/ β βββ 11-case-studies/ # Real-world case studies β βββ README.md # Case studies overview β βββ platform-team-adoption/ # Platform engineering β βββ multi-tenant-saas/ # SaaS platforms β βββ hybrid-cloud/ # Hybrid deployments β βββ edge-computing/ # Edge scenarios β βββ scripts/ # Utility scripts β βββ install-crossplane.sh β βββ setup-providers.sh β βββ validate-compositions.sh β βββ cleanup.sh β βββ test-functions.sh β βββ docs/ # Additional documentation β βββ architecture/ # Architecture guides β β βββ control-plane-design.md β β βββ composition-patterns.md β βββ tutorials/ # Step-by-step tutorials β β βββ getting-started.md β β βββ building-platforms.md β β βββ advanced-compositions.md β βββ videos/ # Video resources β βββ video-links.md β βββ examples/ # Quick reference examples βββ simple-s3-bucket/ βββ complete-database/ βββ app-deployment/ βββ multi-resource-composition/ -
Install Crossplane:
# Create a Kubernetes cluster (if needed) kind create cluster --name crossplane-playground # Install Crossplane using Helm helm repo add crossplane-stable https://charts.crossplane.io/stable helm repo update helm install crossplane \ --namespace crossplane-system \ --create-namespace \ crossplane-stable/crossplane
-
Verify Installation:
kubectl get pods -n crossplane-system
-
Install Crossplane CLI:
curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/main/install.sh" | sh sudo mv crossplane /usr/local/bin
-
Run Your First Example:
cd 01-fundamentals/01-installation ./verify-installation.sh
See 01-fundamentals/README.md for comprehensive installation and setup instructions.
Goal: Understand Crossplane fundamentals and basic resource management
-
Fundamentals (
01-fundamentals/)- Install Crossplane
- Understand providers and managed resources
- Learn about Custom Resource Definitions (CRDs)
-
Basic Compositions (
02-compositions/01-xrd-basics/)- Create your first XRD
- Build simple compositions
- Deploy composite resources
Lab: Complete 10-labs/lab-01-installation/ and lab-02-first-composition/
Goal: Master composition functions and build reusable platform APIs
-
Composition Functions (
03-composition-functions/)- Work with Patch & Transform
- Build function pipelines
- Use templating functions (KCL, Go templates)
-
Real-World Patterns (
04-real-world-examples/)- Database self-service platform
- Application deployment automation
- Network infrastructure management
Lab: Complete 10-labs/lab-03-functions/ and lab-04-database-platform/
Goal: Implement production-ready control planes with security and operations
-
Security & Compliance (
05-security/)- RBAC and access control
- Secrets management
- Policy enforcement
-
Operations (
06-operations/)- Monitoring and observability
- Troubleshooting patterns
- Backup and disaster recovery
-
CI/CD Integration (
07-ci-cd-integration/)- GitOps workflows
- Automated testing
- Deployment pipelines
Lab: Complete 10-labs/lab-05-production/
Goal: Extend Crossplane and contribute to the ecosystem
-
Advanced Topics (
08-advanced-topics/)- Build custom providers
- Develop custom functions
- Implement webhooks
-
Community Contribution
- Contribute to open-source functions
- Share composition patterns
- Write blog posts and tutorials
Defines the schema for your custom API:
apiVersion: apiextensions.crossplane.io/v2 kind: CompositeResourceDefinition metadata: name: databases.example.io spec: scope: Namespaced # New in v2: Namespaced by default group: example.io names: kind: Database plural: databases versions: - name: v1 served: true referenceable: true schema: openAPIV3Schema: type: object properties: spec: type: object properties: size: type: string enum: [small, medium, large] engine: type: string enum: [postgres, mysql]Templates that define what resources to create:
apiVersion: apiextensions.crossplane.io/v1 kind: Composition metadata: name: database-aws spec: compositeTypeRef: apiVersion: example.io/v1 kind: Database mode: Pipeline # Use function pipeline pipeline: - step: patch-and-transform functionRef: name: crossplane-contrib-function-patch-and-transform input: apiVersion: pt.fn.crossplane.io/v1beta1 kind: Resources resources: - name: rds-instance base: apiVersion: rds.aws.crossplane.io/v1alpha1 kind: Instance spec: forProvider: engine: postgresExtend composition with custom logic:
apiVersion: pkg.crossplane.io/v1 kind: Function metadata: name: function-patch-and-transform spec: package: xpkg.crossplane.io/crossplane-contrib/function-patch-and-transform:v0.8.2Popular functions:
- function-patch-and-transform: Traditional P&T compositions
- function-go-templating: Go template-based composition
- function-kcl: KCL language for composition
- function-auto-ready: Automatic readiness detection
- Custom functions: Written in Go or Python
- Namespaced XRs: Composite resources are namespaced by default
- No More Claims: Simplified architecture removes the claim abstraction
- Better App Support: First-class support for managing applications
- Backward Compatible: v1 compositions continue to work
Each lab includes:
- Detailed step-by-step instructions
- Starter files and templates
- Complete solutions
- Validation tests
- Lab 1: Installation & Setup (30 min)
- Lab 2: First Composition (45 min)
- Lab 3: Composition Functions (60 min)
- Lab 4: Database Platform (90 min)
- Lab 5: Production Deployment (120 min)
See 10-labs/README.md for detailed lab instructions.
β DO:
- Use meaningful, descriptive names for XRDs and compositions
- Version your XRDs appropriately
- Leverage function pipelines for complex logic
- Document composition behavior in annotations
- Use namespaced XRs unless you need cluster scope
β DON'T:
- Embed sensitive data directly in compositions
- Create overly complex single compositions
- Skip validation schemas in XRDs
- Mix v1 and v2 patterns in the same platform
- Use RBAC to restrict access to compositions
- Leverage external secrets management
- Implement policy enforcement with OPA or Kyverno
- Enable audit logging
- Regularly scan provider images
- Monitor composition reconciliation metrics
- Set up alerting for composition failures
- Implement backup strategies for XR state
- Test compositions with
crossplane render - Use GitOps for composition lifecycle
- Write comprehensive tests for custom functions
- Use the official SDKs (Go, Python)
- Document function inputs clearly
- Handle errors gracefully
- Consider performance implications
- Function Registry
- function-patch-and-transform
- function-go-templating
- function-kcl
- function-auto-ready
Contributions are welcome! This is a learning resource for the community.
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-example) - Add your example or improvement
- Ensure documentation is updated
- Submit a pull request
- Follow existing directory structure
- Include comprehensive README files
- Add comments to complex YAML
- Provide working examples
- Test all configurations before submitting
- Follow Crossplane best practices
- New composition examples
- Custom function implementations
- Real-world case studies
- Improved documentation
- Bug fixes and clarifications
- Additional labs and tutorials
- Advanced multi-cloud patterns
- Service mesh integration examples
- Cost optimization strategies
- Disaster recovery blueprints
- Edge computing scenarios
- Machine learning platform examples
Watch this repository for updates as Crossplane evolves. Major updates planned for:
- Crossplane v2.2 (February 2026)
- Crossplane v2.3 (May 2026)
This repository is licensed under the MIT License. See LICENSE for details.
- Crossplane maintainers and community
- CNCF for hosting the project
- All contributors to this learning resource
- The platform engineering community
Willem van Heemstra
- Security Domain Expert & Cloud Engineer
- Focus: DevSecOps, Cloud Security, Platform Engineering
- Location: Eersel, Netherlands
β If you find this resource helpful, please star the repository!
π€ Contributions and feedback are always welcome!
π§ Questions? Open an issue or join the Crossplane Slack
Last Updated: December 24, 2025 Crossplane Version: v2.1 (November 2025) CNCF Status: Graduated Project (October 2025)
