Week 1: Google Cloud and Kubernetes Architecture

Spread the love

This module gives an initial grounding in the concepts of cloud computing and the global infrastructure of Google Cloud. It introduces its most important components, for example, regions and zones, in addition to how to organize and manage resources within Google Cloud; familiarizes you with those tools that connect to Google Cloud, allocate, and effectively manage resources.

Learning Objectives

  • Understanding Course Structure: Understand the course framework and progress.
  • Identify Google Cloud Services: Learn about different services and their functions on Google Cloud.
  • Choose the Right Services: Acquire skills to choose appropriate Google Cloud services to build your cloud solution.
  • Build a container: Use Cloud Build to build a container and deploy it to the Container Registry.
  • Kubernetes and GKE: Understand the relationship between Kubernetes and Google Kubernetes Engine (GKE).
  • Architectures of Kubernetes: Understand the architecture of Kubernetes and components.
  • Deploy Kubernetes Cluster: Setting and deploying a Kubernetes cluster with Google Kubernetes Engine (GKE).
  • Deploy Pods to GKE: Understand how to deploy and manage Pods within a GKE cluster.
  • Manage Kubernetes Objects: Experience managing many Kubernetes objects within the GKE environment.

CLOUD COMPUTING AND GOOGLE CLOUD

1. Which statements are true about cloud computing? Mark all that are true (2 correct answers).

  • Customers who need more resources can get them rapidly. (CORRECT)
  • Customers pay for the resources they use or reserve. (CORRECT)
  • Cloud computing providers dedicate particular physical resources to particular customers.
  • Human intervention is required to stop using cloud resources once reserved, and payment continues until the change is confirmed.

2. Which of these Google Cloud compute services provides environments for execution of code, in which users don’t have to worry about infrastructure management? Choose all that are correct (2 correct answers).

  • Cloud Functions (CORRECT)
  • Correct
  • Compute Engine
  • Google Kubernetes Engine
  • App Engine (CORRECT)

RESOURCE MANAGEMENT

1. Within which of these Google Cloud geographic scopes are network latencies generally less than 1 millisecond? Choose all that are correct (2 correct answers).

  • Region (CORRECT)
  • Multi-Region
  • Global
  • Zone (CORRECT)

2. What type of resource is a Compute Engine virtual machine?

  • Zonal (CORRECT)
  • Regional
  • Multi-regional
  • Global

Correct: Cloud Spanner is a global relational database with all the features required for high availability. Multi-regional instances guarantee guaranteed monthly up-times of >99.999%, helping to provide reliable performance for and remove downtime associated with critical applications.

3. What is the base-level organizing entity for creating and using Google Cloud resources and services?

  • Project (CORRECT)
  • Region
  • Cluster
  • Folder

Correct: Cloud Spanner is indeed a global and highly available relational database that meets every requirement set out for having such capabilities. Its multi-regional instances guarantee performance greater than or equal to 99.999% uptime every month, making it dependable for mission-critical applications.

BILLING

1. At what level in the Google Cloud resource hierarchy is billing set up?

  • Project (CORRECT)
  • Folder
  • Organization
  • Individual users

2. Which type of quota resets at regular intervals?

  • Rate quotas (CORRECT)
  • Allocation quotas

INTRODUCTION TO GOOGLE CLOUD

1. You are considering deploying a solution using containers on Google Cloud. What Google Cloud solutions are available to you that will provide a managed compute platform with native support for containers?

  • Compute Engine Autoscaling Groups
  • Google Kubernetes Engine Clusters (CORRECT)
  • Container Registry
  • Cloud Functions

Correct: Availability is the metric which determines the time spans when a system is up and actually takes requests. It is necessary to track this for purposes of the Service Level Objective (SLO); in other words, to draw the line of acceptable system performance or uptime.

2. You are ready to start work building an application in Google Cloud. What IAM hierarchy should you implement for this project?

  • Create a new folder inside your organization and create projects inside that folder for the resources. (CORRECT)
  • Create new projects for each of the component applications and create folders inside those for the resources.
  • Create a new organization for the project and create all projects and resources inside the new organization.
  • Create new projects and resources inside departmental folders for the resources needed by the component applications.

