google-cloud-run

Gcloud - cloud run deployment fails for deployment to GKE

╄→尐↘猪︶ㄣ 提交于 2021-01-29 19:23:07
问题 I am trying to deploy a sample angular app to GKE. I created a sample cluster enabling cloud run and istio services in it gcloud beta container clusters create new-cluster \ --addons=HorizontalPodAutoscaling,HttpLoadBalancing,Istio,CloudRun \ --machine-type=n1-standard-2 \ --cluster-version=latest \ --zone=us-east1-b \ --enable-stackdriver-kubernetes --enable-ip-alias \ --scopes cloud-platform --num-nodes 4 --disk-size "10" --image-type "COS" Following is my cloudbuild.yaml file steps: #

Invoke a Google Cloud Run from java

牧云@^-^@ 提交于 2021-01-29 18:36:29
问题 I want to invoke a Cloud Run from an external application. The external application is written in Kotlin (java) and run on the JDK 11 JVM. It authenticates using a service account ServiceAccountCredentials.fromStream(serviceAccount).createScoped("https://www.googleapis.com/auth/cloud-platform") where the service account is is a valid JSON file. I have tested the permissions to invoke a cloud run for the service account inside the google cloud console. I have not found an official API so I

Google Cloud Run - Run Shell Script in firebase project

痴心易碎 提交于 2021-01-29 16:28:51
问题 I'm new to google cloud-run and I'm hoping to achieve to run scripts in the firebase project to update configs (env variables) here's the process firebase function invoked-> pass param(bar, baz) into cloud run -> run scripts firebase functions:config:set foo.bar=baz What I have done is to crate an image of firebase-tools shared by cloud-builders-community, and below is the code // cloudbuild.yaml steps: - name: 'gcr.io/cloud-builders/docker' args: ['build', '-t', 'gcr.io/$PROJECT_ID/firebase'

Google Cloud Run and golang goroutines

拟墨画扇 提交于 2021-01-29 11:30:06
问题 I'm considering Google Cloud Run for some cron-like operations I need to perform. They will get triggered by an HTTP invocation. The invocation will return (likely with a 202) and continue running in the background via a golang goroutine. But, I'm concerned that Google Cloud Run containers are destroyed when they're not handling HTTP requests. I could be part-way through my processing and get reaped. Is there a way to tell GCR to keep the container alive until I'm finished? 回答1: Cloud Run

Run a Python gRPC server on Google Cloud Run

妖精的绣舞 提交于 2021-01-29 11:23:34
问题 I have a basic, proof-of-concept Python gRPC server. When I run my docker container locally, I can make requests to the server and receive responses on the exposed port. I can successfully deploy the server to Cloud Run, and I see the service running in the Cloud Run UI. However, I am unable to access the Cloud Run version from a client. I am looking for suggestions to help me access this server, whether it is changes to the clients or the server. Client code: with grpc.insecure_channel('...

How do I configure the Service Account keys in a Cloud Run container?

大憨熊 提交于 2021-01-28 05:11:01
问题 I created a backend in Go, which uses the Secrets Manager, and deployed it to Cloud Run. The problem is the Secret Manager api needs a Service Account credential json file to point to and that works on my local machine because I just specify the file path in a GOOGLE_APPLICATION_CREDENTIALS environment variable, but I don't have the same convenience in a Cloud Run environment. How will my backend on Cloud Run specify its GOOGLE_APPLICATION_CREDENTIALS environment variable so to speak? 回答1:

Google Cloud Run only available in us-central1 region?

时间秒杀一切 提交于 2021-01-28 01:02:19
问题 I'm creating a new Cloud Run service on GCP as part of an app that's going to have users in Europe and Asia, and I'd like to add corresponding Europe and Asia endpoints, but I'm only seeing us-central-1 in the location dropdown list when creating the service. I could have sworn that there were options for Europe and Asia in that dropdown recently – am I wrong, or were they removed? 回答1: For the beta version, only us-central1 is available at this time. If you have signed up for the alpha

Accessing Cloud SQL from Cloud Run on Google Cloud

旧时模样 提交于 2021-01-27 18:21:47
问题 I have a Cloud Run service that accesses a Cloud SQL instance through SQLAlchemy . However, in the logs for Cloud Run, I see CloudSQL connection failed. Please see https://cloud.google.com/sql/docs/mysql/connect-run for additional details: ensure that the account has access to "<connection_string>" . Going to that link, it says that: "By default, your app will authorize your connections using the Cloud Run (fully managed) service account. The service account is in the format PROJECT_NUMBER

How to use ENV Variables Declared on Google Cloud Run Dashboard in React

孤人 提交于 2021-01-27 17:05:43
问题 I am deploying a create-react-app Service onto Google Cloud Run using a Dockerfile, but I want to move away from declaring env variables in a .env file, and instead, declare them on Google Cloud Run's Dashboard like so: However, when I call the env var using console.log("REDIRECT", process.env.REACT_APP_REDIRECT_URI) null is returned for any env variable I try to reference. Is there another step to access these variables that I am missing? Here is my Dockerfile: FROM node:10-alpine as react

How to use ENV Variables Declared on Google Cloud Run Dashboard in React

╄→гoц情女王★ 提交于 2021-01-27 17:02:01
问题 I am deploying a create-react-app Service onto Google Cloud Run using a Dockerfile, but I want to move away from declaring env variables in a .env file, and instead, declare them on Google Cloud Run's Dashboard like so: However, when I call the env var using console.log("REDIRECT", process.env.REACT_APP_REDIRECT_URI) null is returned for any env variable I try to reference. Is there another step to access these variables that I am missing? Here is my Dockerfile: FROM node:10-alpine as react