gcloud compute instances create gcelab --zone us-central1-c
gcloud compute disks create mydisk --size=200GB \
--zone us-central1-c
gcloud compute instances attach-disk gcelab --disk mydisk --zone us-central1-c
gcloud compute ssh gcelab --zone us-central1-c
# Step 1
sudo mkdir /mnt/mydisk
# Step 2
sudo mkfs.ext4 -F -E lazy_itable_init=0,lazy_journal_init=0,discard /dev/disk/by-id/scsi-0Google_PersistentDisk_persistent-disk-1
# Step 3
sudo mount -o discard,defaults /dev/disk/by-id/scsi-0Google_PersistentDisk_persistent-disk-1 /mnt/mydisk
docker build -t gcr.io/PROJECT_ID/hello-node:v1 .
docker run -d -p 8080:8080 gcr.io/PROJECT_ID/hello-node:v1
gcloud docker -- push gcr.io/PROJECT_ID/hello-node:v1
gcloud config set project PROJECT_ID
gcloud container clusters create hello-world \
--num-nodes 2 \
--machine-type n1-standard-1 \
--zone us-central1-a
kubectl run hello-node \
--image=gcr.io/PROJECT_ID/hello-node:v1 \
--port=8080
# To view the deployment, run:
kubectl get deployments
# To view the pod created by the deployment, run:
kubectl get pods
kubectl cluster-info
kubectl config view
kubectl get events
kubectl logs <pod-name>
kubectl expose deployment hello-node --type="LoadBalancer"
# To find the publicly-accessible IP address of the service, request kubectl to list all the cluster services:
kubectl get services
kubectl scale deployment hello-node --replicas=4
kubectl edit deployment hello-node
In Cloud Shell, run the following to move file yob2014.txt into your bucket. Replace <your_bucket> with the name of the bucket you just created:
gsutil cp yob2014.txt gs://<your_bucket>
Use the
bq ls
command to see whether your default project has any existing datasets.
# Create a new dataset
bq mk <data-set-name>
# Create table from txt file
bq load babynames.names2010 yob2010.txt name:string,gender:string,count:integer
echo project = [PROJECT_ID] > ~/.cbtrc
echo instance = quickstart-instance >> ~/.cbtrc
# Create a table named my-table
cbt createtable my-table
# Add one column family named cf1
cbt createfamily my-table cf1
# List your column families
cbt ls my-table
# Put the value test-value in the row r1, using the column family cf1 and the column qualifier c1:
cbt set my-table r1 cf1:c1=test-value
# Use the cbt read command to read the data you added to the table:
cbt read my-table
# Delete the table my-table:
cbt deletetable my-table