<style>
img {
display: block;
margin-left: auto;
margin-right: auto;
}
</style>
# Google Cloud Computing Foundations: Cloud Computing Fundamentals
### So, what’s the cloud anyway?
:::info
**Objectives**
- Explore cloud computing.
- Compare and contrast physical, virtual, and cloud architectures.
- Differentiate infrastructure as a service (IaaS), platform as a service (PaaS), and software as a service (SaaS).
- Be introduced to Google Cloud compute, storage, big data, and ML services.
- Examine the Google network and how it powers cloud computing.
:::
---
**Cloud computing**
1. Customers get computing resources that are on-demand and self-service.
2. Customers get access to those resources over the internet, from anywhere they have a connection.
3. The provider of those resources has a large pool of them, and allocates them to users out of that pool.
4. The resources are elastic–which means they can increase or decrease as needed.
5. The customers pay only for what they use, or reserve as they go.
---
**The history of cloud computing**
1. Colocation
2. Virtualized data center
3. Container-based architecture
---
- IaaS offerings organized virtually into resources that are similar to physical data centers, providing
- raw compute
- storage
- network capabilities
- PaaS offerings bind code to libraries that provide access to the infrastructure applications need
- SaaS applications are not installed on your local computer; they run in the cloud as a service and are consumed directly over the internet by end users
In the IaaS model, customers pay for the resources they allocate ahead of time; in the PaaS model, customers pay for the resources they actually use.
---



---
**Quiz**
1. Which is a fundamental attribute of cloud computing? Customers get access to computing resources over the internet, from anywhere.
2. What is the fully automated, elastic third-wave cloud that consists of a combination of automated services and scalable data? Container-based architecture
3. Which service provides raw compute, storage, and network capabilities, organized virtually into resources that are similar to physical data centers? IaaS
4. Where are Google Cloud resources deployed? Zone
### Start with a solid platform
:::info
**Objectives**
- Explore the Google Cloud console.
- Examine how projects are the basis for enabling and using Google Cloud services.
- Identify how billing works in Google Cloud.
- Install and configure the Cloud SDK.
- Recognize the different use cases for using Cloud Shell and the Cloud Shell code editor.
- Explore how APIs work.
- Manage Google Cloud services from a mobile device.
:::
---
**Google Cloud console**.
- Simple web-based graphical user interface
- Easily find resources, check their health, have full management control over them, and set budgets.
- Provides a search facility to quickly find resources and connect to instances via SSH in the browser.
---


---

---

Configure the Cloud SDK use command `gcloud init`
---

---
**A Tour of Google Cloud Hands-on Labs**
:::success
**Insight**
1. Accessing the Cloud Console
2. Projects in the Cloud console
3. Roles and permissions
4. APIs and services
:::
---
**Getting Started with Cloud Shell and gcloud**
:::success
**Insight**
1. Configuring your environment
2. Filtering command-line output
3. Connecting to your VM instance
4. Updating the firewall
5. Viewing the system logs
:::
* Set the region to `us-west1`
```bash
gcloud config set compute/region us-west1
```
* To view the project region setting, run the following command
```bash
gcloud config get-value compute/region
```
* Set the zone to `us-west1-b`
```bash
gcloud config set compute/zone us-west1-b
```
* To view the project region setting, run the following command
```bash
gcloud config get-value compute/region
```
In Cloud Shell, run the following `gcloud` command, to view the project id for your project:
```bash
gcloud config get-value project
```
In Cloud Shell, run the following `gcloud` command to view details about the project:
```bash
gcloud compute project-info describe --project $(gcloud config get-value project)
```
Create an environment variable to store your Project ID:
```bash
export PROJECT_ID=$(gcloud config get-value project)
```
Create an environment variable to store your Zone:
```bash
export ZONE=$(gcloud config get-value compute/zone)
```
To create your VM, run the following command:
```bash
gcloud compute instances create gcelab2 --machine-type e2-medium --zone $ZONE
```
Command details
* `gcloud compute` allows you to manage your Compute Engine resources in a format that's simpler than the Compute Engine API.
* `instances create` creates a new instance.
* `gcelab2` is the name of the VM.
* The `--machine-type` flag specifies the machine type as e2-medium.
* The `--zone` flag specifies where the VM is created.
* If you omit the `--zone` flag, the `gcloud` tool can infer your desired zone based on your default properties. Other required instance settings, such as `machine type` and `image`, are set to default values if not specified in the `create` command.
To connect to your VM with SSH, run the following command:
```bash
gcloud compute ssh gcelab2 --zone $ZONE
```
And then Y. Enter twice.
Install `nginx` web server on to virtual machine:
```bash
sudo apt install -y nginx
```
You don't need to do anything here; so to disconnect from SSH and exit the remote shell, run the following command:
```bash
exit
```
Three basic ways to interact with Google Cloud services and resources are:
- Command-line interface
- Client libraries
- Cloud Console
---

