# In-cluster Cloud Service Mesh prerequisites

> [!NOTE]
> **Note:** This guide only supports Cloud Service Mesh with Istio APIs and does not support Google Cloud APIs. For more information see, [Cloud Service Mesh overview](https://docs.cloud.google.com/service-mesh/docs/overview.md.txt).

> [!CAUTION]
> **Caution:** In-cluster Cloud Service Mesh using the `ISTIOD` control plane on GKE on Google Cloud is [deprecated](https://docs.cloud.google.com/service-mesh/deprecations.md.txt). Cloud Service Mesh with an in-cluster control plane on Google Distributed Cloud (software only) continues to be supported as described in [Supported platforms](https://docs.cloud.google.com/service-mesh/docs/supported-platforms.md.txt#off-gcp).

This page describes the prerequisites and the requirements for installing
in-cluster Cloud Service Mesh on GKE, such
as GKE Enterprise licensing, cluster requirements, fleet requirements, and
general requirements.

## Cloud project

Before you begin:

- [Select or create a Google Cloud project](https://console.cloud.google.com/projectselector2).

- [Verify that billing is enabled](https://cloud.google.com/billing/docs/how-to/modify-project) for your project.

## GKE Enterprise licensing

Cloud Service Mesh is available with GKE Enterprise or as a standalone service.
Google APIs are used to determine how you are billed. To use Cloud Service Mesh as
a standalone service, don't enable the GKE Enterprise API in your project.
The `asmcli` enables all of the other required Google APIs for you. For
information about Cloud Service Mesh pricing, see [Pricing](https://cloud.google.com/service-mesh/pricing).

- GKE Enterprise subscribers, be sure to enable the GKE Enterprise API.

  [Enable the API](https://console.cloud.google.com/apis/enableflow?apiid=anthos.googleapis.com)
- If you aren't a GKE Enterprise subscriber, you can still install
  Cloud Service Mesh, but certain UI elements and features in Google Cloud console are
  only available to GKE Enterprise subscribers. For information about
  what is available to subscribers and non-subscribers, see
  [GKE Enterprise and Cloud Service Mesh UI differences](https://docs.cloud.google.com/service-mesh/docs/ui-differences.md.txt).

- If you enabled the GKE Enterprise API, but you want to use Cloud Service Mesh as
  a standalone service,
  [disable the GKE Enterprise API](https://docs.cloud.google.com/service-usage/docs/enable-disable.md.txt).

## General requirements

- 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](https://docs.cloud.google.com/service-mesh/docs/naming-service-ports).

- If you have created a [service perimeter](https://docs.cloud.google.com/vpc-service-controls/docs/service-perimeters.md.txt)
  in your organization, you might need to add the Cloud Service Mesh certificate authority service
  to the perimeter. See
  [Adding Cloud Service Mesh certificate authority to a service perimeter](https://docs.cloud.google.com/service-mesh/docs/operate-and-maintain/set-service-perimeter)
  for more information.

- If you want to change the default [resource limits](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits)
  for the `istio-proxy` sidecar container, the new values must be greater than the
  default values to
  [avoid out-of-memory (OOM) events](https://docs.cloud.google.com/service-mesh/docs/troubleshooting/troubleshoot-sidecar-proxies.md.txt).

-
  A Google Cloud project can only have one mesh associated with it.

## Cluster requirements

- Verify that your cluster version is listed in
  [Supported platforms](https://docs.cloud.google.com/service-mesh/docs/supported-platforms.md.txt).

- Your GKE cluster must meet the following requirements:

  - The GKE cluster must be Standard. Autopilot clusters are
    only supported with [managed Cloud Service Mesh](https://docs.cloud.google.com/service-mesh/docs/managed/provision-managed-anthos-service-mesh).

  - A machine type that has at least 4 vCPUs, such as `e2-standard-4`.
    If the machine type for your cluster doesn't have at
    least 4 vCPUs, change the machine type as described in
    [Migrating workloads to different machine types](https://docs.cloud.google.com/kubernetes-engine/docs/tutorials/migrating-node-pool).

  - The minimum number of nodes depends on your machine type. Cloud Service Mesh
    requires at least 8 vCPUs. If the machine type has 4 vCPUs, your
    cluster must have at least 2 nodes. If the machine type has 8 vCPUs,
    the cluster only needs 1 node. If you need to add nodes, see
    [Resizing a cluster](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/resizing-a-cluster.md.txt).

- GKE Workload Identity is required. We recommend that you
  enable [Workload Identity](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/workload-identity.md.txt)
  before installing Cloud Service Mesh. Enabling Workload Identity changes the way
  calls from your workloads to Google APIs are secured, as described in
  [Workload Identity limitations](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/workload-identity.md.txt#limitations).
  Note that you do not need to enable the
  [GKE Metadata Server](https://docs.cloud.google.com/kubernetes-engine/docs/concepts/workload-identity.md.txt#metadata_server)
  on [existing node pools](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/workload-identity.md.txt#migrate_applications_to).

- Optional but recommended, enroll the cluster in a
  [release channel](https://docs.cloud.google.com/kubernetes-engine/docs/concepts/release-channels.md.txt).

  We recommend that you enroll in the Regular release channel because other
  channels might be based on a GKE version that isn't supported
  with Cloud Service Mesh 1.31.3. For more information, see
  [Supported platforms](https://docs.cloud.google.com/service-mesh/docs/supported-platforms.md.txt).
  Follow the instructions in
  [Enrolling an existing cluster in a release channel](https://docs.cloud.google.com/kubernetes-engine/docs/concepts/release-channels.md.txt#enrolling_an_existing_cluster_in_a_release_channel)
  if you have a static GKE version.

- If you are installing Cloud Service Mesh on a private cluster, you must open port
  15017 in the firewall to get the webhooks used for
  [automatic sidecar injection](https://docs.cloud.google.com/service-mesh/docs/anthos-service-mesh-proxy-injection) and configuration
  validation to work. For more information, see
  [Opening a port on a private cluster](https://docs.cloud.google.com/service-mesh/docs/private-cluster-open-port).

- Ensure that the client machine that you install Cloud Service Mesh from has
  network connectivity to the API server.

- For Windows Server workloads, Cloud Service Mesh is not supported. If your
  cluster has both Linux and Windows Server node pools, you can still install
  Cloud Service Mesh and use it on your Linux workloads.

  - After provisioning Cloud Service Mesh, you must [contact support](https://docs.cloud.google.com/service-mesh/docs/getting-support.md.txt) before initiating [IP rotation](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/ip-rotation.md.txt) or [certificate credential rotation](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/credential-rotation.md.txt).

## Fleet requirements

All clusters must be registered to a
[fleet](https://docs.cloud.google.com/anthos/multicluster-management/fleets), and
[fleet workload identity](https://docs.cloud.google.com/anthos/multicluster-management/fleets/workload-identity)
must be enabled. You can either
[setup up the clusters](https://docs.cloud.google.com/anthos/multicluster-management/fleets/workload-identity#cluster_setup)
yourself, or you can let `asmcli` register the clusters as long as they
meet the following requirements:

> [!CAUTION]
> **Caution:** All Cloud Service Mesh clusters for one mesh must be registered to the same fleet at all times to use Cloud Service Mesh. Other clusters in the project of a Cloud Service Mesh cluster must not be registered to a different fleet.

- **GKE** : *(applies to in-cluster and managed Cloud Service Mesh)* [Enable GKE Workload Identity](https://docs.cloud.google.com/kubernetes-engine/docs/how-to/workload-identity.md.txt) on your Google Kubernetes Engine cluster, if it is not already enabled. Additionally, you must [register the cluster using fleet Workload Identity](https://docs.cloud.google.com/anthos/fleet-management/docs/fleet-creation).

When you run `asmcli install`, you specify the project ID
of the
[fleet host project](https://docs.cloud.google.com/anthos/multicluster-management/fleets#fleet-host-project).
`asmcli` registers the cluster if it isn't already registered.

> [!NOTE]
> **Note:** If you have not registered a cluster from a project to a fleet hosted in a different project before, there are extra steps required to configure fleet permissions. For detailed instructions, see [Grant permissions for registering a cluster into a different project](https://docs.cloud.google.com/anthos/fleet-management/docs/before-you-begin#gke-cross-project).

## What's next?

- [Plan a new installation](https://docs.cloud.google.com/service-mesh/legacy/in-cluster/plan-install.md.txt)
- [Plan an upgrade](https://docs.cloud.google.com/service-mesh/docs/upgrade/plan-upgrade.md.txt)