Import and Export Designs

Meshery supports two primary operations for working with designs: Import and Export. A design in Meshery is a structured model describing how various components (e.g., Kubernetes manifests, Helm charts, or Docker Compose objects) should be managed and deployed. This document details the core concepts, the import/export processes, and the available methods to perform them.

Core Operations

Meshery treats each design as a combination of:

  • Components: Defined resources or services (e.g., Deployments, Services).
  • Relationships: Possible connections or dependencies among components (e.g., hierarchical, sibling, edge).

When importing a design, Meshery:

  1. Parses and validates the design file.
  2. Processes design structure, applying transformations as needed.
  3. Routes validated components to the appropriate Meshery Adapters for further deployment or processing.

When exporting a design, Meshery:

  1. Fetches the design data from the Meshery database using /api/pattern/download/{id}.
  2. Converts the design format if necessary (e.g., from V1alpha2 to V1beta1).
  3. Applies requested export format (e.g., current, original, oci).
  4. Sends the exported design file for download as a YAML file or OCI artifact.

Import Methods

You can import designs into Meshery through either Meshery CLI or Meshery UI.

1. Using Meshery CLI

mesheryctl design import --file <PATH/URL> --source-type <TYPE>
# Example: Import Kubernetes manifest
mesheryctl design import -f ./app-deployment.yaml -s manifest

2. Using Meshery UI

  1. Go to Designs > Import Design.
  2. Choose your input method.
  3. Select the source type from the dropdown (e.g., Kubernetes manifest, Helm chart).
  4. Submit the design for processing.

Import Processing Details

After you initiate an import, Meshery executes a dataflow sequence to properly handle the design:

  1. Client submits a design
    A POST request is sent to /api/pattern/import, containing a design file. If the design is sourced from Kubernetes Manifests, Docker Compose, or Helm Charts, it is first converted into a standard Kubernetes Manifest.

  2. Pattern Engine queries registry
    Meshery queries the component registry to match the design’s kind, apiVersion, and other identifiers. If the design originates from non-Meshery formats, Meshery attempts to transform it accordingly.

  3. System converts design format
    • Converts Helm Charts, Docker Compose, and Kubernetes Manifests into Meshery Design.
    • Removes unnecessary fields and ensures compatibility.
  4. Validated components are stored in Meshery
    Once validated, the design is stored in Meshery. Users can later deploy it to a supported platform (e.g., Kubernetes, Consul, Istio) using Meshery UI or CLI.

Export Methods

Designs can also be exported either via Meshery CLI or Meshery UI. During export, Meshery gathers the design’s components, relationships, and metadata into a specified format.

1. Using Meshery CLI

mesheryctl design export --type <FORMAT> --output <DIRECTORY>
# Example: Export to OCI format
mesheryctl design export --type oci -o ./exports

2. Using Meshery UI

  1. Go to Designs > My Designs and select the design you want to export.
  2. Click the Export action button.
  3. Choose an export format (e.g., current, original, oci).
  4. Specify the download location for your exported file.

Summary

  • Import: Meshery parses and validates your design, converts non-Meshery formats (e.g., Kubernetes Manifests, Helm Charts, Docker Compose) into Meshery Designs, and stores the design in Meshery. Users can later deploy it to the correct adapters as needed.
  • Export: Meshery retrieves the design from storage, converts its format if needed, packages it in the selected format (current, original, oci), and delivers it as a YAML file or OCI artifact via CLI or UI download.

Suggested Reading

  • Component Shape Guide - Kubernetes architecture deployment and architecture diagramming tool for cloud native applications - Kanvas.
  • Edges Style Guide - Visualize and manage complex cloud-native relationships with Kanvas' dynamic edge styling in Kubernetes architecture.
  • Helm Kanvas Snapshot - Helm CLI plugin to visually render a snapshot of your Helm charts.
  • kubectl MeshSync Snapshot - A native kubectl plugin for conveniently synchronizing the state of your cluster with Meshery Server.
  • Kanvas Snapshot - Screenshot service provided via Kanvas to capture a snapshot of your infrastructure at any given time.
  • kubectl Kanvas Snapshot - Screenshot service provided via Kanvas to capture a snapshot of your infrastructure at any given time.
  • Kanvas - Collaborative cloud native visual designer to design and manage infrastructure and applications.
  • Merging Designs - Treat other designs as templates or building blocks and combine your designs with others and power-up your designs.
  • Publishing a Design - Publishing a design lets you make your content visible to any anonymous visitor with the link.
  • Sharing a Design - Sharing a design lets you make your content visible to any anonymous visitor of meshery.io/catalog and any Meshery Cloud user.
  • Working with Tags - Tags can be used to visually group components.