Skip to content

sanket9006/Google-Cloud-Commands

Repository files navigation

Google-Cloud-Commands (Cloud Shell)

image

Cloud Shell comes preinstalled with specific command line tools. The main GCP toolkit is gcloud, which is used for many tasks on the platform, like resource management and user authentication

Setting up prebuild E-Commerce website using Google Cloud and GitHub

cd ~
git clone https://github.com/googlecodelabs/monolith-to-microservices.git
cd ~/monolith-to-microservices
./setup.sh

Create Cluster

gcloud container clusters create io
gcloud container clusters create fancy-cluster --num-nodes 3 
    
Created GKE cluster named fancy-cluster with 3 nodes

List out all present instances

    > gcloud compute instances list

In Cloud Shell, set the default zone:

gcloud config set compute/zone us-central1-a

Set the default region:

gcloud config set compute/region us-central1

Download any file using wget

sudo wget https://launcher.mojang.com/v1/objects/d0d0fe2b1dc6ab4c65554cb734270872b72dadd6/server.jar

Create Bucket

gsutil mb gs://<BUCKET_NAME>

gsutil mb gs://2b1dc6ab4c65554cb73

Copy files to Bucket

gsutil cp [MY_FILE] gs://[BUCKET_NAME]

gsutil cp setup.html gs://2b1dc6ab4c65554cb73

list the available VPC networks

gcloud compute networks list

Make Copy

cp setup.html setup2.html

cp setup.html setup3.html

To list the available VPC subnets

gcloud compute networks subnets list --sort-by=NETWORK

Set time zone subnets

gcloud config set compute/zone us-central1-b

Create Virtual Machine Instance

gcloud compute instances create gcelab2 --machine-type n1-standard-2 --zone us-central1-c

List the files in our current directory

ls

To edit a file

nano filename.txt

output the contents of a file

cat filename.txt

update your OS

apt-get update

Install NGINX

apt-get install nginx -y

Check that NGINX is running

ps auwx | grep nginx

To disconnect from SSH

exit

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages