Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Hybrid-Mesh einrichten
Auf dieser Seite wird erläutert, wie Sie ein Hybrid-Mesh für die folgenden Plattformen einrichten:
Hybrid: GKE auf Google Cloud und Google Distributed Cloud (nur Software) für VMware
Hybrid: GKE auf Google Cloud und Google Distributed Cloud (nur Software) für Bare Metal
Mit dieser Anleitung richten Sie zwei Cluster ein. Sie können diesen Prozess jedoch erweitern, um eine beliebige Anzahl von Clustern in Ihr Mesh-Netzwerk einzubinden.
Alle GKE-Cluster müssen sich in einer freigegebenen VPC-Konfiguration im selben Netzwerk befinden.
Die Adresse des Kubernetes-Steuerungsebenen und die Gateway-Adresse des Clusters müssen von jedem Cluster im Mesh-Netzwerk aus erreichbar sein. Das Google Cloud -Projekt, in dem sich GKE-Cluster befinden, sollte externe Load-Balancing-Typen erstellen dürfen.
Wir empfehlen, autorisierte Netzwerke und VPC-Firewallregeln zu verwenden, um den Zugriff einzuschränken.
Private Cluster, einschließlich privater GKE-Cluster, werden nicht unterstützt. Wenn Sie lokale Cluster einschließlich Google Distributed Cloud (nur Software) für VMware und Google Distributed Cloud (nur Software) für Bare-Metal verwenden, müssen die Adresse der Kubernetes-Steuerungsebene und die Gateway-Adresse über Pods in GKE-Clustern erreichbar sein. Wir empfehlen die Verwendung von CloudVPN, um das Subnetz des GKE-Clusters mit dem Netzwerk des lokalen Clusters zu verbinden.
Wenn Sie die Istio-Zertifizierungsstelle nutzen, verwenden Sie für alle Cluster dasselbe benutzerdefinierte Root-Zertifikat.
Hinweise
Sie benötigen Zugriff auf die kubeconfig-Dateien für alle Cluster, die Sie im Mesh-Netzwerk einrichten. Zum Erstellen einer neuen kubeconfig-Datei für den Cluster können Sie im GKE-Cluster KUBECONFIG-Umgebung mit dem vollständigen Dateipfad als Wert in Ihrem Terminal exportieren und den kubeconfig-Eintrag generieren.
Umgebungsvariablen und Platzhalter einrichten
Sie benötigen die folgenden Umgebungsvariablen, wenn Sie das east-west-Gateway installieren.
Erstellen Sie eine Umgebungsvariable für die Projektnummer. Ersetzen Sie im folgenden Befehl FLEET_PROJECT_ID durch die Projekt-ID des Flottenhostprojekts.
Wenn Sie Cloud Service Mesh auf anderen Clustern mit unterschiedlichen Werten für --network_id installiert haben, sollten Sie dieselben Werte an den Wert NETWORK_2 übergeben.
east-west-Gateway installieren
Installieren Sie ein Gateway in CLUSTER_1 (Ihr GKE-Cluster), das Ost-West-Traffic an CLUSTER_2 (Ihren lokalen Cluster) ermöglicht:
Beachten Sie, dass dieses Gateway standardmäßig öffentlich im Internet öffentlich ist. Für Produktionssysteme sind möglicherweise zusätzliche Zugriffseinschränkungen erforderlich, z. B. Firewallregeln, um externe Angriffe zu verhindern.
Installieren Sie in CLUSTER_2 ein Gateway für east-west-Traffic für CLUSTER_1.
Da sich die Cluster in separaten Netzwerken befinden, müssen Sie alle Dienste (\*.local) auf dem east-west-Gateway in beiden Clustern verfügbar machen. Während dieses Gateway öffentlich im Internet verfügbar ist, können Dienste nur mit Diensten mit einem vertrauenswürdigen mTLS-Zertifikat und einer Arbeitslast-ID aufgerufen werden, genauso wie sie sich im selben Netzwerk befinden.
Dienste über das east-west-Gateway für jeden Cluster freigeben
Führen Sie den Befehl asmcli create-mesh aus, um die Endpunkterkennung zu aktivieren. In diesem Beispiel werden nur zwei Cluster gezeigt. Sie können aber den Befehl ausführen, um die Endpunkterkennung für zusätzliche Cluster zu aktivieren, wobei das GKE Hub-Dienstlimit gilt.
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-02 (UTC)."],[],[],null,["Set up a hybrid mesh\n| **Preview\n| --- Hybrid and mesh**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n| **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](/service-mesh/docs/overview).\n\nThis page explains how to set up a hybrid mesh for the\nfollowing platforms:\n\n- Hybrid: GKE on Google Cloud and Google Distributed Cloud (software only) for VMware\n- Hybrid: GKE on Google Cloud and Google Distributed Cloud (software only) for bare metal\n\nBy following these instructions you set up two clusters, but you can extend this\nprocess to incorporate any number of clusters into your mesh.\n\nPrerequisites\n\n- All clusters must be registered to the same [fleet host project](/anthos/multicluster-management/fleets#fleet-host-project).\n- All GKE clusters must be in a [shared VPC](/vpc/docs/shared-vpc) configuration on the same network.\n- The cluster's Kubernetes control plane address and the gateway address need to be reachable from every cluster in the mesh. The Google Cloud project in which GKE clusters are located should be allowed to create [external load balancing types](/load-balancing/docs/org-policy-constraints). We recommend that you use [authorized networks](/kubernetes-engine/docs/how-to/authorized-networks) and [VPC firewall rules](/vpc/docs/using-firewalls) to restrict the access.\n- Private clusters, including GKE private clusters, are not supported. If you use On-Premises clusters including Google Distributed Cloud (software only) for VMware and Google Distributed Cloud (software only) for bare metal, the Kubernetes control plane address and the gateway address need to be reachable from pods in GKE clusters. We recommend that you use [CloudVPN](/network-connectivity/docs/vpn/concepts/overview) to connect the GKE cluster's subnet with the On-Premises cluster's network.\n- If you use Istio CA, use the same custom root certificate for all clusters.\n\nBefore you begin\n\nYou need access to the kubeconfig files for all the clusters that you are\nsetting up in the mesh. For the GKE cluster, in order to create a\nnew kubeconfig file for the cluster, you can export `KUBECONFIG` env with the\ncomplete path of file as value in your terminal and generate the kubeconfig\nentry.\n| **Warning:** Only use kubeconfig files from trusted sources. Using a specially-crafted kubeconfig file could result in malicious code execution or file exposure. If you must use an untrusted kubeconfig file, inspect it carefully first, much as you would a shell script.\n\nSet up environment variables and placeholders\n\nYou need the following environment variables when you install the\neast-west gateway.\n\n1. Create an environment variable for the project number. In the following\n command, replace \u003cvar translate=\"no\"\u003eFLEET_PROJECT_ID\u003c/var\u003e with the project ID of the\n [fleet host project](/anthos/multicluster-management/fleets#fleet-host-project).\n\n export PROJECT_NUMBER=$(gcloud projects describe \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eFLEET_PROJECT_ID\u003c/span\u003e\u003c/var\u003e --format=\"value(projectNumber)\")\n\n2. Create an environment variable for the mesh identifier.\n\n export MESH_ID=\"proj-${PROJECT_NUMBER}\"\n\n3. Create environment variables for the network names.\n\n - GKE clusters default to the cluster network name:\n\n export NETWORK_1=\"PROJECT_ID-CLUSTER_NETWORK\"\n - Other clusters use `default`:\n\n export NETWORK_2=\"default\"\n\n Note that If you installed Cloud Service Mesh on other clusters\n with different values for `--network_id`, then you should pass the same\n values to value to NETWORK_2.\n\nInstall the east-west gateway\n\n1. Install a gateway in CLUSTER_1 (your GKE cluster) that is\n dedicated to [east-west](https://en.wikipedia.org/wiki/East-west_traffic)\n traffic to CLUSTER_2 (your on-premise cluster):\n\n asm/istio/expansion/gen-eastwest-gateway.sh \\\n --mesh ${MESH_ID} \\\n --network ${NETWORK_1} \\\n --revision asm-1264-1 | \\\n ./istioctl --kubeconfig=\u003cvar translate=\"no\"\u003ePATH_TO_KUBECONFIG_1\u003c/var\u003e install -y -f -\n\n Note that this gateway is public on the Internet by default. Production\n systems might require additional access restrictions, for example firewall\n rules, to prevent external attacks.\n2. Install a gateway in CLUSTER_2 that is dedicated to east-west traffic for\n CLUSTER_1.\n\n asm/istio/expansion/gen-eastwest-gateway.sh \\\n --mesh ${MESH_ID} \\\n --network ${NETWORK_2} \\\n --revision asm-1264-1 | \\\n ./istioctl --kubeconfig=\u003cvar translate=\"no\"\u003ePATH_TO_KUBECONFIG_2\u003c/var\u003e install -y -f -\n\nExpose services\n\nSince the clusters are on separate networks, you need to expose all services\n(`\\*.local`) on the east-west gateway in both clusters. While this gateway is\npublic on the internet, services behind it can only be accessed by services with\na trusted mTLS certificate and workload ID, just as if they were on the same\nnetwork.\n\nExpose services via the east-west gateway for every cluster \n\n kubectl --kubeconfig=\u003cvar translate=\"no\"\u003ePATH_TO_KUBECONFIG_1\u003c/var\u003e apply -n istio-system -f \\\n asm/istio/expansion/expose-services.yaml\n kubectl --kubeconfig=\u003cvar translate=\"no\"\u003ePATH_TO_KUBECONFIG_2\u003c/var\u003e apply -n istio-system -f \\\n asm/istio/expansion/expose-services.yaml\n\nEnable endpoint discovery **Note:** For more information on endpoint discovery, refer to [Endpoint discovery with multiple control planes](https://istio.io/v1.26/docs/ops/deployment/deployment-models/#endpoint-discovery-with-multiple-control-planes).\n\nRun the `asmcli create-mesh` command to enable endpoint discovery. This\nexample only shows two clusters, but you can run the command to enable\nendpoint discovery on additional clusters, subject to the\n[GKE Hub service limit](/anthos/fleet-management/docs/quotas). \n\n ./asmcli create-mesh \\\n \u003cvar label=\"fleetid\" translate=\"no\"\u003eFLEET_PROJECT_ID\u003c/var\u003e \\\n \u003cvar label=\"kubeconfig1\" translate=\"no\"\u003ePATH_TO_KUBECONFIG_1\u003c/var\u003e \\\n \u003cvar label=\"kubeconfig2\" translate=\"no\"\u003ePATH_TO_KUBECONFIG_2\u003c/var\u003e\n\nVerify multi-cluster connectivity\n\nSee [Injecting sidecar proxies](/service-mesh/docs/onboarding/kubernetes-workloads#inject_sidecar_proxies)."]]