Skip to content

m-elhamlaoui/KrossKube

Repository files navigation

Last Updated: January 4th, 2026

KrossKube

KrossKube Logo

Figure: The KrossKube logo


KrossKube is a Model-Driven Engineering (MDE) solution designed to address the complexities of managing native Kubernetes resources across multiple clusters.


Kubernetes Eclipse Modeling Xtext Ecore Epsilon OCL


Note

KrossKube is a project supervised by Pr. Mahmoud El Hamlaoui, proposed and maintained under the @m-elhamlaoui organization.

Team Members


BIDIOUANE
Haitam

@sch0penheimer


ELMOUDNI
Yassine

@Mdn753


GHOUZALI
Ayoub

@AyoubGhouzali

Table of Contents

  1. Overview

  2. Architecture & Metamodel

  1. Technology Stack

  2. CRD Manifests Generation

  1. Examples

  1. End-to-end Practical Walkthrough

1. Overview

1.1 Problem Statement

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.

K8s Multi-Cluster Management

Figure: Kubernetes Multi-Cluster Management

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).

1.2 Solution Approach

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.

2. Architecture & Metamodel

KrossKube's Model-Driven Engineering foundation establishes the theoretical and practical framework for systematic transformation of abstract resource models into concrete Kubernetes manifests.

2.1 Metamodel Layer

KrossKube Metamodel

Figure: The KrossKube Metamodel UML Class Diagram

(Click on the figure for a full-screen view)

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.

2.1 Metamodel Sub-Packages

The KrossKube metamodel architecture is organized into distinct sub-packages that provide modular separation between native Kubernetes resource definitions and multi-cluster abstractions.

2.1.1 Kubernetes Native Packages

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.

KrossKube MultiCluster Abstractions

Figure: KrossKube's Kubernetes Native Resources Metamodel Package

(Click on the figure for a full-screen view)

2.1.1.1 Runtime Resources

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.

2.1.1.2 Network Resources

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.

2.1.1.3 Storage Resources

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.

2.1.1.4 Security Resources

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.

2.1.2 KrossKube Multicluster Package

KrossKube MultiCluster Abstractions

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.

Section II: Implementation & Technology Stack

3. Technology Stack

Eclipse Ecosystem

Figure: KrossKube's Eclipse-Based Technology Stack

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.

3.1 Eclipse Modeling Framework

EMF Ecosystem

Figure: Eclipse EMF: Eclipse Modeling Framework

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.

3.1.1 Obeo Designer Integration

Obeo Designer

Figure: Obeo Designer: MDE-ready Eclipse Package

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.

3.1.2 Ecore Metamodeling

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.

KrossKube MultiCluster Package

Figure: KrossKube Multi-Cluster Package Structure in Ecore Editor

Kubernetes Config Package

Figure: Kubernetes Config Package Structure in Ecore Editor

Kubernetes Runtime Package

Figure: Kubernetes Runtime Package Structure in Ecore Editor

Kubernetes Storage Package

Figure: Kubernetes Storage Package Structure in Ecore Editor

Kubernetes Security Package

Figure: Kubernetes Security Package Structure in Ecore Editor

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

-> /metamodel/krosskube.multicluster.ecore

-> /metamodel/kubernetes.runtime.ecore

-> /metamodel/kubernetes.storage.ecore

-> /metamodel/kubernetes.config.ecore

-> /metamodel/kubernetes.security.ecore

3.1.3 EMF Java API Code Generation

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:

Genmodel File

Figure: Kubernetes Runtime Package Structure in Ecore Editor

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

Generated Java API

Figure: Kubernetes Runtime Package Structure in Ecore Editor

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

/metamodel/krosskube.genmodel

3.1.4 Object Constraint Language (OCL)

The KrossKube metamodel implements comprehensive OCL constraints enforcing semantic correctness and Kubernetes specification compliance across all model instances:

4.1.4.1 Naming Conventions & Format Validation

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
4.1.4.2 Resource Template Consistency

Template Structure Validation:

deploymentTemplateRequired: not deploymentTemplate.oclIsUndefined()
podHasContainers: podTemplate.containers->size() > 0
containerImagesSpecified: podTemplate.containers->forAll(c | not c.dockerImage.oclIsUndefined())
4.1.4.3 Cluster Selection & Placement Validation

Selector Logic Consistency:

hasMatchCriteria: matchLabels->size() > 0 or matchExpressions->size() > 0
clusterSelectorForDistribution: (placementPolicy = PlacementPolicy::DISTRIBUTED or
    placementPolicy = PlacementPolicy::BALANCED) implies not clusterSelector.oclIsUndefined()
