Ein Kubernetes-Cluster, der Computing-, Speicher-, Netzwerk- und andere Dienste für Anwendungen bereitstellt, vergleichbar einem virtuellen Rechenzentrum. Anwendungen und die zugehörigen Dienste, die in Kubernetes ausgeführt werden, werden Arbeitslasten genannt.
In dieser Anleitung sehen Sie schnell einen laufenden Google Kubernetes Engine-Cluster und eine Beispielarbeitslast, die beide über die Google Cloud Console eingerichtet wurden. Sie können sich dann die Arbeitslast in der Google Cloud Console ansehen, bevor Sie mit unserem ausführlicheren Lernpfad fortfahren oder mit der Planung und dem Erstellen Ihres eigenen produktionsfertigen Clusters beginnen.
Wenn Sie Ihren Beispielcluster und Ihre Beispielarbeitslast lieber mit Terraform einrichten möchten, lesen Sie den Hilfeartikel Cluster mit Terraform erstellen.
Klicken Sie auf Anleitung, um eine detaillierte Anleitung für diese Aufgabe direkt in der Google Cloud Console aufzurufen.
Im Autopilot-Modus verwaltet Google Ihre Clusterkonfiguration, einschließlich Skalierung, Sicherheit und andere vorkonfigurierte Einstellungen. Cluster im Autopilot-Modus sind für die Ausführung der meisten Produktionsarbeitslasten optimiert und Rechenressourcen bereitstellen, die auf Ihren Kubernetes-Manifesten basieren.
Öffnen Sie in der Google Cloud Console die Seite zu den GKE-Clustern.
Führen Sie unter Clustergrundlagen die folgenden Schritte aus:
Geben Sie im Feld Name den folgenden Namen ein.
hello-world-cluster
Übernehmen Sie für die anderen Einstellungen die Standardwerte und klicken Sie auf Erstellen, um mit dem Erstellen des Clusters zu beginnen.
Wenn Sie zur Seite der Kubernetes-Cluster zurückgeleitet werden, klicken Sie auf hello-world-cluster in der Spalte Name.
Sie können den Fortschritt beim Erstellen Ihres Clusters verfolgen, während er konfiguriert, bereitgestellt und verifiziert wird.
Warten Sie, bis neben dem Seitentitel hello-world-cluster ein Häkchen angezeigt wird.
Beispielanwendung im Cluster bereitstellen
Im Folgenden wird die von Google zur Verfügung gestellte und als Container in Artifact Registry gespeicherte Beispiel-Webanwendung „Hello World“ bereitgestellt.
Rufen Sie dazu in der Google Cloud Console die Seite GKE-Arbeitslasten auf.
Diese einfache „Hello World“-Anwendung ist in einen einzelnen Container gepackt. Größere Anwendungen bestehen dagegen in der Regel aus mehreren aufeinander bezogenen Containern, die gemeinsam bereitgestellt und als einzelne Arbeitslast ausgeführt werden können.
Klicken Sie auf Weiter, um den Abschnitt Konfiguration aufzurufen.
Geben Sie unter Bereitstellungsname den folgenden Namen ein:
hello-world-app
Wählen Sie unter Kubernetes-Cluster die Option hello-world-cluster aus.
Klicken Sie auf Weiter.
Erstellen Sie im Abschnitt Freigeben einen Load-Balancing-Kubernetes-Dienst, um externe Anfragen zu Ihrer Anwendung weiterzuleiten:
Wählen Sie Deployment als neuen Dienst freigeben aus.
Übernehmen Sie für Port 1 die Einstellung 80.
Geben Sie in Zielport 1 den Wert 8080 ein.
Klicken Sie auf Bereitstellen.
GKE weist dem Dienst automatisch eine verfügbare externe IP-Adresse zu.
Dieser Dienst wird als Teil der Arbeitslast „hello-world-app“ behandelt.
Bei Autopilot-Clustern wird möglicherweise eine Fehlermeldung wie Does not have minimum availability angezeigt. Dies liegt daran, dass Autopilot die Knoten löscht und dann neu erstellt. Warten Sie einige Minuten und klicken Sie dann auf refreshAktualisieren, um die Seite zu aktualisieren.
Warten Sie, bis das Deployment abgeschlossen ist und die Seite Bereitstellungsdetails angezeigt wird.
Live-Demo im Browser ansehen
Rufen Sie in der Google Cloud Console die Seite Bereitstellungsdetails für hello-world-app auf:
Rufen Sie in der Google Cloud Console die Seite GKE-Arbeitslasten auf.
Klicken Sie in der Spalte Name auf den Namen der bereitgestellten Arbeitslast hello-world-app.
Klicken Sie in der Spalte Endpunkte auf die IP-Adresse, die öffentlich verfügbar ist.
GKE öffnet einen neuen Browsertab und sendet eine Anfrage an die Anwendung. Schließen Sie alle Warnungen für sichere Websites. Auf dem neuen Browsertab sollte nun Hello, world! angezeigt werden.
Wenn Endpunkte leer ist, gilt für Ihre Organisation möglicherweise eine Richtlinie, die den externen Zugriff verhindert.
Sie haben nun einen GKE-Cluster im Autopilot-Modus erstellt und eine Beispielarbeitslast bereitgestellt.
Bereinigung durchführen, um Gebühren zu vermeiden
Wenn Sie weitere Anleitungen durchgehen oder Ihr Beispiel weiter untersuchen möchten, warten Sie mit diesem Bereinigungsschritt, bis Sie fertig sind. Sie können den Kubernetes-Beispielcluster in den meisten GKE-Anleitungen weiterhin verwenden.
Wenn Sie ein neues Projekt erstellt haben, um mehr über GKE zu erfahren, und dieses Projekt nicht mehr benötigen, löschen Sie das Projekt.
Wenn Sie ein vorhandenes GKE-Projekt verwendet haben, löschen Sie die von Ihnen erstellten Ressourcen. So vermeiden Sie, dass Ihrem Konto Gebühren in Rechnung gestellt werden:
Wählen Sie die Zeile mit hello-world-cluster aus und klicken Sie auf Löschen.
Führen Sie im Fenster hello-world-cluster löschen die folgenden Schritte aus:
Geben Sie im Feld hello-world-cluster den Wert hello-world-cluster ein.
Klicken Sie auf Löschen.
Wenn Sie eine Fehlermeldung zu dem zu reparierenden Cluster erhalten, können Sie warten, bis der Vorgang abgeschlossen ist, und dann den Cluster löschen. Dieser Vorgang kann einige Zeit dauern.
Wenn Sie eine Logsenke und einen Bucket erstellt haben, als Sie den Anweisungen in anderen Anleitungen gefolgt sind:
Rufen Sie in Cloud Logging die Seite Logspeicher auf.
[[["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-07-30 (UTC)."],[],[],null,["# Quickstart: Create a cluster and deploy a workload\n\nCreate a cluster and deploy a workload in the Google Cloud console\n==================================================================\n\n[Autopilot](/kubernetes-engine/docs/concepts/autopilot-overview)\n\n*** ** * ** ***\n\n\u003cbr /\u003e\n\nA Kubernetes *cluster* provides compute, storage, networking,\nand other services for applications, similar to a virtual data center. Apps and\ntheir associated services that run in Kubernetes are called *workloads*.\n\nThis tutorial lets you quickly see a running Google Kubernetes Engine cluster and sample workload, all set up using the Google Cloud console. You can then explore the workload in the Google Cloud console before going on to our [more in-depth learning path](/kubernetes-engine/docs/learn/scalable-apps), or to start planning and creating your own production-ready cluster.\n\nIf you'd prefer to set up your sample cluster and workload by using Terraform, see [Create a cluster with Terraform](/kubernetes-engine/docs/quickstarts/create-cluster-using-terraform).\n\n*** ** * ** ***\n\nTo follow step-by-step guidance for this task directly in the\nGoogle Cloud console, click **Guide me**:\n\n[Guide me](https://console.cloud.google.com/freetrial?redirectPath=/kubernetes/list/overview?walkthrough_id=kubernetes--create-cluster)\n\n*** ** * ** ***\n\nBefore you begin\n----------------\n\nTake the following steps to enable the Kubernetes Engine API:\n\n1. Visit the [Kubernetes Engine page](https://console.cloud.google.com/projectselector/kubernetes) in the Google Cloud console.\n2. Create or select a project.\n3. Wait for the API and related services to be enabled. This can take several minutes.\n4.\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n### Required roles\n\n-\n\n Make sure that you have the following role or roles on the project:\n\n Compute Admin, Kubernetes Engine Admin, Service Account User\n\n #### Check for the roles\n\n 1.\n In the Google Cloud console, go to the **IAM** page.\n\n [Go to IAM](https://console.cloud.google.com/projectselector/iam-admin/iam?supportedpurview=project)\n 2. Select the project.\n 3.\n In the **Principal** column, find all rows that identify you or a group that\n you're included in. To learn which groups you're included in, contact your\n administrator.\n\n 4. For all rows that specify or include you, check the **Role** column to see whether the list of roles includes the required roles.\n\n #### Grant the roles\n\n 1.\n In the Google Cloud console, go to the **IAM** page.\n\n [Go to IAM](https://console.cloud.google.com/projectselector/iam-admin/iam?supportedpurview=project)\n 2. Select the project.\n 3. Click person_add **Grant access**.\n 4.\n In the **New principals** field, enter your user identifier.\n\n This is typically the email address for a Google Account.\n\n 5. In the **Select a role** list, select a role.\n 6. To grant additional roles, click add **Add\n another role** and add each additional role.\n 7. Click **Save**.\n\nCreate a cluster in GKE Autopilot mode\n--------------------------------------\n\nIn Autopilot mode, Google manages your cluster configuration, including\nscaling, security, and other preconfigured settings. Clusters in\nAutopilot mode are optimized to run most production workloads and\nprovision compute resources based on your Kubernetes manifests.\n\n1. In the Google Cloud console, go to the\n GKE **Create an Autopilot cluster** page.\n\n\n [Go to Create an Autopilot cluster](https://console.cloud.google.com/kubernetes/auto/add)\n\n \u003cbr /\u003e\n\n2. Under **Cluster basics**, do the following:\n\n 1. In the **Name** field, enter the following name:\n\n hello-world-cluster\n\n 2. Keep the default values for the rest of the settings and click\n **Create**\n to start creating the cluster.\n\n3. When you're redirected to the **Kubernetes clusters** page, click\n **hello-world-cluster** in the **Name** column.\n\n You can watch the progress of your cluster as it is being configured,\n deployed, and verified.\n4. Wait until you see a check mark next to the **hello-world-cluster**\n page title.\n\nDeploy a sample app to your cluster\n-----------------------------------\n\nDeploy a sample \"hello world\" web app provided by Google and stored as a\ncontainer in Artifact Registry.\n\n1. In the Google Cloud console, go to the GKE **Workloads**\n page.\n\n\n [Go to Workloads](https://console.cloud.google.com/kubernetes/workload/overview)\n\n \u003cbr /\u003e\n\n2. Click **Deploy**.\n\n3. In **Deployment name**, enter the following name:\n\n hello-world-app\n\n4. In Kubernetes Cluster,\n select **hello-world-cluster**.\n\n5. Click **Next: Container details**\n\n6. Leave **Existing container image** selected, and in **Image path**\n enter the following path:\n\n us-docker.pkg.dev/google-samples/containers/gke/hello-app:1.0\n\n This simple \"hello world\" app is packaged into a single container, but larger\n apps typically consist of several related containers that can be deployed\n together and run as a single workload.\n7. Click **Next: Expose (optional)**\n\n8. In the **Expose** section, create a load balancing Kubernetes Service to direct\n external requests to your app:\n\n 1. Select **Expose deployment as a new service**.\n\n 2. Leave **Port 1** set to **80**.\n\n 3. In **Target port 1** , enter **8080**.\n\n 4. Click **Deploy**.\n\n GKE automatically assigns an available external IP address\n to the Service.\n\n This Service is considered to be part of the hello-world-app workload.\n9. For Autopilot clusters, you might see an error message, such as\n `Does not have minimum availability`. This occurs because Autopilot\n deletes and then re-creates the nodes. Wait a few minutes, then click\n refreshRefresh\n to update the page.\n\n10. Wait until the deployment completes and you see the **Deployment details**\n page.\n\nView a live demo in your browser\n--------------------------------\n\n1. In the Google Cloud console, go to\n the **Deployment details** page for **hello-world-app**:\n\n 1. In the Google Cloud console, go to the GKE **Workloads** page.\n\n\n [Go to Workloads](https://console.cloud.google.com/kubernetes/workload/overview)\n\n \u003cbr /\u003e\n\n 2. In the **Name** column, click the name of the workload you deployed,\n **hello-world-app**.\n\n2. In the Endpoints\n column, click the IP address, which is publicly available.\n\n GKE opens a new browser tab and sends a request to your\n app. Dismiss any secure-site warnings, and you should see\n **Hello, world!** in the new browser tab.\n\n If **Endpoints** is empty, your organization might have a policy that\n prevents external access.\n\nYou have successfully created a GKE cluster in\nAutopilot mode and deployed a sample workload.\n\nClean up to avoid billing charges\n---------------------------------\n\nIf you plan to take additional tutorials or to [explore your sample further](/kubernetes-engine/docs/quickstarts/tour-cluster), wait until you're finished to perform this cleanup step. You can continue to use the sample Kubernetes cluster\nin most GKE tutorials.\n\nIf you created a new project to learn about GKE and you no\nlonger need the project, [delete the project](https://console.cloud.google.com/cloud-resource-manager).\n\nIf you used an existing GKE project, delete the resources you\ncreated to avoid incurring charges to your account:\n\n1. Go to the GKE **Clusters** page.\n\n\n [Go to Clusters](https://console.cloud.google.com/kubernetes/list/overview)\n\n \u003cbr /\u003e\n\n2. Select the row containing **hello-world-cluster** , and click\n **Delete**.\n\n3. In the **Delete hello-world-cluster** window, do the following:\n\n 1. In the **hello-world-cluster** field, enter `hello-world-cluster`.\n\n 2. Click **Delete**.\n\n If you receive an error message about the cluster being repaired, you can\n wait for the process to complete, and then delete the cluster. This operation\n might take some time to complete.\n4. If you created a logs sink and bucket when following instructions in other\n tutorials:\n\n 1. Go to the Cloud Logging **Logs storage** page.\n\n\n [Go to Logs storage](https://console.cloud.google.com/logs/storage)\n\n \u003cbr /\u003e\n\n 2. Select **hello-world-cluster-bucket** and click **Delete**.\n\n 3. Go to the Logging **Log router** page.\n\n\n [Go to Log router](https://console.cloud.google.com/logs/router)\n\n \u003cbr /\u003e\n\n 4. Select **hello-world-cluster-sink** and click **Delete**.\n\nWhat's next\n-----------\n\n- [Explore your cluster and workload](/kubernetes-engine/docs/quickstarts/tour-cluster)\n to learn about the some of the key workload settings and resources that\n you deployed.\n\n- Try our more in-depth [Learning path: Scalable apps](/kubernetes-engine/docs/learn/scalable-apps).\n\n- Learn how to get started with real life cluster administration in our [Cluster administration overview](/kubernetes-engine/docs/how-to/cluster-admin-overview)."]]