gcloud

How can I verify that I'm using the correct project ID in Google Cloud

▼魔方 西西 提交于 2020-02-07 03:07:05
问题 I just created a virtual instance using Google Cloud but I have three projects and it assigned the instance to the wrong project. It really looks like this is a bug but how I can I be sure that the fault lies with Google and not me. Also, someone is inevitably going to advise me to use the cloud console to create instances so let me preempt that advice. I'm trying to get all of my cloud computing down to the click of one button. I plan on regularly creating and destroying instances and I have

“gcloud auth configure-docker” on GCP VM instance with Ubuntu not setup properly?

醉酒当歌 提交于 2020-02-02 04:32:27
问题 I created a VM instance on GCP using Ubuntu 18.10. When I SSH the VM without any modification and try: gcloud info I got some Warning: System PATH: [/snap/google-cloud-sdk/66/usr/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/game s:/snap/bin] Python PATH: [/snap/google-cloud-sdk/66/lib/third_party:/snap/google-cloud-sdk/66/lib:/snap/google-cloud-sdk/66/usr/lib/python2.7/:/snap /google-cloud-sdk/66/usr/lib/python2.7/plat-x86_64-linux-gnu:/snap/google

Difference between “gcloud auth application-default login” and “gcloud auth login”

£可爱£侵袭症+ 提交于 2020-01-30 23:46:49
问题 What is the difference between gcloud auth application-default login vs gcloud auth login ? Despite the definitions below, it is still hard to differentiate them. gcloud auth application-default login - acquire new user credentials to use for Application Default Credentials gcloud auth login - authorize gcloud to access the Cloud Platform with Google user credentials When should I use one over the other? 回答1: The difference is the use cases: As a developer, I want to interact with GCP via

Difference between “gcloud auth application-default login” and “gcloud auth login”

你。 提交于 2020-01-30 23:45:32
问题 What is the difference between gcloud auth application-default login vs gcloud auth login ? Despite the definitions below, it is still hard to differentiate them. gcloud auth application-default login - acquire new user credentials to use for Application Default Credentials gcloud auth login - authorize gcloud to access the Cloud Platform with Google user credentials When should I use one over the other? 回答1: The difference is the use cases: As a developer, I want to interact with GCP via

How to connect and access Google Cloud Compute Engine VM via Python 3.6

懵懂的女人 提交于 2020-01-30 04:04:51
问题 I want to access the Google Cloud Compute Engine VM using Python 3.6 and I need to perform normal CLI actions like remote machine. I am able to login to the VM instance via gcloud command, which is produced in VM instance's page manually, and I am able to use googleapiclient.discovery Python module to do some operations like list instances, create instances and delete instances. But, I am not able to login to the VM instance and access, e.g. like remote machine via Python. Please direct me to

gcloud does not add access token for connecting to GKE cluster

久未见 提交于 2020-01-25 10:16:09
问题 I created a GKE cluster and to connect to it with kubectl ran the command that appears when clicked on Connect button against my cluster. gcloud container clusters get-credentials cluster-name --zone us-central1-a --project project-id In $HOME/.kube/config I see entries as below: - name: cluster-name user: auth-provider: config: cmd-args: config config-helper --format=json cmd-path: /usr/lib64/google-cloud-sdk/bin/gcloud expiry-key: '{.credential.token_expiry}' token-key: '{.credential.access

Logging into GCP SQL: How to Ensure PromptSession Is Imported or Otherwise Resolve

风流意气都作罢 提交于 2020-01-25 07:28:06
问题 I am trying to use the Cloud Shell to update some user permissions. I am logging in using gcloud sql connect my-instance --user=root gcloud sql connect my-instance Whitelisting your IP for incoming connection for 5 minutes...done. Connecting to database with SQL user [sqlserver].******************************************************************************** Python command will soon point to Python v3.7.3. Python 2 will be sunsetting on January 1, 2020. See http://https://www.python.org/doc

mysql client connection gcloud

情到浓时终转凉″ 提交于 2020-01-24 04:26:10
问题 I have installed gcloud client library but GCP keeps on giving me this error what could the issue ERROR: (gcloud.sql.connect) Mysql client not found. Please install a mysql client and make sure it is in PATH to be able to connect to the database instance 回答1: The problem is that either you have not installed the MySQL client locally, or gcloud can't find it. If you have not installed MySQL yet, follow the instructions to do so. If you have installed MySQL but you're still getting this error,

Keep getting permissions error gcloud.container.clusters.get-credentials

给你一囗甜甜゛ 提交于 2020-01-24 03:47:05
问题 I am trying to integrate CircleCi with gcloud Kubernetes engine. I created a service account with Kubernetes Engine Developer and Storage Admin roles. Created CircleCi yaml file and configured CI. Part of my yaml file includes: docker: - image: google/cloud-sdk environment: - PROJECT_NAME: 'my-project' - GOOGLE_PROJECT_ID: 'my-project-112233' - GOOGLE_COMPUTE_ZONE: 'us-central1-a' - GOOGLE_CLUSTER_NAME: 'my-project-bed' steps: - checkout - run: name: Setup Google Cloud SDK command: | apt-get

How can curl authenticate to Google Cloud based on local gcloud's CLI authentication?

限于喜欢 提交于 2020-01-24 00:36:08
问题 My script uses a sequence of gcloud commands and of course gcloud is authenticated. I need to use curl to access GCP REST APIs that are not available to gcloud. I can do this by generating a JSON credentials file in the Cloud Console, but I'd rather not do that as a separate manual step. This is how I do it now, using a JSON file downloaded from the Console. GOOGLE_APPLICATION_CREDENTIALS=credentials.json curl -X POST -H "Authorization: Bearer \"$(gcloud auth application-default print-access