**Quiz**
1. Which billing tool is designed to prevent the over-consumption of resources due to an error or a malicious attack? Quotas
2. Which project identifier does not need to be globally unique? Project name
3. Which command line tool is part of the Cloud SDK? gsutil
4. In the Google Cloud resource hierarchy, into which entity are resources organized? APIs allow code to be written to control Google Cloud services.
5. What is the purpose of APIs offered by various Google Cloud services? Projects
### Use Google Cloud to build your apps
:::info
**Objectives**
- Explore the role of compute options in the cloud.
- Learn about building and managing virtual machines.
- Examine building elastic applications using autoscaling.
- Explore PaaS options by leveraging App Engine.
- Examine building event-driven services using Cloud Functions.
- Identify containerizing and orchestrating applications with Google Kubernetes Engine.
- Identify developing and deploying scalable containerized applications with Cloud Run.
:::
---

---

---
**Creating a Virtual Machine**
:::success
**Insight**
1. Create a new instance from the Cloud console
2. Install an NGINX web server
3. Create a new instance with gcloud
4. Test your knowledge
:::
Set the project region for this lab:
```bash
gcloud config set compute/region us-central1
```
Create a variable for region:
```bash
export REGION=us-central1
```
Create a variable for zone:
```bash
export ZONE=us-central1-c
```
In the Cloud Shell, use `gcloud` to create a new VM instance from the command line:
```bash
gcloud compute instances create gcelab2 --machine-type e2-medium --zone=$ZONE
```
To see all the defaults, run:
```bash=
gcloud compute instances create --help
```
Through which of the following ways can you create a VM instance in Compute Engine? The Cloud console, The gcloud command line tool
---

---


---
**App Engine: Qwik Start - Python**
:::success
**Insight**
1. Enable Google App Engine Admin API
2. Download the Hello World app
3. Test the application
4. Make a change
5. Deploy your app
6. View your application
:::
**Quiz**
1. With Google App Engine, what do developers need to focus on? Application code
2. What modern language runtimes are supported by App Engine? All
3. What are other serverless platforms from Google Cloud that are similar to App Engine? Cloud Run, Cloud Functions
---


---
**Cloud Functions: Qwik Start - Command Line**
:::success
**Insight**
1. Create a function
2. Create a cloud storage bucket
3. Deploy your function
4. Test the function
5. View logs
:::
Serverless lets you write and deploy code without the hassle of managing the underlying infrastructure. True
---





---
**Kubernetes Engine: Qwik Start**
:::success
**Insight**
1. Set a default compute zone
2. Create a GKE cluster
3. Get authentication credentials for the cluster
4. Deploy an application to the cluster
5. Deleting the cluster
:::
---


---
**Quiz**
1. Which of these is a managed compute platform that lets you run stateless containers through web requests or Pub/Sub events? Cloud Run
2. What is the Compute Engine feature that allows VMs to be added to or subtracted from an application based on load metrics? Autoscaling
3. Which compute service would be considered IaaS? Compute Engine
4. Which of these is a lightweight, fully managed serverless execution environment for building and connecting cloud services? Cloud Functions
5. Which of these is a managed environment for deploying containerized apps? Google Kubernetes Engine
6. Which App Engine environment is based on preconfigured container instances? Standard environment