Last Updated: January 4th, 2026
KrossKube is a Model-Driven Engineering (MDE) solution designed to address the complexities of managing native Kubernetes resources across multiple clusters.
Note
KrossKube is a project supervised by Pr. Mahmoud El Hamlaoui, proposed and maintained under the @m-elhamlaoui organization.
BIDIOUANE Haitam @sch0penheimer
|
ELMOUDNI Yassine @Mdn753
|
GHOUZALI Ayoub @AyoubGhouzali
|
Managing Kubernetes resources across multiple clusters presents significant operational challenges. Organizations typically face fragmented deployment patterns, inconsistent resource definitions, and complex orchestration workflows when operating distributed Kubernetes environments. Traditional multi-cluster management approaches rely on manual synchronization of YAML manifests and custom scripts.
KrossKube transforms this paradigm by introducing high-level abstractions that capture the essential characteristics of multi-cluster resource management while automatically generating the necessary Kubernetes Custom Resource Definitions (CRDs).
KrossKube addresses this paradigm through a Model-Driven Engineering approach that establishes formal & normalized high-level abstractions for multi-cluster Kubernetes resource management. The solution introduces a metamodel-based framework for defining MultiCluster resources that encapsulate deployment policies, cluster targeting strategies, and resource specifications within unified abstractions.
The core innovation lies in transforming high-level MultiCluster resource models into standard Kubernetes Custom Resource Definitions through automated Model-to-Text YAML code generation. This approach enables declarative specification of multi-cluster deployment intent while maintaining compatibility with existing Kubernetes tooling and workflows.
KrossKube's Model-Driven Engineering foundation establishes the theoretical and practical framework for systematic transformation of abstract resource models into concrete Kubernetes manifests.
The metamodel layer defines the abstract syntax and semantic rules for MultiCluster resource specifications. At its core, the MultiClusterResource abstract class establishes the foundational interface for all multi-cluster abstractions, providing common attributes for cluster selection and placement policy definition.
Specialized abstract classes extend this foundation to address specific resource categories, and concrete MultiCluster classes inherit from their respective abstract parents, establishing one-to-one mappings with underlying Kubernetes resource types.
The KrossKube metamodel architecture is organized into distinct sub-packages that provide modular separation between native Kubernetes resource definitions and multi-cluster abstractions.
The native Kubernetes packages provide comprehensive modeling support for standard Kubernetes resources, organized by functional domain. These packages establish the foundational abstractions that multi-cluster resources extend and compose.
Figure: KrossKube's Kubernetes Native Resources Metamodel Package
(Click on the figure for a full-screen view)
The kubernetes.runtime package defines core workload and execution abstractions including Pod, Deployment, StatefulSet, DaemonSet, and CronJob. These classes capture essential runtime characteristics: container specifications, resource requirements, scheduling constraints, and lifecycle management policies.
The kubernetes.config package encompasses network-oriented resources including Service and Ingress abstractions. Service definitions specify load balancing policies, endpoint selection criteria, and traffic routing configurations.
The kubernetes.storage package provides persistent storage abstractions through PersistentVolume and PersistentVolumeClaim definitions. These classes model storage allocation policies, access modes, capacity specifications, and binding relationships.
The kubernetes.security package defines authentication and authorization abstractions including Role, RoleBinding, ServiceAccount, and Secret management - implementing basically classic K8s RBAC (Role-Based Access Control) and credential management.
Figure: KrossKube MultiCluster Abstractions Metamodel Package
(Click on the figure for a full-screen view)
The krosskube.multicluster package introduces the high-level abstractions that extend native Kubernetes resources with multi-cluster management capabilities.
The package architecture establishes inheritance hierarchies where concrete MultiCluster classes (MultiClusterDeployment, MultiClusterService, etc.) inherit from categorical abstract classes (MultiClusterWorkload, MultiClusterNetwork, etc.). This design ensures consistent interface patterns while enabling specialized behavior for different resource types.
The ClusterSelector and PlacementPolicy components provide reusable cluster targeting and distribution strategies across all MultiCluster resource types.
KrossKube leverages the Eclipse Modeling ecosystem. The technology stack integrates multiple Eclipse technologies as plugins to deliver metamodel-based abstractions, domain-specific language capabilities, advanced model transformations, and automated code generation.
The Eclipse Modeling Framework (EMF) serves as KrossKube's fundamental base layer, providing the essential infrastructure that underpins the entire model-driven architecture. As the cornerstone technology, EMF establishes the structural foundation for defining, managing, and transforming KrossKube's metamodel ecosystem.
Role as Base Layer: EMF functions as the architectural bedrock that enables KrossKube's sophisticated metamodeling capabilities:
-
Metamodel Foundation: EMF provides the core Ecore meta-metamodel that serves as the formal specification language for defining KrossKube's domain concepts, including MultiCluster resources, Kubernetes native abstractions, and their complex interrelationships.
-
Model Instance Infrastructure: The framework establishes the runtime architecture for creating, manipulating, and persisting model instances, ensuring type safety and semantic consistency across all KrossKube model operations.
Use Case: KrossKube leverages Obeo Designer Community instead of a native Eclipse distribution because it provides a ready-to-use integration of the main Eclipse Modeling Project's components as a unified set of modeling frameworks, tooling, and standard implementations. This eliminates the complexity of manually configuring and integrating multiple Eclipse modeling plugins.
Why Obeo Designer Over Native Eclipse?:
Obeo Designer Community delivers a comprehensive, pre-configured modeling environment that includes:
- EMF (Eclipse Modeling Framework): For building tools based on structured data models
- Sirius (Graphical Modeling Framework): For creating sophisticated graphical editors
- Ecore Tools: For defining Domain-Specific Languages (DSLs)
- EMF Compare: For comparing and merging EMF models during collaborative development
- Acceleo: A template-based code generation language and toolkit
- Integrated Validation Framework: Real-time constraint checking and error reporting
- Model Repository Management: Version control and team collaboration features
This pre-integrated approach significantly reduces setup complexity and provides enterprise-grade modeling capabilities out-of-the-box, enabling domain experts to focus on KrossKube's architectural evolution rather than toolchain configuration.
Use Case: Ecore serves as KrossKube's meta-metamodel, providing the foundational language for defining the abstract syntax and semantic structure of KrossKube's domain concepts. It establishes the formal specification framework that enables precise definition of MultiCluster resources and their relationships with native Kubernetes components.
Package-Oriented Architecture: The KrossKube Ecore metamodel is implemented using a modular package-oriented approach, where each functional domain corresponds to a dedicated .ecore file. This architectural decision provides clear separation of concerns, enhanced maintainability, and modular evolution capabilities.
Metamodel Package Structure:
- kubernetes.config.ecore: Configuration management abstractions (ConfigMap, Secret)
- kubernetes.runtime.ecore: Workload and execution abstractions (Pod, Deployment, Service, etc.)
- kubernetes.storage.ecore: Persistent storage abstractions (PersistentVolume, PersistentVolumeClaim)
- kubernetes.security.ecore: RBAC and security abstractions (Role, RoleBinding, ServiceAccount)
- krosskube.multicluster.ecore: Multi-cluster management abstractions and placement policies
This package-oriented approach enables KrossKube to maintain a comprehensive yet manageable metamodel that scales with evolving Kubernetes specifications while preserving architectural integrity.
Check Metamodel Ecore Files
Use Case: EMF's code generation capabilities automatically produce comprehensive Java implementation classes from the Ecore metamodel definition. This eliminates manual coding of model management infrastructure and ensures consistency between metamodel specification and runtime implementation.
Generation Configuration: The code generation process is orchestrated through the krosskube.genmodel file, which serves as the central configuration for EMF's generator framework. This GenModel file defines:
Generated Java API Architecture:
- Model Classes: Type-safe Java classes for all metamodel concepts with getter/setter accessors
- Factory Classes: Centralized creation patterns for model instance instantiation and management
- Package Classes: Registry and metadata management for each Ecore package
- Serialization Framework: XMI and XML serialization/deserialization support for model persistence
- Notification System: Observer pattern implementation for tracking model changes and evolution
- Reflection API: Runtime introspection capabilities for dynamic model manipulation
- Validation Framework: Integration hooks for OCL constraint evaluation and error reporting
This automated generation approach reduces development effort by over ~80% while maintaining perfect synchronization between metamodel specifications and runtime implementation, ensuring that KrossKube's model management infrastructure evolves consistently with its architectural design.
Check Genmodel File
The KrossKube metamodel implements comprehensive OCL constraints enforcing semantic correctness and Kubernetes specification compliance across all model instances:
DNS Compliance: All resources enforce Kubernetes naming rules:
nameValidFormat: name.matches('[a-z0-9]([-a-z0-9]*[a-z0-9])?')
nameMaxLength: name.size() <= 253
nameRequired: not name.oclIsUndefined() and name.size() > 0
Template Structure Validation:
deploymentTemplateRequired: not deploymentTemplate.oclIsUndefined()
podHasContainers: podTemplate.containers->size() > 0
containerImagesSpecified: podTemplate.containers->forAll(c | not c.dockerImage.oclIsUndefined())
Selector Logic Consistency:
hasMatchCriteria: matchLabels->size() > 0 or matchExpressions->size() > 0
clusterSelectorForDistribution: (placementPolicy = PlacementPolicy::DISTRIBUTED or
placementPolicy = PlacementPolicy::BALANCED) implies not clusterSelector.oclIsUndefined()
Configuration & References:
dataNotEmpty: data->size() > 0
dataKeysValid: data->forAll(key | key.matches('[A-Za-z0-9._-]+'))
operatorValid: operator.matches('In|NotIn|Exists|DoesNotExist')
The constraint system integrates with Eclipse Modeling Framework validation infrastructure, providing real-time feedback during model development.
Check OCL contrsaints in the Metamodel Files
KrossKube implements a custom Domain-Specific Language (DSL) using Eclipse Xtext to provide intuitive, textual syntax for defining MultiCluster resources. The DSL abstracts complex Kubernetes concepts into domain-friendly constructs while maintaining full expressiveness for multi-cluster deployment scenarios.
Use Case: Xtext grammar defines the concrete syntax and parsing rules for the KrossKube DSL, enabling developers to express multi-cluster resource definitions using natural, declarative syntax rather than verbose XML or programmatic APIs.
Implementation: The grammar specification establishes:
/**
Base DSL rule for MultiClutser resources
*/
MultiClusterResource returns MultiClusterResource:
MultiClusterConfigMap | MultiClusterCronJob | MultiClusterDaemonSet |
MultiClusterDeployment | MultiClusterIngress | MultiClusterPersistentVolume |
MultiClusterPersistentVolumeClaim | MultiClusterPod | MultiClusterRole |
MultiClusterRoleBinding | MultiClusterSecret | MultiClusterService |
MultiClusterStatefulSet;
Cluster Selection Syntax:
ClusterSelector returns ClusterSelector:
{ClusterSelector}
'ClusterSelector'
'{'
('matchLabels' '{' matchLabels+=EString ( "," matchLabels+=EString)* '}' )?
('matchExpressions' '{' matchExpressions+=EString ( "," matchExpressions+=EString)* '}' )?
'}';
Placement Policy Enumeration:
enum PlacementPolicy returns PlacementPolicy:
REPLICATED = 'REPLICATED' | DISTRIBUTED = 'DISTRIBUTED' | BALANCED = 'BALANCED';
Resource Template Definitions: The grammar supports comprehensive resource template specifications, such as:
MultiClusterDeployment returns MultiClusterDeployment:
{MultiClusterDeployment}
'MultiClusterDeployment'
name=EString
'{'
('clusterSelector' clusterSelector=ClusterSelector)?
('placementPolicy' placementPolicy=PlacementPolicy)?
('deploymentTemplate' deploymentTemplate=Deployment)?
'}';
This grammar enables developers to express complex multi-cluster deployments with intuitive syntax while maintaining type safety and semantic validation.
Check DSL Grammar File
Use Case: Native Eclipse IDE integration provides developers with familiar tooling for KrossKube DSL development, including syntax highlighting, error markers, outline views, and debugging capabilities.
Implementation: The integration includes:
- Syntax Highlighting: Domain-specific color coding for DSL elements
- Error Markers: Real-time validation with inline error indicators
- Outline View: Hierarchical navigation for model structures
- Quick Fixes: Automated resolution suggestions for common issues
This integration enables the adoption of KrossKube DSL within existing Eclipse-based development environments, with Xtend providing additional code generation and transformation capabilities for advanced use cases.
The Model-to-Text transformation engine leverages Eclipse Epsilon's Generation Language (EGL) to automate the production of Kubernetes Custom Resource Definitions (CRDs) and deployment manifests from high-level MultiCluster resource models.
Use Case: EGL provides template-based code generation capabilities that transform abstract KrossKube models into concrete Kubernetes YAML manifests. This bridge enables organizations to work with high-level abstractions while generating standard Kubernetes resources for deployment.
EGL Template Example Structure:
[% for deployment in MultiClusterDeployment.all %]
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: [%=deployment.name%]
namespace: [%=deployment.namespace%]
labels:
krosskube.managed: "true"
krosskube.placement-policy: "[%=deployment.placementPolicy%]"
spec:
replicas: [%=deployment.deploymentTemplate.replicas%]
[% /* Template continues with full Kubernetes Deployment specification */ %]
[% endfor %]
This transformation approach enables organizations to maintain high-level, reusable model definitions while generating deployment-specific Kubernetes resources that integrate with existing operational workflows.
Xtend serves as a powerful complement to the EGL-based code generation system, providing Java-compatible template processing and advanced model transformation capabilities. The integration of Xtend enhances KrossKube's code generation pipeline with type-safe templates, powerful expression syntax, and seamless Java ecosystem integration.
Use Case: Xtend templates provide an alternative and complementary approach to EGL for generating Kubernetes YAML manifests. The Java-compatible syntax enables more sophisticated generation logic while maintaining readability and maintainability.
Implementation: Xtend templates leverage string interpolation and powerful expression syntax:
class KubernetesGenerator {
def generateDeployment(MultiClusterDeployment deployment) '''
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: «deployment.name»
namespace: «deployment.namespace»
labels:
krosskube.managed: "true"
krosskube.placement-policy: "«deployment.placementPolicy»"
spec:
replicas: «deployment.deploymentTemplate.replicas»
selector:
matchLabels:
«FOR label : deployment.deploymentTemplate.podTemplate.labels SEPARATOR '\n'»
«label.key»: "«label.value»"
«ENDFOR»
'''
}The Xtend integration positions KrossKube as a comprehensive platform that bridges high-level modeling abstractions with enterprise-grade deployment automation, providing both template-based generation and programmatic extensibility.
The code generation subsystem represents the culmination of KrossKube's Model-Driven Engineering approach, transforming the high-level MultiCluster resource models into valid Kubernetes YAML CRD manifests.
The generation system leverages EGL: Epsilon's Generation Language (EGL) to implement sophisticated template-based transformation patterns:
Template Processing Workflow:
- Model Analysis: Parse MultiCluster resource definitions and extract cluster targeting policies
- Template Application: Apply EGL templates to generate both Custom Resource Definitions and standard Kubernetes resources
- Multi-Artifact Generation: Produce comprehensive deployment packages including:
- MultiCluster Custom Resource Definitions: High-level abstractions with placement policies
- Standard Kubernetes Deployments: Native workload specifications
- Service Definitions: Network exposure and load balancing configurations
- Configuration Resources: ConfigMaps, Secrets, and RBAC policies
Generated Artifact Structure:
The template system generates multiple coordinated Kubernetes resources for each MultiCluster definition:
apiVersion: multicluster.krosskube.io/v1alpha1
kind: MultiClusterDeployment
metadata:
name: web-app
labels:
generated-by: krosskube
spec:
placementPolicy: DISTRIBUTED
clusterSelector:
matchLabels:
environment: production
---
#- Standard Kubernetes Deployment -#
apiVersion: apps/v1
kind: Deployment
metadata:
name: web-app
labels:
managed-by: krosskube
spec:
replicas: 3
# ... #Check KrossKube's EGL Template
Use Case: The model-to-text transformation pipeline provides the execution engine for converting abstract MultiCluster models into deployable YAML artifacts. This automated process eliminates manual manifest creation while ensuring consistency and compliance with Kubernetes specifications.
Transformation Engine: The EGL-based transformation system implements comprehensive model traversal and template processing capabilities:
Transformation Process:
- Model Loading: Import MultiCluster resource models from DSL specifications or serialized model files
- Constraint Validation: Execute OCL constraints to ensure model consistency and Kubernetes compliance
- Template Orchestration: Apply hierarchical template processing with dependency resolution
- Artifact Generation: Produce organized YAML manifests with proper metadata and cross-references
- Validation: Verify generated resources against Kubernetes schemas and operational policies
The template-based generation approach ensures that KrossKube maintains perfect fidelity between high-level model specifications and operational deployment artifacts, enabling reliable multi-cluster resource management.
This section showcases practical KrossKube model definitions that demonstrate the framework's capabilities across various Kubernetes resource types and multi-cluster deployment scenarios. Each example illustrates how high-level MultiCluster abstractions translate into comprehensive deployment specifications while maintaining declarative simplicity and operational consistency.
The following model examples are available in the KrossKube models directory:
- MultiCluster Web Application Deployment:
Check Model
- MultiCluster StatefulSet for Database:
Check Model
- MultiCluster Logging DaemonSet:
Check Model
- MultiCluster CronJob for Reports:
Check Model
- MultiCluster API Gateway Service:
Check Model
- MultiCluster Web Application Ingress:
Check Model
- MultiCluster Application Configuration:
Check Model
- MultiCluster Database Secret:
Check Model
- MultiCluster PostgreSQL Persistent Volume Claim:
Check Model
These examples demonstrate KrossKube's modeling expressiveness across the complete spectrum of Kubernetes resource types, showcasing how the framework simplifies multi-cluster resource management through high-level abstractions.
The KrossKube DSL has been evaluated by fellow students and collaborators during the development process. Here are testimonials from classmates who have tested and provided feedback on the KrossKube framework:
| Reviewer | Role | Date | Focus Area |
|---|---|---|---|
| Kawtar Taik | Software Engineering Student @ENSIAS | Jan 25, 2026 | DSL Usability & Learning Experience |
| Ayoub Echaib | Software Engineering Student @ENSIAS | Jan 26, 2026 | DSL Usability & Learning Experience |
"As a student exploring Kubernetes, KrossKube's DSL made the complex world of multi-cluster management much more approachable. Coming from a traditional programming background, the DSL syntax felt intuitive and helped me understand Kubernetes concepts without getting overwhelmed by YAML configurations and infinite indentation !.
What I found most helpful was how the DSL abstracts away the complexity while still teaching the underlying concepts. The Eclipse IDE integration with syntax highlighting made it easy to experiment with different configurations. The automatic validation helped me catch mistakes early in my learning process."
Kawtar Taik (kawtartaik123@gmail.com)
Software Engineering Student @ENSIAS
January 25, 2026
"Working with KrossKube gave me hands-on experience with Model-Driven Engineering principles that we studied in class. The metamodel structure and the way it generates concrete Kubernetes resources really helped me understand the power of MDE approaches in practice.
The DSL development using Xtext was particularly interesting from a language design perspective. The EGL templates for code generation showed me how model transformations work in real applications. As someone interested in DevOps and cloud technologies, KrossKube provided a perfect combination of software engineering principles and modern infrastructure management."
Ayoub Echaib (a.echaib03@gmail.com)
Software Engineering Student @ENSIAS
January 26, 2026
This section provides a comprehensive step-by-step guide for setting up the KrossKube DSL and Model-to-Text generation pipeline. The walkthrough demonstrates the complete workflow from metamodel setup through Java API generation, DSL infrastructure creation, and finally automated YAML manifest generation from MultiCluster resource models.
The first phase involves setting up the EMF Generator project and configuring the Java API generation from the KrossKube metamodel.
Begin by creating a new EMF Generator Model project in Eclipse. This project will contain the GenModel configuration and orchestrate the Java API generation process.
Specify the Genmodel name and choose the appropriate workspace location for the EMF generator file.
Choose "Ecore model" as the foundation for code generation, enabling the system to generate Java APIs directly from the KrossKube Ecore metamodel files.
Select all relevant KrossKube metamodel packages including the multicluster abstractions and native Kubernetes resource packages.
Configure cross-reference packages to ensure complete API generation with proper inter-package dependencies and relationships.
Execute the Java API generation process using the configured GenModel file, which will produce comprehensive Java classes for all metamodel concepts (Choose Generate All).
The generation process produces a complete Java API with model classes, factory patterns, and utility classes for all KrossKube metamodel elements.
The second phase focuses on creating the Xtext-based Domain-Specific Language infrastructure.
Create a new Xtext project to develop the KrossKube Domain-Specific Language with integrated Eclipse tooling support.
Link the previously created GenModel file to the Xtext project, enabling automatic grammar generation from the metamodel structure.
Configure the DSL's default package structure and define the main grammar entry rule for MultiCluster resource parsing, it's the MultiClusterResource base-class
Establish the DSL package architecture that mirrors the metamodel organization for consistent development experience.
Generate the complete DSL infrastructure including parser, lexer, validator, and Eclipse IDE integration components from right-clicking the DSL.xtext file.
The generation process produces a comprehensive DSL infrastructure with syntax highlighting, validation, and autocompletion capabilities.
The DSL provides a rich editing experience with syntax highlighting and semantic validation for KrossKube model development.
The integrated development environment provides intelligent autocompletion for MultiCluster resource attributes and relationships.
The final phase demonstrates the EGL-based transformation from MultiCluster models to Kubernetes YAML manifests.
Begin the EGL template setup process to configure model-to-text transformation from KrossKube models to Kubernetes YAML manifests by creating the base .egl file
Configure the EGL transformation engine with appropriate parameters for processing MultiCluster resource models.
Select the KrossKube metamodel packages that will be available during the template-based generation process.
Specify the input KrossKube model files and configure the output directory structure for generated Kubernetes YAML manifests.
The model-to-text transformation successfully generates comprehensive Kubernetes YAML manifests from high-level MultiCluster resource definitions.
The generation process produces both MultiCluster Custom Resource Definitions and corresponding native Kubernetes resources, demonstrating the complete transformation pipeline from abstract models to deployable manifests.
© 2026 KrossKube | The m-elhamlaoui organization














































