When you install Anthos Service Mesh, the features that are
enabled by default differ by platform. You
enable optional features by including an overlay file when you install
(or upgrade) Anthos Service Mesh. An overlay file is a YAML file containing an
IstioOperator custom resource (CR)
that you use to configure the control plane. You can override the default
configuration and enable an optional feature or disable a default
feature in an overlay file. Specify one feature per overlay file. You can
layer on more overlays, and each overlay file overrides the configuration on the
About the overlay files
The overlay files on this page are in the
package in GitHub. These files contain common customizations to the default
configuration. You can use these files as they are, or you can make additional
changes to them as needed.
When you install Anthos Service Mesh using the Google-provided
asmcli script, you
can specify one or more overlay files with the
--option or the
--custom_overlay options. If you don't need to make any changes to the
files in the
anthos-service-mesh repository, you can use
the script fetches the file from GitHub for you. Otherwise, you can make
changes to the overlay file, and then use the
--custom_overlay option to
pass it to the
|Don't include multiple CRs in one overlay file||Create separate overlay files for each CR|
To download the
The following steps use
kpt to download the
asm package from the
GitHub repository. If you prefer, you can use
git clone instead.
kptif you haven't already:
gcloud components install kpt
Download the package that contains the files:
kpt pkg get \ https://github.com/GoogleCloudPlatformemail@example.com asm
The following examples assume that the
asmpackage is in your current working directory.
How to enable optional features
The following examples are simplified to show only using the custom overlays to
enable optional features. Replace
OTHER_FLAGS with the
other command line options .
asmcli install command provides two ways to enable an optional feature. The
method that you use depends on whether you need to make changes to the overlay
--optionwhen you don't need to make any changes to the overlay file. With
asmclifetches the file from the GitHub repository for you, so you must have an internet connection.
./asmcli install \ OTHER_FLAGS \ --option OPTION_NAME
OPTION_NAMEwith the option you want to enable. For a list of options refer to the
--custom_overlaywhen you need to customize the overlay file.
./asmcli install \ OTHER_FLAGS \ --custom_overlay PATH_TO_FILE
PATH_TO_FILEwith the path to the overlay file you want to use.
YAML for optional features
The following sections provide the YAML to enable optional and supported features.
global.mtls.enabled configuration was removed from the
CR to avoid issues with upgrades and to provide a more flexible installation.
peer authentication policy instead.
Direct Envoy to stdout
--- apiVersion: install.istio.io/v1alpha1 kind: IstioOperator spec: meshConfig: accessLogFile: "/dev/stdout"
For more information, see Enable Envoy's access logging.
Cloud Trace is available with Anthos Service Mesh installations on the following platforms:
- GKE on Google Cloud
- Anthos clusters on-premises if you install with Anthos Service Mesh certificate authority (Mesh CA)
For detailed pricing information, refer to the Cloud Trace pricing page.
--- apiVersion: install.istio.io/v1alpha1 kind: IstioOperator spec: meshConfig: enableTracing: true values: global: proxy: tracer: stackdriver
The default sampling rate is 1%, but you can override the default by specifying
tracing.sampling value. The value must be in the range of 0.0 to 100.0 with a
precision of 0.01. For example, to trace 5 requests out of every 10,000, use
The following example shows a sampling rate of 100% (which you would only do for demo or troubleshooting purposes).
apiVersion: install.istio.io/v1alpha1 kind: IstioOperator spec: meshConfig: enableTracing: true defaultConfig: tracing: sampling: 100 values: global: proxy: tracer: stackdriver
Note that currently tracer configuration is part of proxy bootstrap configuration, so pod needs to restart and get re-injected to pick up the tracer update. For example, you can use the following command the restart pods belong to a deployment:
kubectl rollout restart deployment -n NAMESPACE DEPLOYMENT_NAME
Trace context propagation
Although the sidecar proxies can automatically send trace spans, they need some hints to tie together the entire trace. Applications need to propagate the appropriate HTTP headers so that when the proxies send span information, the spans can be correlated correctly into a single trace.
To do this, an application needs to collect and propagate the following headers from the incoming request to any outgoing requests:
For examples propagating the headers, see Trace context propagation.
Create a trace from client with custom ID
To create a trace from a client with a custom ID, use the
curl command to
create a request with an external client and force it to show a trace. For example:
curl $URL --header "x-client-trace-id: 105445aa7843bc8bf206b12000100000"
For more information about
x-client-trace-id, refer to the
Egress via egress gateways
Istio Container Network Interface
How you enable the Istio Container Network Interface (CNI) depends on the environment that Anthos Service Mesh is installed on.
Choose the overlay file that matches your platform.
Enable CNI on GKE
--- apiVersion: install.istio.io/v1alpha1 kind: IstioOperator spec: components: cni: enabled: true namespace: kube-system values: cni: cniBinDir: /home/kubernetes/bin excludeNamespaces: - istio-system - kube-system
Enable CNI on-premises
--- apiVersion: install.istio.io/v1alpha1 kind: IstioOperator spec: components: cni: enabled: true namespace: kube-system values: cni: cniBinDir: /opt/cni/bin excludeNamespaces: - istio-system - kube-system - gke-system
Enable an internal load balancer
We recommend that you install an
injected gateway as described in
Install and upgrade gateways to set up an internal
load balancer on GKE. When configuring the gateway Service,
you include the annotation:
External certificate management on the ingress gateway
For information on enabling external certificate management on the ingress gateway using Envoy SDS, see Secure Gateways.