Deploy aplikasi Kubernetes dengan Cloud Code untuk IntelliJ

Pelajari cara menggunakan Cloud Code for IntelliJ untuk men-deploy aplikasi Kubernetes pertama Anda.

Dalam panduan memulai ini, Anda akan menyiapkan aplikasi Kubernetes baru menggunakan template Hello World pemula, menjalankan aplikasi di cluster, mengonfigurasi pembangunan ulang berkelanjutan untuk mengembangkan aplikasi secara iteratif, men-debug kode yang sedang berjalan, dan melihat log streaming dari aplikasi aktif.

Meskipun sebaiknya gunakan Google Cloud untuk panduan ini, Anda dapat menggunakan Cloud Code dengan cluster lokal menggunakan alat seperti minikube dan Docker Desktop. Namun, fitur seperti pembuatan cluster GKE live dan continuous delivery terintegrasi akan memberikan pengalaman terbaik dengan projectGoogle Cloud .

Sebelum memulai

Baik Anda memilih untuk menggunakan cluster yang dihosting di cloud atau lokal, untuk menyelesaikan panduan memulai cepat ini, ikuti langkah-langkah berikut:

  1. Instal Git. Git diperlukan untuk menyalin contoh kode ke komputer Anda.
  2. Instal Docker. Docker diperlukan untuk membuat kode contoh. Pastikan akun pengguna lokal Anda dapat membuat penampung.
  3. Instal plugin Cloud Code jika Anda belum melakukannya.

Untuk menyelesaikan panduan memulai ini menggunakan Google Cloud, ikuti langkah-langkah berikut:

  1. Login ke akun Google Cloud Anda. Jika Anda baru menggunakan Google Cloud, buat akun untuk mengevaluasi performa produk kami dalam skenario dunia nyata. Pelanggan baru juga mendapatkan kredit gratis senilai $300 untuk menjalankan, menguji, dan men-deploy workload.
  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. If you're using an existing project for this guide, verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.

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

  5. Enable the Google Kubernetes Engine API, if it is not already enabled.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the API

  6. 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