# 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).

This page describes the prerequisites and the requirements for installing
in-cluster Cloud Service Mesh for Kubernetes workloads off Google Cloud, such
as 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.

## 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 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

- Ensure that the user cluster that you install Cloud Service Mesh on has at
  least 4 vCPUs, 15 GB memory, and 4 nodes.

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

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

- If you are deploying sidecars in application pods where direct connectivity
  to CA services (such as `meshca.googleapis.com` and
  `privateca.googleapis.com`) is not available, you must
  [configure an explicit `CONNECT`-based HTTPS proxy](https://docs.cloud.google.com/service-mesh/docs/unified-install/options/configure-ca-through-proxy).

- For public clusters with egress firewall rules set that are blocking
  [implied rules](https://docs.cloud.google.com/vpc/docs/firewalls#default_firewall_rules), ensure you have
  configured HTTP/HTTPS and DNS rules to reach public Google APIs.

## Fleet requirements

All clusters must be registered to a
[fleet](https://docs.cloud.google.com/kubernetes-engine/docs/fleets-overview.md.txt), and
[fleet workload identity](https://docs.cloud.google.com/kubernetes-engine/fleet-management/docs/use-workload-identity.md.txt)
must be enabled. You can either
[setup up the clusters](https://docs.cloud.google.com/kubernetes-engine/fleet-management/docs/use-workload-identity.md.txt#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 clusters outside Google Cloud** : *(applies to in-cluster Cloud Service Mesh)* [Google Distributed Cloud (software only) for VMware](https://docs.cloud.google.com/anthos/clusters/docs/on-prem), [Google Distributed Cloud (software only) for bare metal](https://docs.cloud.google.com/kubernetes-engine/distributed-cloud/bare-metal/docs.md.txt), [GKE on AWS](https://docs.cloud.google.com/anthos/clusters/docs/aws) (deprecated), and [GKE on Azure](https://docs.cloud.google.com/anthos/clusters/docs/multi-cloud/azure) (deprecated) are automatically registered to your project fleet at cluster creation time. As of GKE Enterprise 1.8, all these cluster types automatically enable fleet Workload Identity when registered. Existing registered clusters are updated to use fleet Workload Identity when they are upgraded to GKE Enterprise 1.8.
- **Amazon EKS clusters** (deprecated): *(applies to in-cluster Cloud Service Mesh)* The cluster must have a public IAM OIDC Identity Provider. Follow the instructions in [Create an IAM OIDC provider for your cluster](https://docs.aws.amazon.com/eks/latest/userguide/enable-iam-roles-for-service-accounts.html) to check if a provider exists, and create a provider if necessary.

When you run `asmcli install`, you specify the project ID
of the
[fleet host project](https://docs.cloud.google.com/kubernetes-engine/fleet-management/docs/fleet-concepts.md.txt#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).

Starting with `asmcli` version 1.25, all in-cluster Cloud Service Mesh
installations and upgrades provision the Managed Canonical Service Controller.
This requires the Cloud Service Mesh feature to be enabled on your fleet
project. To allow `asmcli` to enable this feature automatically during
installation or upgrade, you must run the `asmcli` command with the
`--enable_gcp_components` flag.

## What's next?

- [Plan a new installation](https://docs.cloud.google.com/service-mesh/docs/onboarding/kubernetes-off-gcp/install/plan-install.md.txt)
- [Plan an upgrade](https://docs.cloud.google.com/service-mesh/docs/upgrade/plan-upgrade.md.txt)