docs/static/v0.8/guides/mesheryctl/working-with-mesheryctl/index.html
Meshery’s command line interface is mesheryctl. Use mesheryctl to both manage the lifecyle of Meshery itself and to access and invoke any of Meshery’s application and cloud native management functions. mesheryctl commands can be categorized as follows:
mesheryctl - Global overrides and flagsmesheryctl app - Cloud Native Application Managementmesheryctl filter - Cloud Native Filter Managementmesheryctl mesh - Cloud Native Lifecycle & Configuration Managementmesheryctl perf - Cloud Native Performance Managementmesheryctl design - Cloud Native Pattern Configuration & Managementmesheryctl system - Meshery Lifecycle and TroubleshootingMeshconfig refers to a configuration file found at ~/.meshery/config.yaml. Your meshconfig file must contain one or more contexts in order for any mesheryctl system command to work. Each context represents a Meshery deployment.
Each of the system commands are used to control Meshery’s lifecycle like system start, stop, status, reset and so on.
Like kubeconfig for kubectl, meshconfig is the name of your mesheryctl config file. You can find your meshconfig file in its default location of ~/.meshery/config.yaml. By default, mesheryctl will look to this location for your meshconfig. You can override the default location at anytime with the use of the global parameter, --config <my-other-meshconfig>.
A meshconfig context represents a single Meshery deployment. Using contexts, you can configure different Meshery deployments with environment-specific settings and you can easily switching between your individual Meshery deployments by updating your current-context.
Many Meshery users have more than one Meshery deployment. Contexts allow you to deploy different versions of Meshery, update your release channel subscription settings, selectively install one or more Meshery Adapters, and so on. Contexts allow you to configure your individual Meshery deployments.
current-context?current-context identifies the Meshery deployment that when any mesheryctl command is invoked will use the environment described in the current-context. You can switch between contexts. Only one context can be the current-context.
Contexts configure Meshery deployments (server, adapters, operator and so on), while environments define a collection of Kubernetes clusters and cloud native infrastructure under management in Meshery.
The following template is used to create a config file from scratch. Not all of the following variables are required to be included. Some of the variables may have a null value or may be excluded (e.g. “adapters”).
The --config flag is a global option that applies to all mesheryctl commands. It allows you to specify the location of a custom meshconfig file, overriding the default configuration. This config file is used to set up the mesheryctl context, which defines the configuration for a particular Meshery deployment.
contexts: [context1-name]: endpoint: [url to meshery server rest api] token: [name of token variable in this config file] platform: [type of platform: "docker" or "kubernetes"] # Future: specify type of kubernetes (e.g. eks) channel: [release channel: "stable", "stable-version", "edge", or "edge-version"] adapters: [collection of names of Meshery adapters: "istio","linkerd","consul","nginx-sm","tanzu-sm","cilium","app-mesh","traefik-mesh","nighthawk","kuma","osm","nsm"] version: [version of Meshery client "latest", "v0.8.132", ...] provider: [meshery's providers: "Meshery", "None", ...] # add ENVs here env: meshsync\_deployment\_mode: ["operator" or "embedded", defaults to "operator"] [context2-name]: endpoint: [url to meshery server rest api] token: [name of token variable in this config file] platform: [type of platform: "docker" or "kubernetes"] current-context: [context name] tokens: - name: [token1-name] location: [token-location] - name: [token2-name] value: [token-value] # Future: allow embedding of token certificate
Try it out and see for yourself. Run mesheryctl system context create test and mesheryctl system context view test.
Endpoints specify the access URL for the Meshery UI, for a deployment. Endpoints are developed based on platform:
http://localhost:port, where port is taken from the meshconfig.Yes, if you need to establish a session with your Meshery Server, you can authenticate using mesheryctl, using mesheryctl system login.
Users can control the specific container image and tag (version) of Meshery that they would like to run by editing their local ~/.meshery/meshery.yaml (a docker compose file). Aligned with the Meshery container image, instead of leaving the implicit :stable-latest tag behind image: meshery/meshery, users will instead identify a specific image tag like so:
`
version: '3'
services:
meshery:
image: meshery/meshery:v0.5.0
labels:
- "com.centurylinklabs.watchtower.enable=true"`
For an exhaustive list of mesheryctl commands and syntax:
Guides to using Meshery’s various features and components.
Don't find an answer to your question here? Ask on the Discussion Forum.