Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can GCP's Cloud Run be used for non-HTTP services?

I'm new to GCP and trying to make heads and tails of it. So far, I've experienced with GKE and Cloud Run.

In GKE, I can create a Workload (deployment) for a service of any kind under any port I like and allocate resources to it. Then I can create a load balancer and open the ports from the pods to the Internet. The load balancer has an IP that I can use to access the underlying pods.

On the other hand, when I create a Could Run service, I'll give it a docker image and a port and once the service is up and running, it exposes an HTTPS URL! The port that I specify in Cloud Run is the docker's internal port and if I want to access the URL, I have to do that through port 80.

Does this mean that Cloud Run is designed only for HTTP services under port 80? Or maybe I'm missing something?

like image 724
Mehran Avatar asked Jul 26 '20 23:07

Mehran


People also ask

When should I use cloud run?

The best use cases for Cloud Run People who are targeting containers and container orchestration as their preferred platforms and are looking for serverless technology that's more container-native. Applications that require an HTTP server as part of the architecture, and the testing simplicity that comes with it.

What is the difference between App Engine and Cloud run?

While App Engine supports many different services within a single application, Cloud Functions support individualized services. It's an important detail when comparing Google App Engine vs Cloud Functions. If your requirements don't include multiple services then Cloud Functions is a great choice.

What are the 2 ways to run your code in Cloud run?

Services and jobs: two ways to run your code On Cloud Run, your code can either run continuously as a service or as a job. Both services and jobs run in the same environment and can use the same integrations with other services on Google Cloud.

Why would you use a cloud run association?

Cloud Run can help the users integrate continuous deployment and ensure better visibility and control over the containers. Cloud Run is suitable for apps that demand the use of HTTP servers as an integral part of their entire architecture.

Does your GCP architecture support microservices?

The landscape of cloud services in GCP offers many options for application architectures supporting microservices. By understanding the microservices offerings and tools available, you can find the right architecture and approach to successfully meet your requirements. Matthew Tyson is a founder of Dark Horse Group, Inc.

What is Google Cloud Run and how does it work?

Google services like Cloud Functions can be used to split a container’s functions into their own services (FaaS). With Cloud Run, you only pay for what you use. Billed time is broken down to the nearest 0.1 of a second.

What is Google’s new cloud service?

Surprising no one, Google has created another cloud service. If you’d like to run an already built application in the cloud, use Cloud Run. It is good for all-in-one software bundles, such as open source software or something like a simple Flask app.

Is Google Cloud run serverless or IaaS?

Like PaaS solutions, Google Cloud Run requires you to employ a stateless application architecture. As an abstraction of application infrastructure, platform as a service (PaaS) stands somewhere between IaaS and serverless. Although you will see Google App Engine referred to as serverless, it is fundamentally a PaaS.


1 Answers

Technically "no", Cloud Run cannot be used for non-HTTP services. See Cloud Run's container runtime contract.

But also "sort of":

  1. The URL of a Cloud Run service can be kept "private" (and they are by default), this means that nobody but some specific identities are allowed to invoked the Cloud Run service. See this page to learn more)
  2. The container must listen for requests on a certain port, and it does not have CPU outside of request processing. However, it is very easy to wrap your binary into a lightweight HTTP server. See for example the Shell sample that Uses a very small Go HTTP sevrer to invoke an arbitrary shell script.
like image 103
Steren Avatar answered Sep 29 '22 06:09

Steren