Das in dieser Dokumentation beschriebene Produkt Anthos-Cluster in AWS (vorherige Generation) befindet sich jetzt im Wartungsmodus. Alle neuen Installationen müssen Anthos-Cluster in AWS der aktuellen Generation verwenden.
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
In diesem Thema erfahren Sie, wie Sie Cloud Service Mesh installieren, das in einem Ingress-Gateway vorinstalliert ist.
Mit Cloud Service Mesh können Sie eine Kubernetes-Ingress-Ressource für Ihre Deployments konfigurieren, wenn Sie einen Ingress-Controller benötigen.
Dieses Thema enthält ein Beispiel, das zeigt, wie Sie eine Beispiel-Deployment-Ressource und eine Beispiel-Ingress-Ressource konfigurieren.
Die Installation von Cloud Service Mesh besteht aus zwei Hauptteilen:
Labels mit Namespaces mit einem Überarbeitungslabel versehen und Ihre Arbeitslasten noch einmal bereitstellen, um einen Sidecar-Proxy einzufügen.
Wenn Sie nur ein Ingress-Objekt mit einem Ingress-Controller verwenden müssen, müssen Sie keinen Sidecar-Proxy in Ihre Arbeitslast-Pods einfügen. Wenn Sie jedoch die Sicherheitsvorteile von Cloud Service Mesh und die Möglichkeiten des Traffic-Routings nutzen wollen, müssen Sie die Sidecar-Proxys einbinden.
Hinweise
Bevor Sie GKE on AWS verwenden, müssen die folgenden Bedingungen erfüllt sein:
Wenn Ihre Nutzercluster den ausgehenden Zugriff auf das Internet beschränkt haben, lassen Sie den Zugriff auf die folgenden Container-Repository-Domains zu:
docker.io
quay.io
Verwenden Sie im anthos-aws-Verzeichnis anthos-gke, um den Kontext zu Ihrem Nutzercluster zu wechseln.
cd anthos-aws
env HTTPS_PROXY=http://localhost:8118 \
anthos-gke aws clusters get-credentials CLUSTER_NAME
Ersetzen Sie CLUSTER_NAME durch den Namen Ihres Nutzerclusters.
In diesem Abschnitt installieren Sie eine Beispielanwendung und erstellen einen Ingress-Endpunkt dafür.
Erstellen Sie ein Deployment von hello-app und eine ClusterIP für das Deployment.
Kopieren Sie das folgende YAML-Manifest in eine Datei mit dem Namen hello-app.yaml:
Erstellen Sie ein Kubernetes Ingress für die Beispielanwendung. Kopieren Sie das folgende YAML-Manifest in eine Datei mit dem Namen hello-app-ingress.yaml:
Das Feld ADDRESS sollte einen ELB-Domainnamen haben. Wenn ADDRESS weiterhin pending ist, prüfen Sie das VPC- und Subnetz-Labeling.
Sie können die Ingress-Gateway-URL prüfen, indem Sie den Host und den Port zusammenstellen.
Führen Sie die folgenden Befehle aus, um Ihre Gateway-URL abzurufen:
exportINGRESS_URL=$(envHTTPS_PROXY=http://localhost:8118\
kubectlgetingresshello-app-ojsonpath='{.status.loadBalancer.ingress[0].hostname}')echo"Your hello-app Ingress URL is: http://"$INGRESS_URL
Mit dem letzten Endpunkt wird der Endpunkt des Ingress ausgegeben.
Wenn Sie einen öffentlichen Ingress erstellt haben, können Sie die hello-app Standardwebseite in curl unter http://$INGRESS_URL/ aufrufen.
curl$INGRESS_URL/
Bereinigen
Sie entfernen die hello-app-Komponenten mit kubectl delete.
[[["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-04 (UTC)."],[],[],null,["This topic shows you how to install Cloud Service Mesh, which comes preinstalled\nwith an [Ingress Gateway](https://istio.io/latest/docs/tasks/traffic-management/ingress/ingress-control/).\nWith Cloud Service Mesh, you can configure a\n[Kubernetes Ingress resource](https://kubernetes.io/docs/concepts/services-networking/ingress/)\nfor your Deployments if you need an\n[Ingress controller](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/).\nThis topic provides an example that shows you how to configure a sample\nDeployment and Ingress resource.\n\nThe installation of Cloud Service Mesh consists of two main parts:\n\n1. Installing a specific version of the Cloud Service Mesh [customer-managed control plane](/service-mesh/docs/glossary#control_plane) and Ingress Gateway.\n2. Labeling your namespaces with a [revision label](/service-mesh/docs/revisions-overview) and redeploying your workloads to inject a [sidecar proxy](/service-mesh/docs/proxy-injection).\n\nIf you only need to use an Ingress object using an Ingress controller, you don't\nhave to inject a sidecar proxy into your workload Pods. But if you want the\n[security benefits](/service-mesh/docs/overview#security_benefits) that\nCloud Service Mesh provides, and if you want to make use of the\n[traffic routing](/service-mesh/docs/overview#traffic_management) capabilities,\nyou need to inject the sidecar proxies.\n\nBefore you begin\n\n\nBefore you start using GKE on AWS, make sure you have performed the following tasks:\n\n- Complete the [Prerequisites](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/prerequisites).\n\n\u003c!-- --\u003e\n\n- Install a [management service](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/installing-management).\n- Create a [user cluster](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/creating-user-cluster).\n- Register your cluster with Connect by following the steps in [Connecting to your cluster with Cloud console](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/connecting-to-a-cluster).\n- Configure your cluster to [Use workload identity with Google Cloud](/kubernetes-engine/multi-cloud/docs/aws/previous-generation/how-to/workload-identity-gcp).\n- If your user clusters have restricted outbound access to the internet,\n allow access to the following container repository domains:\n\n - `docker.io`\n - `quay.io`\n- From your `anthos-aws` directory, use\n `anthos-gke` to switch context to your user cluster.\n\n ```sh\n cd anthos-aws\n env HTTPS_PROXY=http://localhost:8118 \\\n anthos-gke aws clusters get-credentials CLUSTER_NAME\n ```\n Replace \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e with your user cluster name.\n\n \u003cbr /\u003e\n\nInstalling Anthos Service Mesh\n\nFollow the steps in\n[Install Cloud Service Mesh](/service-mesh/docs/unified-install/install).\n\nCreating an example Deployment\n\nIn this section, you install a sample application and create an Ingress endpoint\nfor it.\n\n1. Create a Deployment of `hello-app` and a ClusterIP for the deployment.\n Copy the following YAML into a file named `hello-app.yaml`.\n\n apiVersion: apps/v1\n kind: Deployment\n metadata:\n labels:\n app: hello-app\n name: hello-app\n spec:\n selector:\n matchLabels:\n app: hello-app\n replicas: 3\n template:\n metadata:\n labels:\n app: hello-app\n spec:\n containers:\n - name: hello\n image: \"gcr.io/google-samples/hello-app:2.0\"\n ---\n apiVersion: v1\n kind: Service\n metadata:\n labels:\n app: hello-app\n name: hello-app\n spec:\n type: ClusterIP\n selector:\n app: hello-app\n ports:\n - protocol: TCP\n port: 8080\n targetPort: 8080\n\n2. Apply the YAML to your cluster with `kubectl apply`.\n\n env HTTPS_PROXY=http://localhost:8118 \\\n kubectl apply -f hello-app.yaml\n\n3. Create a Kubernetes Ingress for the sample application. Copy the following\n YAML into a file named `hello-app-ingress.yaml`\n\n apiVersion: networking.k8s.io/v1beta1\n kind: Ingress\n metadata:\n annotations:\n kubernetes.io/ingress.class: istio\n labels:\n app: hello-app\n name: hello-app\n spec:\n rules:\n - host:\n http:\n paths:\n - backend:\n serviceName: hello-app\n servicePort: 8080\n\n4. Create the Ingress by applying the configuration with `kubectl apply`.\n\n env HTTPS_PROXY=http://localhost:8118 \\\n kubectl apply -f hello-app-ingress.yaml\n\n5. Check the status of your gateway with `kubectl get svc`.\n\n env HTTPS_PROXY=http://localhost:8118 \\\n kubectl get ingress hello-app\n\n The `ADDRESS` field should have an ELB domain name. If the `ADDRESS`\n remains `pending`, confirm your VPC and Subnet labeling.\n6. You can check the Ingress gateway URL by composing the host and port.\n To get your gateway URL, perform the following commands:\n\n export INGRESS_URL=$(env HTTPS_PROXY=http://localhost:8118 \\\n kubectl get ingress hello-app -o jsonpath='{.status.loadBalancer.ingress[0].hostname}')\n echo \"Your hello-app Ingress URL is: http://\"$INGRESS_URL\n\n The last command prints the endpoint of your Ingress.\n7. If you created a public Ingress, you can view the `hello-app` default web page\n in `curl` by visiting `http://$INGRESS_URL/`.\n\n curl $INGRESS_URL/\n\nCleaning up\n\nYou remove the `hello-app` components with `kubectl delete`. \n\n env HTTPS_PROXY=http://localhost:8118 \\\n kubectl delete -f hello-app.yaml &&\\\n kubectl delete -f hello-app-ingress.yaml\n\nIf you would like to remove Cloud Service Mesh, see\n[Uninstalling Cloud Service Mesh](/service-mesh/docs/uninstall#uninstalling).\n\nWhat's next\n\nLearn more about:\n\n- [Injecting sidecar proxies](/service-mesh/docs/proxy-injection)\n\n- [Naming service ports](/service-mesh/docs/naming-service-ports)\n\n- [Enabling Cloud Service Mesh optional features](/service-mesh/docs/enable-optional-features)\n\n- [Integrating with third-party add-ons](/service-mesh/docs/third-party-integrations)\n\n- [Configuring the Ingress Gateway](https://istio.io/latest/docs/tasks/traffic-management/ingress/ingress-control/)\n\n- [Routing traffic](https://istio.io/docs/tasks/traffic-management/ingress/)"]]