Using the Tanzu Service Mesh CLI, you can retrieve the configuration of an existing object or a policy and create another manifest based on the existing configuration.
For example, you can use the Tanzu Service Mesh CLI to retrieve the configuration of an existing global namespace and then create a manifest describing the configuration of another global namespace, based on that existing global namespace configuration.
Procedure
- Run the following CLI command.
tanzu sm get {API} {object or policy name}
sm
is the alias for the Tanzu Service Mesh plugin in the Tanzu CLI. You can replace sm
with service-mesh
. {API}
is the short or long name of the appropriate API. For example, if you want to create a global namespace, provide the name of the global namespace API. For a list of the availables API and their names, see the Available APIs table in Create a Declarative Manifest Based on a Tanzu Service Mesh API Specification. {object or policy name}
is the name of the existing object or policy whose configuration you want to reuse to create a manifest.
For example, suppose you want to create a manifest of a global namespace based on the configuration of an existing global namespace called acme. To retrieve the configuration of the acme global namespace, you run the following command.
tanzu sm get globalnamespaces acme
Where globalnamespaces
is the short name of the global namespace API, and acme
is the name of the existing global namespace whose configuration we want to reuse.
The CLI returns the configuration of the specified object or policy in YAML format. In the example above, the CLI returns the configuration of the acme global namespace.
api_discovery_enabled: true
ca: default
ca_type: PreExistingCA
color: ""
description: ""
display_name: acme
domain_name: acme.lab
match_conditions:
- cluster:
match: tsm
type: START_WITH
namespace:
match: acme
type: EXACT
mtls_enforced: false
name: acme
use_shared_gateway: true
version: "2.0"
- Copy the configuration to a YAML file.
- In the YAML file, enter appropriate values for the fields in the configuration.
For information about the meaning of the fields in the configuration and what value to provide for each field, see the schema of the appropriate API in API Explorer in Tanzu Service Mesh. Perform the following steps:
In Tanzu Service Mesh SaaS UI, click API Explorer on the bottom bar.
Go to the appropriate API in API Explorer.
In the API section, under Request Body, click Schema.
- Save the changes in the file.
What to do next
Add the manifest file to the Git repository where you maintain all your manifest files.