3. You are developing a new product for a customer and need to implement control structures in Google Cloud to help manage the Google Cloud resources consumed by the product and the billing for the customer account. What steps should you take to manage costs for this product and customer?

  • Configure the billing account at the product folder level in the resource hierarchy.
  • Configure the billing account for each project associated with the product.
  • Set up budgets and alerts at the project level for the product. (CORRECT)
  • Configure quotas and limits for the product folders.

Correct: A canary deployment strategy has been designed to mitigate risk by releasing an update to a select few users initially so that the team can test new features in a contained environment before rolling them out to everyone. Problems can be detected early and remedial action taken, and without the need to roll back all users.

4. You need to write some automated scripts to run periodic updates to the resources in your Google Cloud environment. What tools can you install in your own computers to allow you to run those scripts?

  • The Google Cloud Console
  • The Cloud SDK (CORRECT)
  • The Cloud Console Mobile app
  • The Cloud Shell

5. One of the key characteristics of cloud computing is the concept of measured service. What is the primary customer benefit of the measured service aspect of cloud computing?

  • Resources can be allocated automatically.
  • You pay only for the resources you consume. (CORRECT)
  • You share resources from a large pool enabling economies of scale.
  • You can get more resources as quickly as you need them.

6. Which of these ways to interact with give you access to the gcloud and kubectl commands? Choose all that are correct (2 correct answers).

  • Cloud Shell (CORRECT)
  • Cloud SDK (CORRECT)
  • Console
  • Cloud Console mobile app

CONTAINERS AND CONTAINER IMAGES

1. Why do Linux containers use union file systems?

  • To control an application’s ability to see parts of the directory tree and IP addresses
  • To efficiently encapsulate applications and their dependencies into a set of clean, minimal layers  (CORRECT)
  • To control an application’s maximum consumption of CPU time and memory
  • To give a container its own virtual memory address space

2. What is significant about the topmost layer in a container? Choose all that are true (2 correct answers).

  • Reading from or writing to the topmost layer requires special privileges.
  • The topmost layer’s contents are ephemeral. When the container is deleted, the contents will be lost. (CORRECT)
  • Reading from or writing to the topmost layer requires special software libraries.
  • An application running in a container can only modify the topmost layer. (CORRECT)

3. Which of these problems are containers intended to solve? Mark all that are correct (3 correct answers),

  • Large monolithic applications that need to be run in the cloud.
  • It’s difficult to troubleshoot applications when they work on a developer’s laptop but fail in production. (CORRECT)
  • Packaging applications in virtual machines can be wasteful. (CORRECT)
  • Applications need a way to isolate their dependencies from one another. (CORRECT)

CONTAINERS AND KUBERNETES IN GOOGLE CLOUD

1.You are choosing a technology for deploying applications, and you want to deliver them in lightweight, standalone, resource-efficient, portable packages. Which choice best meets those goals?

  • Containers (CORRECT)
  • Hypervisors
  • Executable files
  • Virtual Machines

2. You are classifying a number of your applications into workload types. Select the stateful applications in this list of applications. Choose the TWO responses that are correct.

  • A shopping application that saves user shopping cart data between sessions. (CORRECT)
  • Image recognition application that identifies product defects from images.
  • Web server front end for your inventory system.
  • A gaming application that keeps track of user state persistently. (CORRECT)

3. Google Compute Engine provides fine-grained control of costs. Which Compute Engine features provide this level of control? (Choose TWO)

 
  • Per-second billing (CORRECT)
  • Autoscaling groups
  • Fully customizable virtual machines (CORRECT)
  • That is correct.
  • Billing budgets and alerts
  • Managed instance groups

4. You are deploying a containerized application, and you want maximum control over how containers are configured and deployed. You want to avoid the operational management overhead of managing a full container cluster environment yourself. Which Google Cloud compute solution should you choose?

  • Google Kubernetes Engine (CORRECT)
  • Compute Engine
  • App Engine
  • Cloud Functions

