Google Cloud. | 1
Total Page:16
File Type:pdf, Size:1020Kb
google cloud. | 1 how the google cloud works. *this is a study guide that was created from lecture videos and is used to help you gain an understanding of how the google cloud works. Google Cloud Services Foundations GCP- google cloud platform compute for virtualization, storage and other services Compute Services- virtual machines, containers and container management (Docker) and functions and lambdas.serverless computing Storage Services- files, archival storage, persistent disks for virtual machines Data Services- NoSQL, RDBMS, Hadoop and Spark Big Data Services- data pipelines, data warehouses, data science notebooks, machine learning Other services- security and identity, management and monitoring from Stackdriver, developer tools Why Use Google Cloud?- Cloud services allow you to get to market faster. Scalable services save time for developers and DevOps. Automatic usage discounts equal less management of pricing. mind movement machine. google cloud. | 2 Automatic scaling- build app and has as many customers as possible without running out of resources. The default is autoscale until you put a limit. GCP is fast, has frequent improvements, autoscales massively and a good value. GCP has an engineering focus and has documentation challenges and pricing surprises. Gcutil is a tool that is a part of the SDK and is used from the command line. Use gmail account -> use free trial -> have credit card available Working with the console- Google Cloud Console is a browser or web page that gives you the ability to work with cloud services that are available on GCP. Google works best in Chrome. Setting the location, where physically are the virtual machines, databases and etc. This is called data center region. Within GCP, A top level or container is called a project, inside a project you enable services and you set what service should be running. Projects have three associated values: ID, name or number. Find this information on the bottom right on your GCP project page. Set a budget in GCP in the budgets & alerts tab to ensure you do not go over your spend. This is a crucial step when learning how the google cloud works. In GCP, you want to think about making the container for the services. You would create your project, enable API’s and then set up the tools. Most API’s are turned on but some you have to enable manually. mind movement machine. google cloud. | 3 Find API Services- GCP Console -> Home -> left side menu -> compute, storage, stackdriver, tools, big data Pin the menu tab for easy access to services you use. Enabling API’s- GCP Console -> API manager -> look to see which API’s are enabled. -> enable API -> Click the API you want to turn on -> Enable. You adjust API’s at the project level. Google Cloud Security IAM is Identity and Access Management, which is where you can manage user roles and permissions. You can set quotas to disable auto scaling. Adjust IAM- GCP Console -> menu -> IAM & Admin -> ‘compute engine’ is enabled by default -> Add or Edit Permissions of Users in this window -> Set Quotas in the left menu -> Create Service Account in left side menu. Service accounts are for services and IAM is for people or user accounts. GCloud Download GCP SDK -> start gcloud from your terminal and project folder -> authenticate to gcloud -> list or set your project. $ gloud version- command that will tell you the version of the client you have. Verify which version you have before you get started working. $ gcloud auth login- authenticates the user $ gcloud info –show-log – will show the log mind movement machine. google cloud. | 4 $ gcloud config set project (my-project-id> – you can set your projects $ gcloud init <my-project> – you can create a project Make sure you are at the directory where your project is stored locally Gcloud uses two dashes in arguments, copying and pasting can break the code. Set up command line access with gcloud- download mac file -> extract the file -> run the install script -> change directory to script -> run install script -> yes to set path -> set default -> close shell -> reopen shell and run $gcloud init command -> ->Login to Gmail to ensure you are authenticated -> return to terminal and run $gcloud version to see the working version Index into github by GCP for tutorials and code examples. – Google Cloud github GCP projects -> three dot menu on right side-> try an interactive tutorial -> select tutorial -> create a bucket on the google cloud for the tutorial GCP to AWS Reference- GCP vs AWS mind movement machine. google cloud. | 5 Google Cloud Platform Compute Services Virtual Machines, Containers and Functions Compute Services: App Engine, Compute Engine, Container Engine, Networking Google Compute Service is a cloud hosted virtual machine that is an infrastructure as a service. It is enabled by default. You can create a Google Cloud Engine instance using the Google Cloud Engine Console, you can also use gcloud or scripting to regenerate instances in production environments. You can then connect to a Lynx machine and will be able to connect to the SSH, you can then use your virtual machine. For production, you would set other networking options such as security and firewalls GCP Compute Engine -> create instance -> create -> connect via SSH Customize machine type to save budget, you can change the OS to other than Linux Machines. You can set firewall rules to allow HTTP or HTTPS traffic. Scripting, metadata, and preamptibility, which is used for batch processing, are all features of a GCP Compute Instance. Google Cloud Launcher Automation for launching customized virtual machines. These can be virtual machines with applications on the Compute Engine. These can be databases or components that are on preconfigured virtual machines. A deployment is a container for one or more services, used for reproducibility. Deployment manager prints output as deployment is occurring, it will take configuration and allow you to script it. The deployment manager wraps around the Google Compute Engine. mind movement machine. google cloud. | 6 Use Cloud Launcher for setting up an IDE- GCP Home -> cloud launcher -> developer tools -> eclipse Che (open source developer workspace server and cloud IDE) -> launch on compute engine -> deploy -> wait for admin password to populate and copy it -> login to admin panel with admin user and password -> software will run on VM -> you will then have a browser- based IDE to code in Java that is being made on a Google Cloud -> go to compute engine you can see the instance of the VM you are running. Google Compute Engine Instance Groups lets you setup virtual machines for load balancing. Load balancing is explained by letting you put how many instances that will be running and load balancing will monitor and send a health check to ensure you can create new instances with ease. Instance Templates can be used within Instance Groups. Compute and Storage are seperate. You will save money when Compute is turned off for instances you are not using. You can create a snapshot as a basis for a new VM. Metadata is used for tags. Health checks allow you to run health checks against your instances. Zones will explain how many instances you have in the zones, which is used when there are many VM’s you are using. Operations is everything that has happened for activity history. Quota is how much resources you are using. Deployment Manager -> click on deployment -> you can delete or adjust deployment of VM’s within deployment manager. Google Container Engine Application Virtualization is a more efficient method to store, compute and maintain certain mind movement machine. google cloud. | 7 applications. The hypervisor that is typically used for virtualization is replaced with the Docker Engine. This will remove the need for the guest OS to be put in each container. Container Engine is Google’s product and is Google’s implementation of Docker. Kubernetes for container management is used as a way to manage application virtualizations after being setup. Difference between containers and virtual machines- containers only need one operating system for as many containers. Containers still sit on top of virtual machines but they do not deal with a hypervisor to control the instances. Instead you use a container manager, which is the Container Engine for Google Cloud. Containers use caching and allows for quicker application scaling up. Containers are easier to replicate because the setup is in code that you can access. It is easier to use a container to replicate an application than a virtual machine. GCP Console Menu -> container engine -> create a container cluster -> fill out and create container cluster -> to see source code of container: GCP Console menu -> development A Dockerfile is a simple text file where you put the configuration of the container. GCP Console: Container engine, wait for cluster to complete with green check mark -> Access gcloud with button at top right -> (gcloud tool can be faster than authenticating through an installed client because you are logging into gcloud through being logged into your Google Console account) -> clobse sample code and paste into gcloud shell -> get gcloud credentials for clusters -> use docker command to build and push the application and bring down the image -> push ithe image into your cluster with a gcloud space docker push command (by mind movement machine. google cloud. | 8 pushing the image up, that is when application virtualization is happening) -> now that the image is in Kubernetes, use kubernetes control command to run the app from the image -> when you run kubernetes command to expose the deployed image then GCP will assign an external IP address to the container node, so you will be able to look at the service -> you can scale your application that containerized and running on the web -> use kubernetes commands to scale up and see if the scaling works.