

GCP常用命令(gcloud、gsutil)
source link: https://www.pkslow.com/archives/gcp-commands
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

低声问向谁行宿,城上已三更。
gcloud
Config
初始化配置:
gcloud init
列出配置信息:
gcloud projects list
gcloud auth list
gcloud config list
gcloud config set project 'projectId'
gcloud config set account 'ACCOUNT'
使用Json授权ServiceAccount:
gcloud auth activate-service-account --key-file xxxx.json
获取GKE Cluster鉴权信息:
gcloud container clusters get-credentials 'cluster-name' --region=xxx
安装Components:
gcloud components install beta
compute
gcloud compute instances list
gcloud compute instance-groups list
gcloud compute instance-templates list
SSH连接:
gcloud compute ssh example-instance --zone=us-central1-a
gcloud compute ssh example-instance --zone=us-central1-a --command="ps -ejH"
Pub/Sub相关
列出Topic和subscriptions:
gcloud pubsub topics list
gcloud pubsub subscriptions list
创建 ID 为 my-topic
的主题:
gcloud pubsub topics create my-topic
创建 ID 为 my-sub
的订阅,并将其附加到 my-topic
:
gcloud pubsub subscriptions create my-sub --topic=my-topic
将消息发布到 my-topic
:
gcloud pubsub topics publish my-topic --message="hello"
接收来自 my-sub
的消息:
gcloud pubsub subscriptions pull my-sub --auto-ack
gcloud
工具会将消息输出到命令行。
gsutil
列出项目的buckets:
gsutil ls gs://
列出bucket文件:
gsutil ls gs://<bucketName>
复制文件:
gsutil cp localFile gs://xxx
gsutil cp gs://xxx localPath
欢迎关注微信公众号<南瓜慢说>,将持续为你更新...
推荐阅读:
如何制定切实可行的计划并好好执行
容器技术(Docker-Kubernetes)
SpringBoot-Cloud相关
Https专题
- 本文作者: 南瓜慢说
- 本文链接: https://www.pkslow.com/archives/gcp-commands
- 版权声明: 本博客所有文章除特别声明外,不可转载!
Recommend
-
39
Scripting with gcloud: a beginner’s guide to automating GCP tasks 2018-10-27adminGoogleCloud
-
14
Google Cloud Functions Tutorial : Using gcloud ToolThis is part of a Google Cloud Functions Tutorial Series. Check out th...
-
26
All Posts GCloud 命令行工具常用操作 @SOLUTION· 2021-08-24 23:15 · 14 min read 安装 GCloud 工具下载安装包:
-
7
How to install gcloud GCP cli on Apple M1 macOSSearch ComputingForGeeksIn this brief tutorial, we are going...
-
5
技术之前,先读诗书:风日晴和人意好,夕阳箫鼓几船归。 Introduction GCP(Google Cloud Platform) is a great platform, it provides many free Tier products for us to...
-
4
1 Introduction GKE(Google Kubernetes Engine) is a k8s platform, we can use gcloud to create a GKE cluster. For GCP initiation, can go to: How to initiate the GCP project and u...
-
24
技术之前,先读诗书:五月畲田收火米,三更津吏报潮鸡。 1 Introduction We always need to create the GCE(Google Compute Engine) if we use GCP. There are many ways t...
-
9
如果要选择GCP为云平台,则经常需要创建GCE(Google Compute Engine),有以下几种方式: (1) 在浏览器创建 (2) 命令 gcloud (3) Terraform 在开始之前,可以查看:《
-
3
Nix: Streaming gsutil transfers less than 1 minute read...
-
8
0.1. References 0.2. Other cheatsheets https://cloud.google.com/sdk/docs/cheatsheet 0.3. Manage multiple gcloud config configuration...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK