My Post (1)

Deploy Cloud Run với Anthos GKE

Cloud Run một trong những sản phẩm đang được Google đẩy mạnh phát triển hiện nay.

Trước khi đi vào chủ đề, mình xin giới thiệu sơ lược và điểm qua một số tính năng của Cloud Run:

  • Any language, any library, any binary
  • Leverage container workflows and standards
  • Pay‐per‐use
  • Fully managed
  • Fast autoscaling
  • Redundancy
  • Integrated logging and monitoring
  • Built on Knative
  • Process asynchronous events

Cloud Run cung cấp cho chúng ta nhiều tính năng vời. Vậy Cloud Run thường được dùng trong các Use Case nào?

Bạn có thể áp dụng nhiều use case của mình vào cloud run. Tuy nhiên, hiện tại Cloud Run chỉ hỗ trợ ứng dụng dạng stateless. Đây là một điểm lưu ý quan trọng để chúng ta có thể thiết kế solution phù hợp với Cloud Run.

Một số use case thường được dùng với Cloud Run:

  • Web services: Websites
Use case diagram for websites
  • Web services: REST APIs backend
Use case diagram for REST APIs backend
  • Web services: Back‐office administration
Use case diagram for back-office administration
  • Automation: Scheduled document generation
Use case diagram for scheduled document generation

Hiện tại Cloud Run hỗ trợ deploy service trên 3 nền tảng:

  • Cloud Run (Full Managed)
  • Cloud Run for Anthos on Google Cloud
  • Cloud Run for Anthos on-prem

Trong bài blog ngày hôm nay, mình xin giới thiệu với các bạn deploy service Cloud Run với Anthos trên Google Cloud.

Các bược thực hiện như sau:

  1. Bước đầu tiên, chúng ta cần tạo 1 cluster GKE trên GCP:
  • Tiếp theo click vào Features ở bên menu trái:
  • Click chọn vào 2 options: Enable Cloud Run for Anthos và Enable Istio.
  • Click vào button CREATE để deploy GKE

2. Deploy to Cloud Run on GKE

  • Để deploy Cloud Run vào Navigation menu > Cloud Run sau đó click Create service. Chọn Cloud Run for Anthos.
  • External as the Connectivity 

Click CREATE để tạo Cloud Run.

3. Làm ly cafe nhâm nhi và kiểm thử thành quả

Từ Cloud Console, vào menu Kubernetes Engine và click Services & Ingress để lấy IP ingress

Kiểm thử thành quả bằng lệnh curl: curl http://*service-name*.*namespace*.example.com

Tuyệt vời, các bạn đã hoàn thành deploy cloud run trên Anthos.

Comments are closed.