5. What is the relationship between Kubernetes and Google Kubernetes Engine?

  • Google Kubernetes Engine is Kubernetes as a managed service. (CORRECT)
  • Google Kubernetes Engine is a closed-source variant of Kubernetes.
  • Kubernetes and Google Kubernetes Engine are two names for the same thing.

6. What is the name for the computers in a Kubernetes cluster that can run your workloads?6

  • Nodes (CORRECT)
  • Container images
  • Containers
  • Control Planes

7. Which of the following supports scaling a Kubernetes cluster as a whole?

  • Kubernetes
  • Google Kubernetes Engine (CORRECT)
  • Compute Engine

8. When you use Kubernetes, you describe the desired state you want, and Kubernetes’s job is to make the deployed system conform to your desired state and to keep it there in spite of failures. What is the name for this management approach

  • Imperative configuration (CORRECT)
  • Declarative configuration
  • Containerization
  • Virtualization

9. What is a stateful application?

  • An application that is not containerized
  • A web front end
  • An application that requires user and session data to be stored persistently (CORRECT)

THE KUBERNETES CONTROL PLANE

1. Which control plane component is the only one with which clients interact directly?

  • kube-apiserver (CORRECT)
  • etcd
  • kube-scheduler
  • kube-controller-manager

2. Which control plane component is the cluster’s database?

  • Etcd (CORRECT)
  • kube-apiserver
  • kube-scheduler
  • kube-controller-manager

3. What is the role of the kubelet?

  • To serve as Kubernetes’s agent on each node (CORRECT)
  • To maintain network connectivity among the Pods in a cluster
  • To interact with underlying cloud providers

4. What is the difference between a pod and a container?

  • A pod contains one or more containers. (CORRECT)
  • Pods and containers are two names for the same thing.
  • A container contains one or more pods.

Correct: This is true! The containers within a pod are tightly bound, which means they share the same network namespace and can use localhost IP to communicate with each other. Thus, they can work with each other seamlessly within the same pod but are kept isolated from the other pods.

GOOGLE KUBERNETES ENGINE CONCEPTS

1. In GKE clusters, how are nodes provisioned?

  • As Compute Engine virtual machines (CORRECT)
  • As abstract parts of the GKE service that are not exposed to Google Cloud customers

2. In GKE, how are control planes provisioned?

  • As Compute Engine virtual machines
  • As abstract parts of the GKE service that are not exposed to Google Cloud customers (CORRECT)

3. What is the purpose of configuring a regional cluster in GKE?

  • To allow applications running in the cluster to withstand the loss of a zone (CORRECT)
  • To ensure that the cluster’s workloads are isolated from the public Internet

KUBERNETES OBJECT MANAGEMENT

1. In a manifest file for a Pod, in which field do you define a container image for the Pod?

  • Spec (CORRECT)
  • apiVersion
  • kind
  • metadata

2. What are Kubernetes namespaces useful for? Choose all that are correct (2 correct answers).

  • Namespaces let you implement resource quotas across your cluster. (CORRECT)
  • Namespaces allow you to use object names that would otherwise be duplicates of one another. (CORRECT)
  • Namespaces partition Linux kernel resources.
  • Namespaces make resources more secure,

3. What is the purpo3. What is the purpose of the Deployment object?se of configuring a regional cluster in GKE?

  • To ensure that a defined set of Pods is running at any given time. (CORRECT)
  • To launch one or more Pods and ensure that a specified number of them successfully run to completion and exit.
  • To launch one or more Pods on a time-based schedule.

KUBERNETES CONTROLLER OBJECTS

1. What is the purpose of a Service? Choose all that are true (2 correct answers)

  • To provide a load-balancing network endpoint for Pods (CORRECT)
  • To allow you to choose how Pods are exposed (CORRECT)
  • To allow you to put constraints on Pods’ resource consumption
  • To provide a way to inspect and diagnose code running in a Pod

2. If you are deploying applications in your Pods that need persistent storage, which controller type should you use?

  • StatefulSet (CORRECT)
  • Deployment
  • DaemonSet
  • ReplicaSet

KUBERNETES ARCHITECTURE

1. You are designing an application, and you want to ensure that the containers are located as close to each other as possible, in order to minimize latency. Which design decision helps meet this requirement?

  • Place the containers in the same cluster.
  • Place the containers in the same Pod. (CORRECT)
  • Place the containers in the same Namespace.
  • Give the containers the same labels.

Correct: Absolutely! By putting together pods, it ensures that the required containers are scheduled to execute on the same nodes that would help in minimizing latency while enabling effective communication between the containers. Additionally, this co-location of containers within the pod provides improvement in resource sharing and management of the containers.

2. Which Kubernetes component does the kubectl command connect to in order to carry out operations on a cluster?

  • kube-dns
  • kube-scheduler
  • kube-apiserver (CORRECT)
  • kube-controller-manager

3. You have deployed a new Google Kubernetes Engine regional cluster with four machines in the default pool for the first zone and left the number of zones at the default. How many Compute Engine machines are deployed and billed against your account?

  • Ten. (Four nodes are deployed in the first zone and three nodes are deployed in two other zones because you selected the defaults.)
  • Twelve. (Four nodes are deployed in each of three zones. A control plane node is deployed in each zone which is indirectly billed against your account through the cluster management fee.) (CORRECT)
  • Fifteen. (Four nodes and a single control plane are deployed to each of the three zones. A control plane node is deployed in each zone and it is billed against your account.)
  • Sixteen. (Four nodes are deployed in primary and secondary zones in two regions, for a total of 4 zones and 16 nodes. A control plane node is deployed in each zone but it is not billed to your account.)

Correct: Exactly! GKE Regional clusters are set up across so many zones in one region rather than many separate geographical areas, which gives them high availability and fault tolerance. Additionally, Google deploys GKE control plane nodes in each zone to ensure resiliency so that the control plane can continue functioning even if one zone is compromised. This multi-zone availability scenario promotes greater reliability overall in the Kubernetes cluster.

4. You need to ensure that the production applications running on your Kubernetes cluster are not impacted by test and staging deployments. Which features should you implement and configure to ensure that the resources for your production applications can be prioritized?

  • Configure resource requests for Test, Staging and Production and configure specific Kubernetes resource quotas for the Production Namespace.
  • Configure Namespaces for Test, Staging and Production and configure specific Kubernetes resource quotas for the test and staging Namespaces.
  • Configure labels for Test, Staging and Production and configure specific Kubernetes resource quotas for the Production Namespace. (CORRECT)
  • Configure Namespaces for Test, Staging and Production and configure specific Kubernetes resource quotas for the Production Namespace.

Correct: Indeed, resource quotas restrict the utilization of resources like CPU, memory, and storage within particular namespaces in Kubernetes. This is to assure resource allocation among namespaces and to avoid consumption of all resources by one namespace. You only need to configure resource quotas where you want the limitations applied and do not have to impose any on all namespaces within the cluster.

5. When configuring storage for stateful applications, what steps must you take to provide file system storage inside your containers for data from your applications that will not be lost or deleted if your Pods fail or are deleted for any reason?

  • You must export the data from your applications to a remote service that preserves your data.
  • You must create Volumes using network based storage to provide durable storage remote to the Pods and specify these in the Pods. (CORRECT)
  • You must create Volumes using local Storage on the Nodes and mount the Volumes inside your containers to provide durable storage.
  • You must mount NFS Volumes on each container in the Pod that requires durable storage.

6. You have a new logging and auditing utility that you need to deploy on all of the nodes within your cluster. Which type of controller should you use to handle this task?

  • StatefulSet
  • ReplicaSet
  • Deployment.
  • DaemonSet (CORRECT)

7. You want to deploy multiple copies of your application, so that you can load balance traffic across them. How should you deploy this application’s Pods to the production Namespace in your cluster?

  • Create a Service manifest for the Load Balancer that specifies the number of replicas you want to run.
  • Deploy the Pod manifest multiple times until you have achieved the number of replicas required.
  • Create separate named Pod manifests for each instance of the application and deploy as many as you need.
  • Create a Deployment manifest that specifies the number of replicas that you want to run. (CORRECT)

Leave a Comment