4.1.4.4 Data Integrity & Cross-Reference Validation

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

/metamodel/*.ecore/

3.2 Domain-Specific Language

Xtext Language Engineering

Figure: Xtext-Based DSL Infrastructure

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.

3.2.1 Xtext Grammar Definition

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.

DSL Grammar File

Figure: Xtext DSL Grammar Generated from the KrossKube's .genmodel

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

/mde.krosskube.dsl/src/mde/krosskube/dsl/Dsl.xtext

3.2.2 Runtime Eclipse IDE Integration

Runtime IDE

Figure: A highlighted KrossKube model in KrossKube's Runtime Eclipse IDE

Runtime IDE Autocompletion

Figure: Autocompletion of KrossKube model in the Runtime Eclipse IDE

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.

3.3 Model-To-Text Transformation Engine

Epsilon Generation Language

Figure: Epsilon-Based Model Management and Code Generation

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.

3.3.1 Epsilon Generation Language (EGL)

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.

3.4 Xtend Integration

Xtend

Figure: Xtend: Java-Compatible Template Language

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.

4. Code Generation

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.

4.1 Template-Based Generation

The generation system leverages EGL: Epsilon's Generation Language (EGL) to implement sophisticated template-based transformation patterns:

EGL Template Structure

Figure: EGL Template Structure for KrossKube's MultiCluster Resource Generation

Template Processing Workflow:

  1. Model Analysis: Parse MultiCluster resource definitions and extract cluster targeting policies
  2. Template Application: Apply EGL templates to generate both Custom Resource Definitions and standard Kubernetes resources
  3. 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

-> /krosskube-generator.egl

4.2 Model-to-Text Transformations

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:

Successful YAML Generation

Figure: Successful YAML Generation from MultiCluster Models

Transformation Process:

  1. Model Loading: Import MultiCluster resource models from DSL specifications or serialized model files
  2. Constraint Validation: Execute OCL constraints to ensure model consistency and Kubernetes compliance
  3. Template Orchestration: Apply hierarchical template processing with dependency resolution
  4. Artifact Generation: Produce organized YAML manifests with proper metadata and cross-references
  5. 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.


Section III: Usage & Reference

5. Examples

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:

5.1 Workload Resources

  1. MultiCluster Web Application Deployment:

Check Model

/krosskube_models/web-app-deployment.krosskube

  1. MultiCluster StatefulSet for Database:

Check Model

/krosskube_models/postgres-statefulset.krosskube

  1. MultiCluster Logging DaemonSet:

Check Model

/krosskube_models/logging-daemonset.krosskube

  1. MultiCluster CronJob for Reports:

Check Model

/krosskube_models/daily-report-cronjob.krosskube

5.2 Network Resources

  1. MultiCluster API Gateway Service:

Check Model

/krosskube_models/api-gateway-service.krosskube

  1. MultiCluster Web Application Ingress:

Check Model

/krosskube_models/web-app-ingress.krosskube

5.3 Configuration Resources

  1. MultiCluster Application Configuration:

Check Model

/krosskube_models/application-config.krosskube

  1. MultiCluster Database Secret:

Check Model

/krosskube_models/database-secret.krosskube

5.4 Storage Resources

  1. MultiCluster PostgreSQL Persistent Volume Claim:

Check Model

/krosskube_models/postgres-pvc.krosskube

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.


6. Reviews

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:

6.1 Student Feedback

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

6.1.1 Kawtar Taik - Software Engineering Student @ENSIAS

"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

6.1.2 Ayoub Echaib - Software Engineering Student @ENSIAS

"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


7. End-to-end Practical Walkthrough

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.

Step 1.1: Creating New EMF Generator Project

New EMF Generator Project

Figure: Creating a new EMF Generator Project in Eclipse

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.

Step 1.2: Genmodel file Name and Location

Project Name and Location

Figure: Configuring the genmodel file name and location

Specify the Genmodel name and choose the appropriate workspace location for the EMF generator file.

Step 1.3: Ecore-Based Generation Selection

Ecore Generation Selection

Figure: Selecting Ecore-based code generation approach

Choose "Ecore model" as the foundation for code generation, enabling the system to generate Java APIs directly from the KrossKube Ecore metamodel files.

Step 1.4: Metamodel Package Selection

Metamodel Packages

Figure: Selecting all KrossKube metamodel packages for generation

Select all relevant KrossKube metamodel packages including the multicluster abstractions and native Kubernetes resource packages.

Step 1.5: Cross-Reference Package Configuration

Cross-Reference Packages

Figure: Configuring cross-reference packages for complete API generation

Configure cross-reference packages to ensure complete API generation with proper inter-package dependencies and relationships.


Step 2.1: GenModel Configuration and Generation

GenModel Generation

Figure: Executing Java API generation from GenModel configuration

Execute the Java API generation process using the configured GenModel file, which will produce comprehensive Java classes for all metamodel concepts (Choose Generate All).

Step 2.2: Generated Java API Structure

Generated Java API

Figure: Generated Java API classes and package structure

The generation process produces a complete Java API with model classes, factory patterns, and utility classes for all KrossKube metamodel elements.

6.3 DSL Infrastructure Development

The second phase focuses on creating the Xtext-based Domain-Specific Language infrastructure.

Step 3.1: Xtext Project Instantiation

Xtext Project Creation

Figure: Creating new Xtext project for KrossKube DSL

Create a new Xtext project to develop the KrossKube Domain-Specific Language with integrated Eclipse tooling support.

Step 3.2: GenModel File Integration

GenModel Selection

Figure: Integrating existing GenModel file with Xtext project

Link the previously created GenModel file to the Xtext project, enabling automatic grammar generation from the metamodel structure.

Step 3.3: DSL Grammar Configuration

DSL Grammar Configuration

Figure: Configuring DSL default package and grammar entry rules

Configure the DSL's default package structure and define the main grammar entry rule for MultiCluster resource parsing, it's the MultiClusterResource base-class

Step 3.4: Package Structure Definition

DSL Packages

Figure: Defining DSL package structure and dependencies

Establish the DSL package architecture that mirrors the metamodel organization for consistent development experience.

Step 3.5: DSL Artifact Generation

DSL Artifact Generation

Figure: Generating DSL parser, lexer, and tooling artifacts

Generate the complete DSL infrastructure including parser, lexer, validator, and Eclipse IDE integration components from right-clicking the DSL.xtext file.

Step 3.6: DSL Infrastructure Completion

DSL Infrastructure

Figure: Completed DSL infrastructure with Eclipse tooling integration

The generation process produces a comprehensive DSL infrastructure with syntax highlighting, validation, and autocompletion capabilities.

Step 3.7: Runtime Eclipse IDE Model Example

Runtime IDE Model

Figure: KrossKube model example in the associated Runtime Eclipse IDE with syntax highlighting

The DSL provides a rich editing experience with syntax highlighting and semantic validation for KrossKube model development.

Step 3.8: Autocompletion Support

IDE Autocompletion

Figure: Intelligent autocompletion support in the Runtime Eclipse IDE

The integrated development environment provides intelligent autocompletion for MultiCluster resource attributes and relationships.

6.4 Model-to-Text Generation Pipeline

The final phase demonstrates the EGL-based transformation from MultiCluster models to Kubernetes YAML manifests.

Step 4.1: EGL Template Initiation

EGL Template Initiation

Figure: Initiating EGL template configuration for model-to-text transformation

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

Step 4.2: EGL Configuration Setup

EGL Configuration

Figure: Configuring EGL transformation parameters and settings

Configure the EGL transformation engine with appropriate parameters for processing MultiCluster resource models.

Step 4.3: Metamodel Selection for Generation

EGL Metamodel Selection

Figure: Selecting KrossKube metamodel for EGL template processing

Select the KrossKube metamodel packages that will be available during the template-based generation process.

Step 4.4: Input Models and Output Configuration

Input/Output Configuration

Figure: Configuring input model files and output directory structure

Specify the input KrossKube model files and configure the output directory structure for generated Kubernetes YAML manifests.

Step 4.5: Successful Manifest Generation (Part 1)

Successful Generation 1

Figure: Successfully generated Kubernetes YAML manifests - MultiCluster resources

The model-to-text transformation successfully generates comprehensive Kubernetes YAML manifests from high-level MultiCluster resource definitions.

Step 4.6: Successful Manifest Generation (Part 2)

Successful Generation 2

Figure: Successfully generated Kubernetes YAML manifests - Native Kubernetes resources

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

About

KrossKube is a Model-Driven Engineering (MDE) solution to generate high-level Custom Resource Definition (CRD) manifests for standardized, multi-cluster management of the base Kubernetes-native resources.

Topics

Resources

License

Stars

Watchers

Forks

Contributors