Posts

Showing posts with the label gcp

Google Kubernetes Engine (GKE) Quick Start on CLI

Google Cloud provides a nice quickstart guide for GKE: https://cloud.google.com/kubernetes-engine/docs/quickstart This post follows the steps on CLI. You need to install gcloud & kubectl as a pre-requisite. # enable GKE % gcloud services enable container.googleapis.com % gcloud services list | grep -i 'kube' container.googleapis.com          Kubernetes Engine API # config gcloud % gcloud config set project YOUR_PROJECT_ID % gcloud config set compute/zone us-west1-a % gcloud config set compute/region us-west1 # create cluster (few minutes) % gcloud container clusters create hello-cluster --num-nodes=1 % gcloud container clusters list NAME           LOCATION    MASTER_VERSION   MASTER_IP     MACHINE_TYPE  NODE_VERSION     NUM_NODES  STATUS hello-cluster  us-west1-a  1.18.17-gke.100  35.230.17.63  e2-medium     1.18.17-gke.100  1...

Google Compute Engine - Create Apache Server (Terraform)

In this post, I am going to create an apache web server on Google Compute Engine using Terraform. Related: GCE (Browser): https://web-quickstart.blogspot.com/2021/05/google-compute-engine-create-apache.html EC2 (Terraform): https://web-quickstart.blogspot.com/2021/04/terraform-ec2-instance-with-ssh-setup.html auth gcloud auth application-default login image Get the list of images: % gcloud compute images list | egrep 'NAME|centos' NAME                                                  PROJECT              FAMILY                            DEPRECATED  STATUS centos-7-v20210512                                    centos-cloud         centos-7...

Google Compute Engine - Create Apache Server (Browser)

Image
In this post, I am going to create an apache web server on Google Compute Engine from a browser. See  https://web-quickstart.blogspot.com/2021/05/blog-post.html for Terraform equivalent. create & ssh https://console.cloud.google.com/ > Compute Engine > VM Instances If you have not enabled the feature yet, it will ask you to ENABLE it. Click on CREATE INSTANCE I have configured as follows: Name: instance-1 (default) Labels: - (default) Region: us-central1 (default) Region: us-central1-a (default) Machine type: e2-micro ( changed ) Boot disk: CentOS 7 ( changed ) Confidential VM service: unchecked (default) Container: unchecked (default) Identity and API access: default service account (default) Allow HTTP traffic: checked ( changed ) Allow HTTPS traffic: checked ( changed ) > Create > (after a few seconds) > instance-1 > SSH A new window opens for ssh session setup apache sudo yum install httpd sudo systemctl start httpd sudo systemctl status httpd curl i...

Google App Engine - Hello World in Python

In this post, I am going to try using Google App Engine to run the hello-world app in  https://cloud.google.com/appengine/docs/standard/python3/quickstart  . Cloud Function vs App Engine Unlike AWS equivalents ( reference ), the hello-world samples are very similar for both Cloud Function and App Engine. Here is the decision tree in case you wonder the difference: https://cloud.google.com/blog/products/compute/choosing-the-right-compute-option-in-gcp-a-decision-tree init app % gcloud app create ... Please enter your numeric choice: 2 (asia-northeast1=Tokyo) ... Success! install gcloud component % gcloud components install app-engine-python get sample app % git clone https://github.com/GoogleCloudPlatform/python-docs-samples % cd python-docs-samples/appengine/standard_python3/hello_world % cat main.py run locally % pip install  -r requirements.txt % python main.py % curl http://localhost:8080 deploy % gcloud app deploy % gcloud app browse

Google Cloud Function - Hello World (gcloud)

In this post, I am going to create a test Cloud Function on CLI, based on the tutorial:  https://cloud.google.com/functions/docs/tutorials/http  . For the browser equivalent, see Google Cloud Function - Hello World (Browser) . install gcloud The CLI tool is included in the Google Cloud SDK. % brew install google-cloud-sdk % source /usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/path.zsh.inc % gcloud --version Google Cloud SDK 339.0.0 bq 2.0.67 core 2021.04.30 gsutil 4.61 init config & create project % gcloud init You must log in to continue. Would you like to log in (Y/n)?  Y Pick cloud project to use: (Create a new project) Enter a Project ID: foo20210509 Check the status: % gcloud config configurations list % gcloud config list enable billing "This command is currently in ALPHA and may change without notice" ( https://cloud.google.com/sdk/gcloud/reference/alpha/billing ) % gcloud alpha billing accounts list ACCOUNT_ID          ...

Google Cloud Function - Hello World (Browser)

Image
start free trial Access the dashboard ( https://console.cloud.google.com/ ) and login as your google account. "New customers get $300 in free credits to spend on Google Cloud" as of 2021-05-09. I used Google App Engine around 10 years ago, but was eligible for this trial. You can check the free trial status on the upper right side of the dashboard. create project & cloud function dashboard > select project > new project > project name = foobar > create > cloud functions > create function > allow unauth > save > next > "Cloud Build API is required to use the runtime selected" > enable api > enable > [back to function page] > (choose a programming language) > deploy (this will take around 2 min) > [function-name] > trigger > click on url You should see the hello-world message.

List of Major Computing Services on AWS, GCP, and Azure

Here are some of the major services for cloud computing:  AWS GCP Azure other FaaS Lambda Cloud Functions Azure Functions k8s EKS GKE AKS PaaS Elastic Beanstalk GAE App Service Heroku IaaS EC2 GCE Virtual Machine Note: each hyperlink is for the related post in this blog. Pricing: Each provider/service has a free trial option under limited usage. They are categorized into Few-months Free or Always Free . FaaS and PaaS tends to have more Alway Free options, probably because of higher chances of vendor lock-in. The k8s services provide the control plains which are free or very cheap, but you need to pay for the worker nodes.