gcloud

not able to perform gcloud init inside dockerfile

风格不统一 提交于 2019-12-03 12:51:11
I have made a Dockerfile for deploying my node.js application into google container engine .It looks like as below FROM node:0.12 COPY google-cloud-sdk /google-cloud-sdk RUN /google-cloud-sdk/bin/gcloud init COPY bpe /bpe CMD cd /bpe;npm start I should use gcloud init inside Dockerfile because my node.js application is using gcloud-node module for creating buckets in GCS . When i am using the above dockerfile and doing docker built it is failing with following errors sudo docker build -t gcr.io/[PROJECT_ID]/test-node:v1 . Sending build context to Docker daemon 489.3 MB Sending build context to

ERROR: (gcloud.compute.ssh) Could not fetch resource: - Insufficient Permission

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 12:45:44
问题 I am having trouble working through the Compute Engine Quickstart: Build a to-do app with a MongoDB tutorial. (edit: I am running the tutorial from within the compute engine console; i.e. https://console.cloud.google.com/compute/instances?project=&tutorial=compute_quickstart) I SSH into the backend instance. I enter the "gcloud compute" command as copied from the tutorial. I am prompted to enter a passphrase. The following is returned: WARNING: The public SSH key file for gcloud does not

Exposing two ports in Google Container Engine

我们两清 提交于 2019-12-03 11:54:49
Is it possible to create a Pod in the Google Container Engine where two ports are exposed: port 8080 is listening for incoming content and port 80 distributes this content to clients? The following command to create a Pod is given as example by Google: kubectl run hello-node --image=gcr.io/${PROJECT_ID}/hello-node --port=8080 I can't seem to define a listening port, and when adding a second "--port=" switch only one port is exposed. Is there a way to expose a second port or am I limited to one port per container? caesarxuchao No, you cannot specify multiple ports in kubectl run . But you can

How do I list all IAM users for my Google Cloud Project

倖福魔咒の 提交于 2019-12-03 11:02:09
I'd like to be able to list all users and service account associated with my projects (preferably using the gcloud CLI tool, but happy to make an API call if needs be). I can easily list all the service accounts associated with a project using this , but how can list all the users too? I'd expect something like the following, but I cannot see anything in the doco: gcloud beta iam users list List all service accounts in a project The following command lists all service accounts associated with a project: $ gcloud iam service-accounts list NAME EMAIL Compute Engine default service account

gcloud app deploy, flag to automate prompting?

二次信任 提交于 2019-12-03 09:18:48
Is it possible to do silent deployment when using gcloud app deploy When I run the command gcloud app deploy ./deployment/app.yaml --version v1 its always prompting for Do you want to continue (Y/n)? Y how to automate this? is there any flag that we can pass in to mute this? You're looking for the --quiet flag, available across all gcloud commands: $ gcloud --help --quiet, -q Disable all interactive prompts when running gcloud commands. If input is required, defaults will be used, or an error will be raised. 来源: https://stackoverflow.com/questions/38862567/gcloud-app-deploy-flag-to-automate

bq cmd query Google Sheet Table occur “Access Denied: BigQuery BigQuery: No OAuth token with Google Drive scope was found” Error

∥☆過路亽.° 提交于 2019-12-03 06:23:56
I have a table connect with Google Sheet, use WebUI query this table success, but if I use bq cmd query, It will echo error msg: Access Denied: BigQuery BigQuery: No OAuth token with Google Drive scope was found I presume you are using bq command line tool which comes with Cloud SDK . To use bq you had to procure credentials, most likely you used gcloud auth login By default these credentials do not get drive scope. You have to explicitly request it via gcloud auth login --enable-gdrive-access Now running bq to access Google Drive data should work. Chances are the ' https://www.googleapis.com

Uploading a buffer to google cloud storage

懵懂的女人 提交于 2019-12-03 05:48:57
I'm trying to save a Buffer (of a file uploaded from a form) to Google Cloud storage, but it seems like the Google Node SDK only allows files with a given path to be uploaded (Read / Write streams). This is what I have used for AWS (S3) - is the anything else similar in the Google node SDK?: var fileContents = new Buffer('buffer'); var params = { Bucket: //bucket name Key: //file name ContentType: // Set mimetype Body: fileContents }; s3.putObject(params, function(err, data) { // Do something }); The only way that I have found to do it so far is write the buffer to disk, upload the file using

How to update Google Cloud DNS with ephemeral IP for an instance

戏子无情 提交于 2019-12-03 03:10:51
I have couple of instances on GCE that I don't really need static addresses for, but I still need to make them accessible via dns name. Since ephemeral external ip addresses change every time an instance is restarted, I thought that I could use some sort of startup script to update dns entry for that instance in Google Cloud DNS (a bit like dyndns). Did I miss something and there is an easier way to map ephemeral external ip addresses to a dns record via gcloud? If not, any pointers on how to write such script would be highly appreciated! The following assumes that you are using Google Cloud

ERROR: (gcloud.compute.ssh) Could not fetch resource: - Insufficient Permission

纵然是瞬间 提交于 2019-12-03 02:23:01
I am having trouble working through the Compute Engine Quickstart: Build a to-do app with a MongoDB tutorial. (edit: I am running the tutorial from within the compute engine console; i.e. https://console.cloud.google.com/compute/instances?project= &tutorial=compute_quickstart) I SSH into the backend instance. I enter the "gcloud compute" command as copied from the tutorial. I am prompted to enter a passphrase. The following is returned: WARNING: The public SSH key file for gcloud does not exist. WARNING: The private SSH key file for gcloud does not exist. WARNING: You do not have an SSH key

How to change the project in gcp using cli commands

老子叫甜甜 提交于 2019-12-03 00:35:42
问题 How can i change the current running project to another project in GCP ( Google Cloud Platform ) account using cli commands other than using gcloud init manually. $gcloud projects list will list the projects running on my account. I want to change the current project to any other project from the list using a cli command. 回答1: gcloud config set project my-project You may also set the environment variable $CLOUDSDK_CORE_PROJECT . 回答2: Make sure you are authenticated with the correct account: