Exporting Models

Export existing Meshery Models or your custom infrastructure crd imported as Models in Meshery. The platform supports a variety of application definition formats, and you can export designs using either the Meshery CLI or the Meshery UI.

Import Models Using Meshery CLI

Step 1: Install Meshery CLI

Before you can use the Meshery CLI to export a Model, you must first install it. You can install Meshery CLI by following the instructions.

Step 2: Import the Model

Model can be exported in 2 format and OCI or Compress file. These files contain different components, relationships files and a model file. The files can be exported in either yaml or json by default it is exported as yaml.

mesheryctl model export [model-name]

Different file type and output type can be set using flags -o for oci and tar and -t for json or yaml. A location can also be specified using the -l flag where user needs to export the model

Example :

mesheryctl model export istio-base -o oci
mesheryctl model export istio-base -o oci -t json

Note: A --discard-components --discard-relationships flag is present to skip component and relationships generation in the export only the model is exported without any components and relationships.

Import Models Using Meshery UI

Step 1: Access the Meshery UI

To import a model into Meshery using the Meshery UI, you must first install Meshery

Step 2: Navigate to Registry under Settings Page

Once you have accessed the Meshery UI, navigate to the Registry under Settings. This page can be accessed by clicking on the Settings on the top right on setting icon and then selecting β€œRegistry” and then choose model.

Registry-Navigator

Step 3: Upload the Models

On the Registry page, you can upload your model by select File Type from the options and clicking on the β€œBrowse” button and selecting the file (tar.gz or OCI) from your local machine or uploading in through URL. If you choose URL you need to provide in some fields like registrant, model name, model displayname and category. Once you have selected the file or entered the URL and filled the form, click on the β€œImport” button to import model into Meshery.

When you import an model into Meshery, it will create a Meshery model based on definition. This Meshery model will include components, relationships.

Export-Model

Once the Meshery model has been exported, you can use Import to import the model and then visualize,operate and observe your components on Kanvas. You can also use Meshery to deploy your Meshery Model in form of a design to any of your connected kubernetes clusters. For more information, see connections

Suggested Reading