Membuat dan menjalankan tugas di Cloud Run
Halaman ini menunjukkan Anda cara membuat tugas di Cloud Run menggunakan container contoh, menjalankan tugas, dan melihat log untuk tugas tersebut.
Sebelum memulai
- 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.
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Cloud Run Admin API.
-
Make sure that you have the following role or roles on the project: Cloud Run Developer, Service Account User, Logs Viewer
Check for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
Buka IAM - Pilih project.
- Klik Berikan akses.
-
Di kolom Akun utama baru, masukkan ID pengguna Anda. Biasanya berupa alamat email untuk Akun Google.
- Di daftar Pilih peran, pilih peran.
- Untuk memberikan peran tambahan, klik Tambahkan peran lain, lalu tambahkan setiap peran tambahan.
- Klik Simpan.
-
-
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
-
Make sure that billing is enabled for your Google Cloud project.
-
Enable the Cloud Run Admin API.
-
Make sure that you have the following role or roles on the project: Cloud Run Developer, Service Account User, Logs Viewer
Check for the roles
-
In the Google Cloud console, go to the IAM page.
Go to IAM - Select the project.
-
In the Principal column, find all rows that identify you or a group that you're included in. To learn which groups you're included in, contact your administrator.
- For all rows that specify or include you, check the Role column to see whether the list of roles includes the required roles.
Grant the roles
-
In the Google Cloud console, go to the IAM page.
Buka IAM - Pilih project.
- Klik Berikan akses.
-
Di kolom Akun utama baru, masukkan ID pengguna Anda. Biasanya berupa alamat email untuk Akun Google.
- Di daftar Pilih peran, pilih peran.
- Untuk memberikan peran tambahan, klik Tambahkan peran lain, lalu tambahkan setiap peran tambahan.
- Klik Simpan.
-
Buat tugas
Untuk membuat tugas:
Di konsol Google Cloud , buka halaman Cloud Run:
Pilih Jobs dari menu, lalu klik Deploy container untuk membuka formulir Create job.
Klik Uji dengan container contoh.
Di menu pull-down Region, pilih region tempat Anda ingin menjalankan tugas.
Klik Buat untuk membuat tugas.
Tugas dibuat dan siap dijalankan.
Laksanakan tugas
Setelah Anda membuat tugas, Anda dapat menjalankannya:
Di tab Tugas, klik tugas yang baru saja Anda buat untuk membuka halaman Detail tugas.
Klik Jalankan.
Log untuk tugas tersedia segera setelah eksekusi tugas dimulai. Klik tab Logs untuk melihat log untuk tugas tersebut.
Lokasi Cloud Run
Cloud Run bersifat regional, berarti infrastruktur yang
menjalankan layanan Cloud Run Anda terletak di region tertentu dan
dikelola oleh Google agar tersedia secara redundan di
semua zona dalam region tersebut.
Memenuhi persyaratan latensi, ketersediaan, atau ketahanan adalah faktor utama
untuk memilih region tempat layanan Cloud Run dijalankan.
Pada umumnya, Anda dapat memilih region yang paling dekat dengan pengguna Anda, tetapi Anda harus mempertimbangkan
lokasi produk Google Cloud
lainnya yang digunakan oleh layanan Cloud Run Anda.
Menggunakan Google Cloud produk secara bersamaan di beberapa lokasi dapat memengaruhi
latensi serta biaya layanan Anda.
Cloud Run tersedia di region berikut:
Tergantung harga Tingkat 1
asia-east1
(Taiwan)asia-northeast1
(Tokyo)asia-northeast2
(Osaka)asia-south1
(Mumbai, India)europe-north1
(Finlandia)CO2 Rendah
europe-north2
(Stockholm)CO2 Rendah
europe-southwest1
(Madrid)CO2 Rendah
europe-west1
(Belgia)CO2 Rendah
europe-west4
(Belanda)CO2 Rendah
europe-west8
(Milan)europe-west9
(Paris)CO2 Rendah
me-west1
(Tel Aviv)northamerica-south1
(Meksiko)us-central1
(Iowa)CO2 Rendah
us-east1
(South Carolina)us-east4
(North Virginia)us-east5
(Columbus)us-south1
(Dallas)CO2 Rendah
us-west1
(Oregon)CO2 Rendah
Tergantung harga Tingkat 2
africa-south1
(Johannesburg)asia-east2
(Hong Kong)asia-northeast3
(Seoul, Korea Selatan)asia-southeast1
(Singapura)asia-southeast2
(Jakarta)asia-south2
(Delhi, India)australia-southeast1
(Sydney)australia-southeast2
(Melbourne)europe-central2
(Warsawa, Polandia)europe-west10
(Berlin)CO2 Rendah
europe-west12
(Turin)europe-west2
(London, Inggris Raya)CO2 Rendah
europe-west3
(Frankfurt, Jerman)CO2 Rendah
europe-west6
(Zurich, Swiss)CO2 Rendah
me-central1
(Doha)me-central2
(Dammam)northamerica-northeast1
(Montreal)CO2 Rendah
northamerica-northeast2
(Toronto)CO2 Rendah
southamerica-east1
(Sao Paulo, Brasil)CO2 Rendah
southamerica-west1
(Santiago, Cile)CO2 Rendah
us-west2
(Los Angeles)us-west3
(Salt Lake City)us-west4
(Las Vegas)
Jika sudah membuat layanan Cloud Run, Anda dapat melihat region di dasbor Cloud Run di Google Cloud konsol.