Google Cloud Platform command line Flashcards Preview

Google Cloud Platform Certified Associate Engineer > Google Cloud Platform command line > Flashcards

Flashcards in Google Cloud Platform command line Deck (54):
1

Command to list your projects that are accessible by the active account

gcloud projects list

2

Command to set the region for your project

gcloud config set compute/region “region name”

where "region name" is us-east1 or us-central1 or europe-west1

3

Command to set your default project

gcloud config set project myProjects

4

Command to set the zone for your project

gcloud config set compute/zone “zone name”

where "zone name" is us-central1-c, europe-west1-a

5

Command to list the zones where the compute service is available (i.e. us-central1-a, us-central1-b, europe-west1-a)

gcloud compute zone list

6

Command to secure shell into a virtual machine or compute instance

gcloud compute ssh “virtual-machine-name”

You can’t have spaces in the name so you must have it all one word or put dashes in

7

Command to list the regions where you can do Cloud Functions (AWS equivalent of Lambdas)

gcloud functions region list

8

Command to list all the URI (Uniform Resource Identifier) in a zone

gcloud compute zones list --uri

9

Command to list a project’s DNS info

gcloud dns projects-info describe

10

Command to provide detailed information about a project

gcloud compute project-info describe --project

11

Command to list credentialed accounts

gcloud auth list

12

Command to create a project

gcloud projects create [Project_ID]

Project_ID is different from the Project Name. It can't be changed but is still basically just a name with letters and numbers between 6 and 30 characters long

13

Command to create a project and also give it a name

gcloud projects create [Project_ID] --name="myProjectName"

14

Command to delete a project

gcloud projects delete [Project_ID]

15

Command to show metadata for a project

gcloud projects describe [Project_ID]

16

Command to get IAM policies for a project

gcloud projects get-iam-policy [Project_ID]

17

Command to add an IAM policy binding to the existing IAM policy of a project

gcloud projects add-iam-policy-binding [Project_ID] --member [Member] --role [Role]

18

Command to remove an IAM policy binding to the existing policy of a project

gcloud project remove-iam-policy-binding [Project_ID] --member=[Member] --role=[Role]

19

Command to set the IAM policy of a project (the initial step)

gcloud projects set-iam-policy [Project_ID] [Policy_File]

Policy_File is the YAML or JSON file that contains all of your IAM settings (the policy)

20

Command to update the name of a project

gcloud projects update [Project_ID] --name="the-new-project-name"

21

Command to install Stackdriver monitoring agent

curl -sSO https://dl.google.com/cloudagents/install-monitoring-agent.sh

22

Command to install Stackdriver logging agent

curl -sSO https://dl.google.com/cloudagents/install-logging-agent.sh

23

Command to create a deployment

gcloud deployment-manager deployments create [Deployment_Name] --config configfile.yaml --description "MyDeployment"

The --config and --description flags are optional

24

Command to delete a deployment

gcloud deployment-manager deployments delete [Deployment_Name]

25

Command to provide information about a deployment

gcloud deployment-manager deployments describe [Deployment_Name]

26

Command to list deployments associated with the current project

gcloud deployment-manager deployments list

27

Command to stop a currently running or pending operation on a deployment

gcloud deployment-manager deployments stop [Deployment_Name]

28

Command to update a deployment with new configuration information

gcloud deployment-manager deployments update [Deployment_Name] --config new_config_file.yaml

29

Command to reserve an IP address for your project

gcloud compute addresses create [name for address] --addresses [XX.XXX.XXX.XXX (the IP address you want)]

30

Command to get info on an IP address for your project

gcloud compute address describe [name of address]

31

Command to list IP address of your project

gcloud compute addresses describe

32

Command to create disks

gcloud compute disks create [Disk_Name] --zone us-east1-a

33

Gcloud disk commands

gcloud compute disks [command]

command can be create, delete, describe, list, move, resize, snapshot, update

34

Gcloud firewall rules commands

gcloud compute firewall-rules [command]

command can be create, delete, update, list, describe

35

Gcloud health-checks commands

gcloud compute health-checks [command]

command can be create, delete, update, list, describe
create and update can also have protocols with them

gcloud compute health-checks create [protocol]

protocol can be http, https, ssl, and tcp

36

Gcloud image related commands

gcloud compute images [command]

command can be create, delete, update, list, describe, add-labels, remove-labels, export, import

37

Gcloud instance template related commands

gcloud compute instance-templates [command]

command can be create, delete, list, describe

38

Gcloud instance related commands

gcloud compute instances [command]

command can be create delete, list, describe, start, stop, move, update, update-container

39

Gcloud commands to get project information

gcloud compute project-info [command]

command can be describe, update, add-metadata, remove-metadata, set-usage-bucket

40

Gcloud region commands

gcloud compute region [command]

command can be describe or list

41

Gcloud snapshot commands

gcloud compute snapshot [command]

command can be delete, describe, list, update, add-labels, remove-labels

42

Gcloud configuration commands

gcloud config [command]

command can be get-value, list, set, unset

It can also be configurations [subcommand]
where subcommand is activate, create, delete, describe, list

43

Gcloud builds commands

gcloud builds [command]

commands can be cancel, describe, list, log submit

44

Gcloud clusters commands

gcloud container clusters [command]

command can be create, delete, describe, get-credentials, list, resize update, upgrade

45

Gcloud node pool commands

gcloud container node-pools [command]

command can be create, delete, describe, list, rollback, update

46

Gcloud container operations commands

gcloud container operations [command]

command can be describe, list, wait

47

Gcloud container registry commands

gcloud container images [command]

command can be add-tag, delete, describe, list, list-tags, untag

48

Gcloud IAM roles commands

gcloud iam roles [command]

command can be copy, create, delete, describe, list, undelete, update

49

Gcloud IAM service account commands

gcloud iam service-accounts [command]

command can be create, delete, describe, list, update, add-iam-policy-binding, remove-iam-policy-binding, set-iam-policy, sign-blob

50

Kubernetes commands to create a pod with a yaml configuration file

kubectl create -f podinfo.yaml

51

Kubernetes command to get info about a resource

kubectl get [resource type]

resource type can be pods, deployment, replicationcontroler

52

Kubernetes command to create and run an image

kubectl run [name] --image=[image name]

53

Kubernetes command to expose a resource to a new Kubernetes service

kubectl expose [resource type] [resource name]

example:
kubectl expose pod valid-pod --port=444 --name=frontend

54

Kubernetes command to delete a resource

kubectl delete [resource] [resource name]

example: deletes pods and services with the label "myLabel"
kubectl delete pods,services -l name=myLabel