You are viewing archived v1.24 Service Mesh documentation.
Available versions
Cloud Service Mesh latest
Cloud Service Mesh 1.26 archive
Cloud Service Mesh 1.24 archive
Cloud Service Mesh 1.24 archive
Cloud Service Mesh 1.23 archive
Cloud Service Mesh 1.22 archive
Cloud Service Mesh 1.21 archive
Cloud Service Mesh 1.20 archive
Anthos Service Mesh 1.19 archive
asmcli reference
Note: This guide only supports Cloud Service Mesh with Istio APIs and doesnot support Google Cloud APIs. For more information see,Cloud Service Mesh overview.Overview
Theasmcli is a Google-provided tool that you can use to install orupgrade Cloud Service Mesh. If you let it,asmcli will configure yourproject and cluster as follows:
- Grant you the required Identity and Access Management (IAM) permissions on yourGoogle Cloud project.
- Enable the required Google APIs on your Google Cloud project.
- Set a label on the cluster that identifies the mesh.
- Create a service account that lets data plane components, suchas the sidecar proxy, securely access your project's data and resources.
- Register the clusterto the fleet if it isn't already registered.
Just include the--enable_all flag when you runasmcli to let it configureyour project and cluster. For more information aboutasmcli options and flags,see theasmcli reference.
Next,asmcli configures YAML files with your project and cluster information.These configuration files are needed to install the Cloud Service Meshcontrol plane.
If you are new to Cloud Service Mesh and Istio, skip ahead toSupported platforms. The next section is intended tohelp existing Cloud Service Mesh upgrade to 1.24.
Transitioning toasmcli
Theasmcli takes the place ofistioctl install andinstall_asm. Althoughyou can still use the legacy tools in Cloud Service Mesh 1.11, we are deprecatingthem and they will no longer be supported in Cloud Service Mesh 1.12 and later.Please update your scripts and tools to useasmcli.
All clusters must be registered to afleet. SeeFleet requirementsfor details.
Transitioning frominstall_asm
If you are familiar withinstall_asm,asmcli is similar but with thefollowing notable differences:
You use
asmcli installfor new installations and upgrades.There isn't a--modeoption like withinstall_asm. When you runasmcli install, it checks to see ifthere's an existing control plane on the cluster. If there isn't an existingcontrol plane,asmcliinstalls Cloud Service Mesh. If the cluster has anexisting control plane (either a Cloud Service Mesh control plane or an open sourceIstio control plane):If therevision label on the existingcontrol plane doesn't match the revision label for the new control plane,
asmclidoes acanary upgrade.If the control plane revision labels are the same,
asmclidoes anin-place upgrade.
Most of the
asmclioptions and flags behave the sameas the ones forinstall_asm.
Transitioning fromistioctl install
If you are familiar withistioctl install, if you normally pass anIstioOperator YAML file via the-f command-line argument to configure thecontrol plane, you can pass the file toasmcli using the--custom_overlayoption. In the Cloud Service Mesh documentation, we refer to these files asoverlay files.
asmcli doesn't install an ingress gateway with the controlplane. For production deployments, we recommend that you install gatewaysseparately. For more information and best practices, seeInstall and upgrade gateways.We have provided sample Deployment, Service, ServiceAccount, and Roleconfiguration files in theanthos-service-mesh repository for both ingress and egress gateways to get you started. You candeploy them as they are or customize them as needed.Supported platforms
Deprecated: Configuring Cloud Service Mesh with asmcli for Managed controlplane for GKE on Google Cloud is deprecated. For more information, see theCloud Service Mesh release notes.To configure Managed Cloud Service Mesh for GKE follow thisguide.Cloud Service Mesh installations on the list ofSupported platforms can be configuredor upgraded byasmcli.
However, not all features are available on the platforms outside of Google Cloud.For details, seeIn-cluster control plane supported features.
asmcli reference
This section describes the available arguments toasmcli.
./asmcli -h -v to view a full list of available flagsand options along with their descriptions.Options
Identify the clusterYou have the following options to identify the cluster:
GKE only
-p|--project_idCLUSTER_PROJECT_ID- The project ID that the cluster was created in.
-n|--cluster_nameCLUSTER_NAME- The name of the cluster.
-l|--cluster_locationCLUSTER_LOCATION- Either the zone (for single-zone clusters) or region (for regionalclusters) that the cluster was created in.
All platforms
--kubeconfigKUBECONFIG_FILEThe full path to thekubeconfig file. The environmentvariable$PWD doesn't work here.
--ctx|--contextKUBE_CONTEXTThekubeconfig context to use. If not specified,asmcli uses the default context.
-c|--ca {mesh_ca|gcp_cas|citadel}The certificate authority (CA) to use to managemutual TLS certificates. Specify
mesh_cato use Cloud Service Mesh certificate authority (Cloud Service Mesh certificate authority),gcp_casto useCertificate Authority Service, orcitadelto use the Istio CA. Managed Cloud Service Mesh does not support IstioCA.See the following for additional information:--channelCLOUD_SERVICE_MESH_CHANNELUse
--channelwith a specificCloud Service Mesh release channelto provision the Control Plane revision associated with that release channel.For example,--channel rapid,--channel regular, and--channel stable.This flag is required when configuring certain Cloud Service Mesh features onGKE Autopilot clusters.
--channel option is no longer supported for Managed Cloud Service Mesh asmentioned inCSM Release Notes.Release channel is determined based on your GKE cluster release channel.For more information, seeManaged Cloud Service Mesh release channels.
--co|--custom_overlayOVERLAY_FILE- Use
--custom_overlywith the name of a YAML file (referred to as anoverlay file) containing theIstioOperatorcustom resource to configurethe in-cluster control plane. You specify an overlay file toenable a featurethat isn't enabled by default. Managed Cloud Service Mesh doesn't support theIstioOperatorAPI, so you can't use--custom_overlayto configure themanaged control plane.asmclimust be able to locate the overlay file, so iteither needs to be in the same directory asasmcli, or you can specify arelative path. To add multiple files, specify--co|--custom_overlayand the filename, for example:--co overlay_file1.yaml --co overlay_file2.yaml --co overlay_file3.yaml --hub-registration-extra-flagsHUB_REGISTRATION_EXTRA_FLAGS- If using attached Amazon EKS clusters, use
--hub-registration-extra-flagstoregister the cluster to the fleet if it isn't already registered. -k|--key_fileFILE_PATH- The key file for a service account. Omit this option if you aren't usinga service account.
--network_idNETWORK_ID- Use
--network_idto set thetopology.istio.io/networklabel applied to theistio-systemnamespace. For GKE,--network_iddefaults to thenetwork name for the cluster. For other environments,defaultwill be used. -o|--optionOVERLAY_FILEThe name of the overlay file (without the
.yamlextension) thatasmclidownloads from theanthos-service-meshrepository to enable anoptional feature. You need internet connectivity to use--option. The--optionand--custom_overlayoptions are similar, but they have slightlydifferent behavior:Use
--custom_overlaywhen you need to change the settings in the overlayfile.Use
--optionto enable a feature that doesn't require changes to theoverlay file, for example, toconfigure audit policies for your services.
To add multiple files, specify
-o|--optionand thefilename, for example:-o option_file1 -o option_file2 -o option_file3-D|--output_dirDIR_PATHIf not specified,
asmclicreates a temporary directory where itdownloads files and configurations necessary for installing Cloud Service Mesh.Specify the--output-dirflag to specify a relative path to a directory to useinstead. Upon completion, the specified directory contains theasmandtheistio-1.24.6-asm.12subdirectories. Theasmdirectorycontains the configuration for the installation. Theistio-1.24.6-asm.12directory contains the extracted contents ofinstallation file, which containsistioctl, samples, and manifests. If youspecify--output-dirand the directory already contains the necessaryfiles,asmcliuses those files instead of downloading them again.--platformPLATFORM {gcp|multicloud}The platform or the provider of the Kubernetes cluster. Defaults to
gcp(for GKE clusters). For all otherplatforms use,multicloud.-r|--revision_nameREVISION NAMEArevision label is a key-value pair thatis set on the control plane. The revision label key is always
istio.io/rev. Bydefault,asmclisets the value for the revision label based on theCloud Service Mesh version, for example:asm-1246-12. Include thisoption if you want to override the default value and specify your own. TheREVISION NAMEargument must be aDNS-1035 label. This means the name must:- contain at most 63 characters
- contain only lowercase alphanumeric characters or '-'
- start with an alphabetic character
- end with an alphanumeric character
The regex used for validation is:'[a-z]([-a-z0-9]*[a-z0-9])?'
-s|--service_accountACCOUNT- The name of a service account used to install Cloud Service Mesh. If notspecified, the active user account in the current
gcloudconfiguration isused. If you need to change the active user account, rungcloud auth login.
Options for Istio CA custom certificate
If you specified--ca citadel and you are using a custom CA, include thefollowing options:
--ca_certFILE_PATH: The intermediate certificate--ca_keyFILE_PATH: The key for the intermediate certificate--root_certFILE_PATH: The root certificate--cert_chainFILE_PATH: The certificate chain
For more information, seePlugging in existing CA Certificates.
Enablement flags
The flags that start with--enable letasmcli enable the required GoogleAPIs, setrequired Identity and Access Management (IAM) permissions,and update your cluster. If you prefer, you canupdate your project and cluster yourselfbefore runningasmcli. All of the enablement flags are incompatible withasmcli validate. If you specify an enablement flag when you runasmcli validate, the command terminates with an error.
-e|--enable_all- Allow
asmclito perform all of the individual enable actions describedbelow. --enable_cluster_roles- Allow
asmclito attempt to bind the Google Cloud user or serviceaccount runningasmclito thecluster-adminrole on your cluster.asmclidetermines the user account from thegcloud config get core/accountcommand. If you are runningasmclilocally with a user account, make surethat you call thegcloud auth logincommand before runningasmcli. If you need to change the user account,run thegcloud config set core/accountGCP_EMAIL_ADDRESScommand whereGCP_EMAIL_ADDRESS is the account that you useto log in to Google Cloud. --enable_cluster_labels- Allow
asmclito set requiredcluster labels. --enable_gcp_componentsAllow
asmclito enable the following required Google Cloud managedservices and components:Workload Identity,which lets GKE applications safely access Google Cloudservices.
--enable_gcp_apisAllow
asmclito enable allrequired Google APIs.--enable_gcp_iam_rolesAllow
asmclito set the requiredIAM permissions.--enable_meshconfig_initAllow the script to initialize the meshconfig endpoint on your behalf. Impliedby
--enable_gcp_componentsand--managed.--enable_namespace_creationAllow
asmclito create the rootistio-systemnamespace.--enable_registrationAllow
asmclito register the cluster to the project that the cluster isin. If you don't include this flag, follow the steps inRegistering a clusterto manually register the cluster. Note that unlike the other enablement flags,--enable_registrationis only included in--enable_allwhen you specifyan option (such as--option hub-meshca) that requires cluster registration.Otherwise, you need to specify this flag separately.
Other flags
--dry_run- Print commands, but don't execute them.
--fleet_id- Register a cluster to a fleet using the fleet's host project ID. This flag isrequired for non-Google Cloud clusters. When not provided forGoogle Cloud clusters, it defaults to the cluster's project ID. You canrun
asmcli installalong with--fleet_idprior to the installation, or aspart of the installation by passing the--enable-registrationand--fleet-idflags. This setting cannot be changed after it is configured. --managed- Deprecated. Provision a remote, managed control plane instead of installingone in-cluster.
--offline- Perform anoffline installationusing the pre-downloaded package in the output directory. If the directory isnot specified or does not contain the required files, the script will exitwith error.
--only_enable- Perform the specified steps to set up the current user/cluster but doesn'tinstall anything.
--only_validate- Run validation but don't update the project or cluster and don't installCloud Service Mesh. This flag is incompatible with theenablement flags.
asmcliterminates with anerror if you specify--only_validatewith any enablement flag. --print_config- Instead of installing Cloud Service Mesh, print all of the compiled YAML tostandard output (stdout). All other output is written to standard error(stderr), even if it would normally go to stdout.
asmcliskips allvalidations and setup when you specify this flag. --disable_canonical_service- By default,
asmclideploys theCanonical Service controller to your cluster. If you don't wantasmclito deploy the controller,specify--disable_canonical_service. For more information, refer toEnabling and disabling the Canonical Service controller. -h|--help- Show a help message describing the options and flags and exit.
--use_managed_cni- Use the managed CNI. If this flag isnot passed,
asmcliwill apply the static CNI manifests. --use_vpcsc- If your organization enforcesVPC Service Controls for your project, you mustconfigure managed Cloud Service Mesh with the
--use_vpcscflag. Otherwise theinstallation will fail security controls. -v|--verbose- As
asmcliruns, it prints the command that it will run next. With the--verboseflag,asmcliprints the command after execution as well. --version- Print the version of
asmcliand exit. If you don't have the most recentversion, you candownloadthe most recent version ofasmcli_1.24.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-19 UTC.