Panduan memulai: Men-deploy kumpulan pekerja contoh ke Cloud Run

Halaman ini menunjukkan cara men-deploy container kumpulan pekerja contoh. Setelah di-deploy, kumpulan pekerja akan terus menulis pesan log.

Sebelum memulai

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Jika Anda menggunakan project yang sudah ada untuk panduan ini, pastikan Anda memiliki izin yang diperlukan untuk menyelesaikan panduan ini. Jika berhasil membuat project baru, berarti Anda sudah memiliki izin yang diperlukan.

  4. Verify that billing is enabled for your Google Cloud project.

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  6. Jika Anda menggunakan project yang sudah ada untuk panduan ini, pastikan Anda memiliki izin yang diperlukan untuk menyelesaikan panduan ini. Jika berhasil membuat project baru, berarti Anda sudah memiliki izin yang diperlukan.

  7. Verify that billing is enabled for your Google Cloud project.

  8. Tinjau harga Cloud Run atau perkirakan biaya dengan kalkulator harga.
  9. Peran yang diperlukan

    Untuk mendapatkan izin yang Anda perlukan guna menyelesaikan panduan memulai cepat ini, minta administrator Anda untuk memberi Anda peran IAM berikut:

    Untuk mengetahui informasi selengkapnya tentang pemberian peran, lihat Mengelola akses ke project, folder, dan organisasi.

    Anda mungkin juga bisa mendapatkan izin yang diperlukan melalui peran khusus atau peran bawaan lainnya.

    Men-deploy kumpulan pekerja

    Untuk men-deploy container worker pool contoh, ikuti langkah-langkah berikut:

    1. Di konsol Google Cloud , buka Cloud Run:

      Buka Cloud Run

    2. Pilih Worker pools dari menu, lalu klik Deploy container untuk menampilkan formulir Create worker pools.

    3. Klik Uji dengan container contoh.

    4. Klik Create untuk men-deploy image ke Cloud Run. Tunggu hingga deployment selesai.

    5. Klik tab Logs untuk melihat log yang ditulis oleh kumpulan pekerja. Worker pool terus-menerus menulis pesan log Cloud Run Worker Pool instance is running!.

    Pembersihan

    Untuk menghindari biaya tambahan pada akun Google Cloud Anda, hapus semua resource yang Anda deploy dengan panduan memulai ini.

    Menghapus repositori Anda

    Anda mungkin dikenai biaya untuk menyimpan image container di Artifact Registry. Untuk menghapus repositori Artifact Registry, ikuti langkah-langkah di Menghapus repositori dalam dokumentasi Artifact Registry.

    Menghapus kumpulan pekerja

    Worker pool contoh terus-menerus menulis log. Untuk menghentikan logging, ikuti salah satu langkah berikut untuk menghapus kumpulan pekerja:

    1. Di konsol Google Cloud , buka Cloud Run:

      Buka Cloud Run

    2. Pilih Worker pools dari menu, lalu pilih worker pool yang ingin Anda hapus.

    3. Klik Hapus.

    Menghapus project pengujian Anda

    Menghapus project Google Cloud akan menghentikan penagihan untuk semua resource dalam project tersebut. Untuk melepaskan semua Google Cloud resource di project Anda, ikuti langkah-langkah berikut:

    1. In the Google Cloud console, go to the Manage resources page.

      Go to Manage resources

    2. In the project list, select the project that you want to delete, and then click Delete.
    3. In the dialog, type the project ID, and then click Shut down to delete the project.

    Langkah berikutnya

    Untuk mengetahui informasi selengkapnya tentang kumpulan pekerja, lihat: