Men-deploy layanan ke Cloud Run di Cloud Code for IntelliJ
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Setelah semuanya disiapkan, Anda dapat men-deploy layanan ke Cloud Run dan melihat layanan Anda secara langsung.
Menentukan konfigurasi proses
Sebelum men-deploy layanan, Anda harus membuat konfigurasi run:
Buka pemilih konfigurasi Run/Debug di Menu navigasi, lalu klik
Edit Configurations.
Di panel kiri, klik Cloud Run: Deploy.
Tetapkan ID project Google Cloud Anda.
Pilih preferensi platform Anda di bagian Deployment Platform,
baik Cloud Run maupun Knative serving. Untuk
deskripsi mendetail setiap opsi, lihat
panduan platform Cloud Run.
Jika Cloud Run dipilih, pilih region yang akan
digunakan untuk men-deploy.
Jika Knative serving dipilih, konfigurasi informasi cluster
Kubernetes.
Jika layanan Anda adalah API atau situs publik, pilih Izinkan pemanggilan tanpa autentikasi di bagian Autentikasi. Jika tidak, pilih
Require authentication.
Di bagian Setelan Revisi, Cloud Code akan otomatis mengisi kolom URL image container dengan lokasi penyimpanan image container Anda (tempat penyimpanan layanan Anda, setelah layanan tersebut di-build dan dikontainerisasi).
Nilai ini didasarkan pada nama project dan layanan Google Cloud Anda.
Jika perlu, Anda dapat mengganti nilai ini:
Untuk penayangan Cloud Run dan Knative, Anda dapat menyimpan image di salah satu lokasi berikut:
Artifact Registry, menggunakan format
REGION-docker.pkg.dev/PROJECT_ID/REPO_NAME/IMAGE_PATH
REGION adalah wilayah yang didukung repositori
PROJECT_ID adalah ID project Google Cloud yang berisi cluster Anda
REPO_NAME adalah nama repositori tempat image Anda disimpan
IMAGE_PATH adalah jalur ke gambar Anda
Container Registry, menggunakan format
gcr.io/PROJECT_ID/IMAGE_NAME
PROJECT_ID adalah ID project Google Cloud Anda
IMAGE_NAME merujuk ke repositori image container
Jika menggunakan layanan Knative, Anda dapat menyimpan image di Docker Hub menggunakan format docker.io/ACCOUNT, dengan ACCOUNT adalah nama akun Docker Hub Anda. Pastikan Anda
diautentikasi dengan benar
jika Anda menggunakan repositori Docker Hub pribadi.
Di bagian Setelan build, pilih apakah akan membangun secara lokal atau di
Cloud Build.
Pilih pembuat dan plugin.
Cloud Code mendukung jenis artefak Docker, Jib, dan Buildpack.
Klik Oke.
Opsional: Menyesuaikan konfigurasi
Saat men-deploy layanan, Anda dapat menentukan setelan tambahan seperti
akun layanan, variabel lingkungan, dan, saat menggunakan
Cloud Run, koneksi SQL dan Konektor VPC. Tentukan
setelan tambahan di bagian Setelan revisi lanjutan saat Anda
memilih Edit Konfigurasi.
Variabel lingkungan:
Variabel lingkungan berikut akan otomatis ditambahkan ke container yang berjalan:
Nama
Deskripsi
Contoh
PORT
Port yang akan diproses oleh server HTTP Anda.
8080
K_SERVICE
Nama layanan Cloud Run yang sedang dijalankan.
hello-world
K_REVISION
Nama revisi Cloud Run yang sedang dijalankan.
hello-world.1
K_CONFIGURATION
Nama konfigurasi Cloud Run yang membuat revisi.
hello-world
Men-deploy layanan Anda
Untuk men-deploy layanan, ikuti langkah-langkah berikut:
Pilih target run dari dialog konfigurasi Run/Debug di panel tugas atas.
Klik Run.
Lihat layanan yang sedang berjalan dengan membuka URL yang ditampilkan di
jendela output.
Anda juga dapat melihat status layanan (metrik, detail revisi, dan lainnya) dengan mengikuti URL log yang ditampilkan di jendela output.
Mendapatkan dukungan
Untuk mengirimkan masukan atau melaporkan masalah di IDE IntelliJ, buka
Tools > Cloud Code > Help / About > Submit
feedback or report an issue untuk melaporkan masalah di GitHub.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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)."]]