This guide explains how to do a clean installation of Anthos Service Mesh version 1.5.10-asm.2 on GKE on VMware. If you have a previous version of Anthos Service Mesh installed, refer to Upgrading Anthos Service Mesh on GKE on VMware.
The installation enables the supported features on GKE on VMware.
About the control plane components
GKE on VMware comes with the following Istio components preinstalled:
- Citadel is installed in the
kube-system
namespace. - Pilot and the Istio Ingress Gateway are installed in the
gke-system
namespace.
GKE on VMware uses these components to enable ingress and to secure communication between Google-controlled components. If you only need ingress functionality, you don't need to install OSS Istio or Anthos Service Mesh. For more information on configuring ingress, see Enabling ingress.
When you install Anthos Service Mesh, its components are installed in the
istio-system
namespace. Because the Anthos Service Mesh components are in a
different namespace, they don't conflict with the GKE on VMware
preinstalled Istio components.
Before you begin
Review the following requirements and restrictions before beginning the setup.
Requirements
You must have an GKE Enterprise trial license or subscription. See the GKE Enterprise Pricing guide for details.
Make sure the user cluster that you install Anthos Service Mesh on has at least 4 vCPUs, 15 GB memory, and 4 replicas.
To be included in the service mesh, service ports must be named, and the name must include the port's protocol in the following syntax:
name: protocol[-suffix]
where the square brackets indicate an optional suffix that must start with a dash. For more information, see Naming service ports.Make sure your cluster version is listed in Supported environments. To check your cluster version, you can use the
gkectl
command line tool.gkectl version
Output like the following is displayed:
1.2.0-gke.6 (git-0912663b0)
If you don't have
gkectl
installed, see GKE on-prem downloads.
Restrictions
Only one installation of Anthos Service Mesh per Google Cloud project is supported. Multiple mesh deployments in a single project aren't supported.
Setting up your environment
On your local machine, install and initialize the Google Cloud CLI.
If you already have the gcloud CLI installed:
Authenticate with the gcloud CLI:
gcloud auth login
Update the components:
gcloud components update
Install
kubectl
:gcloud components install kubectl
Get the project ID of the project that the cluster was created in:
gcloud
gcloud projects list
Console
In the Google Cloud console, go to the Dashboard page:
Click the Select from drop-down list at the top of the page. In the Select from window that appears, select your project. The project ID is displayed on the project Dashboard Project info card.
Set the default project ID for the Google Cloud CLI:
gcloud config set project PROJECT_ID
Setting credentials and permissions
-
Ensure that you have
kubectl
for the GKE on VMware user cluster where you want to install Anthos Service Mesh. Note that you can install Anthos Service Mesh only on a user cluster, not an admin cluster. -
Grant cluster admin permissions to the current user. You need these
permissions to create the necessary
role based access
control (RBAC) rules for Anthos Service Mesh:
kubectl create clusterrolebinding cluster-admin-binding \ --clusterrole=cluster-admin \ --user="$(gcloud config get-value core/account)"
If you see the
"cluster-admin-binding" already exists
error, you can safely ignore it and continue with the existing cluster-admin-binding.
Preparing to install Anthos Service Mesh
-
Download the Anthos Service Mesh installation file to your current working
directory:
curl -LO https://storage.googleapis.com/gke-release/asm/istio-1.5.10-asm.2-linux.tar.gz
-
Download the signature file and use
openssl
to verify the signature:curl -LO https://storage.googleapis.com/gke-release/asm/istio-1.5.10-asm.2-linux.tar.gz.1.sig openssl dgst -verify - -signature istio-1.5.10-asm.2-linux.tar.gz.1.sig istio-1.5.10-asm.2-linux.tar.gz <<'EOF' -----BEGIN PUBLIC KEY----- MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWZrGCUaJJr1H8a36sG4UUoXvlXvZ wQfk16sxprI2gOJ2vFFggdq3ixF2h4qNBt0kI7ciDhgpwS8t+/960IsIgw== -----END PUBLIC KEY----- EOF
The expected output is:
Verified OK
-
Extract the contents of the file to any location on your file system. For
example, to extract the contents to the current working directory:
tar xzf istio-1.5.10-asm.2-linux.tar.gz
The command creates an installation directory in your current working directory named
istio-1.5.10-asm.2
that contains:- Sample applications in
samples
- The following tools in the
bin
directory:istioctl
: You useistioctl
to install Anthos Service Mesh.asmctl
: You useasmctl
to help validate your security configuration after installing Anthos Service Mesh. (Currently,asmctl
isn't supported on GKE on VMware.)
- Sample applications in
-
Download the Anthos Service Mesh installation file to your current working
directory:
curl -LO https://storage.googleapis.com/gke-release/asm/istio-1.5.10-asm.2-osx.tar.gz
-
Download the signature file and use
openssl
to verify the signature:curl -LO https://storage.googleapis.com/gke-release/asm/istio-1.5.10-asm.2-osx.tar.gz.1.sig openssl dgst -sha256 -verify /dev/stdin -signature istio-1.5.10-asm.2-osx.tar.gz.1.sig istio-1.5.10-asm.2-osx.tar.gz <<'EOF' -----BEGIN PUBLIC KEY----- MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWZrGCUaJJr1H8a36sG4UUoXvlXvZ wQfk16sxprI2gOJ2vFFggdq3ixF2h4qNBt0kI7ciDhgpwS8t+/960IsIgw== -----END PUBLIC KEY----- EOF
The expected output is:
Verified OK
-
Extract the contents of the file to any location on your file system. For
example, to extract the contents to the current working directory:
tar xzf istio-1.5.10-asm.2-osx.tar.gz
The command creates an installation directory in your current working directory named
istio-1.5.10-asm.2
that contains:- Sample applications in
samples
- The following tools in the
bin
directory:istioctl
: You useistioctl
to install Anthos Service Mesh.asmctl
: You useasmctl
to help validate your security configuration after installing Anthos Service Mesh. (Currently,asmctl
isn't supported on GKE on VMware.)
- Sample applications in
-
Download the Anthos Service Mesh installation file to your current working
directory:
curl -LO https://storage.googleapis.com/gke-release/asm/istio-1.5.10-asm.2-win.zip
-
Download the signature file and use
openssl
to verify the signature:curl -LO https://storage.googleapis.com/gke-release/asm/istio-1.5.10-asm.2-win.zip.1.sig openssl dgst -verify - -signature istio-1.5.10-asm.2-win.zip.1.sig istio-1.5.10-asm.2-win.zip <<'EOF' -----BEGIN PUBLIC KEY----- MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWZrGCUaJJr1H8a36sG4UUoXvlXvZ wQfk16sxprI2gOJ2vFFggdq3ixF2h4qNBt0kI7ciDhgpwS8t+/960IsIgw== -----END PUBLIC KEY----- EOF
The expected output is:
Verified OK
-
Extract the contents of the file to any location on your file system. For
example, to extract the contents to the current working directory:
tar xzf istio-1.5.10-asm.2-win.zip
The command creates an installation directory in your current working directory named
istio-1.5.10-asm.2
that contains:- Sample applications in
samples
- The following tools in the
bin
directory:istioctl
: You useistioctl
to install Anthos Service Mesh.asmctl
: You useasmctl
to help validate your security configuration after installing Anthos Service Mesh. (Currently,asmctl
isn't supported on GKE on VMware.)
- Sample applications in
-
Ensure that you're in the Anthos Service Mesh installation's root directory.
cd istio-1.5.10-asm.2
-
For convenience, add the tools in the
/bin
directory to your PATH:export PATH=$PWD/bin:$PATH
Linux
Mac OS
Windows
Create the istio-system
namespace
Create a namespace called istio-system for the control plane components:
kubectl create namespace istio-system
Installing Anthos Service Mesh
This section explains how to install Anthos Service Mesh and enable the Supported default features listed on the Supported features page. For information on enabling the Supported optional features, see Enabling optional features.
To install Anthos Service Mesh:
Choose one of the following commands to configure Anthos Service Mesh in
PERMISSIVE
mutual TLS (mTLS)
authentication mode or STRICT
mTLS mode.
PERMISSIVE mTLS
istioctl manifest apply --set profile=asm-onprem
STRICT mTLS
istioctl manifest apply --set profile=asm-onprem \ --set values.global.mtls.enabled=true
Check the control plane components
Check that the control plane pods in istio-system
are up:
kubectl get pod -n istio-system
Expected output is similar to the following:
NAME READY STATUS RESTARTS AGE istio-ingressgateway-74cc894bfd-786rg 1/1 Running 0 7m19s istiod-78cdbbbdb-d7tps 1/1 Running 0 7m36s promsd-576b8db4d6-lqf64 2/2 Running 1 7m19s
Injecting sidecar proxies
Anthos Service Mesh uses sidecar proxies to enhance network security, reliability, and observability. With Anthos Service Mesh, these functions are abstracted away from the application's primary container and implemented in a common out-of-process proxy delivered as a separate container in the same Pod.
Any workloads that were running on your cluster before you installed Anthos Service Mesh need to have the sidecar proxy injected or updated so they have the current Anthos Service Mesh version. Before you deploy new workloads, make sure to configure sidecar proxy injection so that Anthos Service Mesh can monitor and secure traffic.You can enable automatic sidecar injection with one command, for example:
kubectl label namespace NAMESPACE istio-injection=enabled --overwrite
where NAMESPACE
is the name of the
namespace
for your application's services or default
if you didn't explicitly create
a namespace.
For more information, see Injecting sidecar proxies.
Configuring an external IP address
The default Anthos Service Mesh installation assumes that an external IP address is
automatically allocated for LoadBalancer
services. This is not true in
GKE on VMware. Because of this, you need to allocate an IP
address manually for the Anthos Service Mesh ingress Gateway resource.
To configure an external IP address, follow one of the sections below, depending on your cluster's load balancing mode:
Integrated load balancing mode
Open the
istio-ingressgateway
Service's configuration:kubectl edit svc -n istio-system istio-ingressgateway
The configuration for the
istio-ingressgateway
Service opens in your shell's default text editor.In the file, add the following line under the specification (
spec
) block:loadBalancerIP: <your static external IP address>
For example:
spec: loadBalancerIP: 203.0.113.1
Save the file.
Manual load balancing mode
To expose a service of type NodePort with a VIP on your selected load balancer, you
need to find out the nodePort
values first:
View the
istio-ingressgateway
Service's configuration in your shell:kubectl get svc -n istio-system istio-ingressgateway -o yaml
Each of the ports for Anthos Service Mesh's gateways are displayed. The command output is similar to the following:
... ports: - name: status-port nodePort: 30391 port: 15020 protocol: TCP targetPort: 15020 - name: http2 nodePort: 31380 port: 80 protocol: TCP targetPort: 80 - name: https nodePort: 31390 port: 443 protocol: TCP targetPort: 443 - name: tcp nodePort: 31400 port: 31400 protocol: TCP targetPort: 31400 - name: https-kiali nodePort: 31073 port: 15029 protocol: TCP targetPort: 15029 - name: https-prometheus nodePort: 30253 port: 15030 protocol: TCP targetPort: 15030 - name: https-grafana nodePort: 30050 port: 15031 protocol: TCP targetPort: 15031 - name: https-tracing nodePort: 31204 port: 15032 protocol: TCP targetPort: 15032 - name: tls nodePort: 30158 port: 15443 protocol: TCP targetPort: 15443 ...
Expose these ports through your load balancer.
For example, the service port named
http2
hasport
80 andnodePort
31380. Suppose the node addresses for your user cluster are192.168.0.10
,192.168.0.11
, and192.168.0.12
, and your load balancer's VIP is203.0.113.1
.Configure your load balancer so that traffic sent to
203.0.113.1:80
is forwarded to192.168.0.10:31380
,192.168.0.11:31380
, or192.168.0.12:31380
. You can select the service ports that you want to expose on this given VIP.