Dienst in Cloud Code for IntelliJ in Cloud Run bereitstellen
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Jetzt können Sie den Dienst in Cloud Run bereitstellen und live ansehen.
Ausführungskonfiguration definieren
Vor dem Bereitstellen des Service müssen Sie die Ausführungskonfiguration erstellen:
Gehen Sie in der Navigationsleiste zur Auswahl von Ausführungs-/Fehlerbehebungskonfigurationen und klicken Sie auf Konfigurationen bearbeiten.
Klicken Sie im linken Bereich auf Cloud Run: Deploy.
Legen Sie Ihre Google Cloud -Projekt-ID fest.
Wählen Sie unter Deployment Platform Ihre Plattformeinstellungen aus, entweder Cloud Run oder Knative Serving. Eine detaillierte Beschreibung der einzelnen Optionen finden Sie im Leitfaden zur Cloud Run-Plattform.
Wenn Cloud Run ausgewählt ist, wählen Sie eine Region für die Bereitstellung aus.
Haben Sie Knative Serving ausgewählt, konfigurieren Sie die Kubernetes-Clusterinformationen.
Wenn Ihr Dienst eine öffentliche API oder Website ist, wählen Sie im Abschnitt "Authentifizierung" die Option Nicht authentifizierte Aufrufe zulassen aus. Wählen Sie andernfalls Require authentication aus.
Unter Überarbeitungseinstellungen füllt Cloud Code automatisch das URL-Feld des Container-Images mit dem Speicherort Ihres Container-Images aus. Dort wird der Dienst gespeichert, sobald er erstellt und containerisiert wurde.
Dieser Wert basiert auf Ihrem Google Cloud Projekt und dem Dienstnamen.
Bei Bedarf können Sie diesen Wert überschreiben:
Sowohl für Cloud Run als auch für Knative Serving können Sie Ihre Images auf einer der folgenden Speicherorte speichern:
Artifact Registry im Format REGION-docker.pkg.dev/PROJECT_ID/REPO_NAME/IMAGE_PATH
REGION ist die unterstützte Region des Repositorys.
PROJECT_ID ist die ID des Google Cloud -Projekts, das Ihren Cluster enthält.
REPO_NAME ist der Name Ihres Repositorys, in dem das Image gespeichert ist.
IMAGE_PATH ist der Pfad zu Ihrem Bild.
Container Registry im Format gcr.io/PROJECT_ID/IMAGE_NAME
PROJECT_ID ist die ID Ihres Google Cloud -Projekts.
IMAGE_NAME bezieht sich auf das Container-Image-Repository.
Wenn Sie Knative Serving verwenden, können Sie Ihre Images in Docker Hub im folgenden Format speichern: docker.io/ACCOUNT, wobei ACCOUNT Name Ihres Docker Hub-Kontos ist. Achten Sie darauf, dass Sie ordnungsgemäß authentifiziert sind, wenn Sie ein privates Docker Hub-Repository verwenden.
Wählen Sie unter "Build-Einstellungen" aus, ob der Build lokal oder in Cloud Build erstellt werden soll.
Wählen Sie einen Builder und ein Plug-in aus.
Cloud Code unterstützt Artefakttypen von Docker, Jib und Buildpacks.
Klicken Sie auf OK.
Optional: Konfiguration anpassen
Beim Bereitstellen des Dienstes können Sie zusätzliche Einstellungen angeben, z. B. ein Dienstkonto, Umgebungsvariablen und bei Verwendung von Cloud Run einen VPC-Connector und SQL-Verbindungen. Geben Sie die zusätzlichen Einstellungen im Abschnitt Erweiterte Überarbeitungseinstellungen an, wenn Sie Konfigurationen bearbeiten auswählen.
Umgebungsvariablen:
Die folgenden Umgebungsvariablen werden den ausgeführten Containern automatisch hinzugefügt:
Name
Beschreibung
Beispiel
PORT
Der Port, den Ihr HTTP-Server beobachten soll.
8080
K_SERVICE
Der Name des ausgeführten Cloud Run-Dienstes.
hello-world
K_REVISION
Der Name der ausgeführten Cloud Run-Überarbeitung.
hello-world.1
K_CONFIGURATION
Der Name der Cloud Run-Konfiguration, mit der die Überarbeitung erstellt wurde.
hello-world
Dienst bereitstellen
So stellen Sie Ihren Dienst bereit:
Wählen Sie in der oberen Taskleiste im Dialogfeld "Run/Debug configurations" das Ausführungsziel aus.
Klicken Sie auf Ausführen.
Rufen Sie den ausgeführten Service auf. Folgen Sie dazu der URL im Ausgabefenster.
Sie können sich auch den Status Ihres Dienstes (Messwerte, Überarbeitungsdetails usw.) anzeigen lassen, wenn Sie der im Ausgabefenster angezeigten Log-URL folgen.
Support anfordern
So senden Sie Feedback oder melden ein Problem in Ihrer IntelliJ-IDE: Tools > Cloud Code > Hilfe / Info > Feedback geben oder Problem melden, um ein Problem auf GitHub zu melden.
[[["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)."],[[["\u003cp\u003eBefore deploying, configure your run settings by navigating to the "Edit Configurations" section under the Run/Debug selector.\u003c/p\u003e\n"],["\u003cp\u003eChoose your deployment platform, selecting either Cloud Run or Knative serving, and configure settings such as region or Kubernetes cluster details.\u003c/p\u003e\n"],["\u003cp\u003eSpecify whether your service requires authentication or allows unauthenticated invocations for public access.\u003c/p\u003e\n"],["\u003cp\u003eConfigure your container image storage location, choosing between Artifact Registry, Container Registry, or Docker Hub, based on your needs.\u003c/p\u003e\n"],["\u003cp\u003eAfter configuring the run settings, you can deploy the service by clicking "Run," and then access the live service and its status via the URLs in the output window.\u003c/p\u003e\n"]]],[],null,["# Deploy a service to Cloud Run in Cloud Code for IntelliJ\n\nNow that you're all set up, you can deploy your service to\nCloud Run and view your service live.\n\nDefining your run configuration\n-------------------------------\n\nBefore you deploy your service, you must create your run configuration:\n\n1. Navigate to Run/Debug configurations selector in the Navigation bar and click **Edit Configurations**.\n2. In the left pane, click **Cloud Run: Deploy**.\n3. Set your Google Cloud project ID.\n4. Choose your platform preferences under **Deployment Platform** ,\n either **Cloud Run** or **Knative serving** . For\n a detailed description of each option, see the\n [Cloud Run platform guide](/run/docs/choosing-a-platform).\n\n - If **Cloud Run** is selected, choose a region to deploy to.\n - If **Knative serving** is selected, configure the Kubernetes\n cluster information.\n\n5. If your service is a public API or website, choose **Allow unauthenticated\n invocations** in the Authentication section. Otherwise, select\n **Require authentication**.\n\n6. Under Revision Settings, Cloud Code automatically populates the\n container image URL field with the storage location of your container\n image (where it stores your service, once it builds and containerizes it).\n This value is based on your Google Cloud project and service name.\n\n If you need to, you can override this value:\n - For both Cloud Run and Knative serving, you can store your images on either:\n - [Artifact Registry](/artifact-registry/docs), using the format **\u003cvar class=\"readonly\" translate=\"no\"\u003eREGION\u003c/var\u003e-docker.pkg.dev/\u003cvar class=\"readonly\" translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/\u003cvar class=\"readonly\" translate=\"no\"\u003eREPO_NAME\u003c/var\u003e/\u003cvar class=\"readonly\" translate=\"no\"\u003eIMAGE_PATH\u003c/var\u003e**\n - \u003cvar class=\"readonly\" translate=\"no\"\u003eREGION\u003c/var\u003e is the repository's supported region\n - \u003cvar class=\"readonly\" translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e is the ID of your Google Cloud project containing your cluster\n - \u003cvar class=\"readonly\" translate=\"no\"\u003eREPO_NAME\u003c/var\u003e is the name of your repository where your image is stored\n - \u003cvar class=\"readonly\" translate=\"no\"\u003eIMAGE_PATH\u003c/var\u003e is the path to your image\n\n | **Note:** Consider [transitioning from Container Registry](/artifact-registry/docs/transition/transition-from-gcr) since Artifact Registry is the recommended service for managing container images. [Container Registry](/container-registry/docs) is still supported but will only receive critical security fixes.\n - Container Registry, using the format **gcr.io/\u003cvar class=\"readonly\" translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e/\u003cvar class=\"readonly\" translate=\"no\"\u003eIMAGE_NAME\u003c/var\u003e**\n - \u003cvar class=\"readonly\" translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e is the ID of your Google Cloud project\n - \u003cvar class=\"readonly\" translate=\"no\"\u003eIMAGE_NAME\u003c/var\u003e refers to the container image repository\n - If you're using Knative serving, you can store\n your images on Docker Hub using the format,\n **docker.io/\u003cvar class=\"readonly\" translate=\"no\"\u003eACCOUNT\u003c/var\u003e** , where \u003cvar class=\"readonly\" translate=\"no\"\u003eACCOUNT\u003c/var\u003e is the name of your Docker Hub\n account. Make sure that you're\n [properly authenticated](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry)\n if you're using a private Docker Hub repository.\n\n7. Under Build settings, choose whether to build locally or on\n Cloud Build.\n\n8. Choose a builder and plugin.\n\n Cloud Code supports Docker, Jib, and Buildpacks\n [artifact types](https://skaffold.dev/docs/builders/).\n9. Click **OK**.\n\n### Optional: Customizing your configuration\n\nWhen deploying your service, you can specify additional settings such as\na service account, environment variables, and, when using\nCloud Run, a VPC Connector and SQL connections. Specify\nthe additional settings in the **Advanced revision settings** section when you\nchoose **Edit Configurations**.\n\n**Environment variables:**\n\nThe following environment variables are automatically added to the running\ncontainers:\n\nDeploying your service\n----------------------\n\nTo deploy your service, follow these steps:\n\n1. Choose your run target from the Run/Debug configurations dialog on the top taskbar.\n2. Click **Run**.\n3. View your running service by following the URL displayed in the **output window**.\n4. You can also view the status of your service (metrics, revision details,\n and more) by following the logs URL displayed in the output window.\n\nGet support\n-----------\n\nTo submit feedback or report an issue in your IntelliJ IDE, go to **Tools** \\\u003e **Cloud Code** \\\u003e **Help / About** \\\u003e **Submit\nfeedback or report an issue** to report an issue on [GitHub](https://github.com/GoogleCloudPlatform/cloud-code-intellij/issues)."]]