Let’s move on to the next section, Containerizing and Orchestrating Apps with GKE.
In this section of the course, you’ll learn about containerization and how to leverage
Google Kubernetes Engine.
We’ve already discussed the spectrum between infrastructure as a service and platform as
a service.
And we've also discussed Compute Engine, which is the IaaS offering of Google Cloud, with
access to servers, file systems, and networking.
Now you’ll be introduced to containers and GKE, which is a hybrid that conceptually sits
between the two, offering the managed infrastructure of an IaaS, with the developer orientation
of a PaaS offering.
IaaS lets you share compute resources with other developers by using virtual machines
to virtualize the hardware.
This lets each developer deploy their own operating system, or OS, access the hardware,
and build their applications in a self-contained environment with access to RAM, file systems,
networking interfaces, etc.
This is where containers come in.
The idea of a container is to give the independent scalability of workloads in PaaS and an abstraction
layer of the OS and hardware in IaaS.
A configurable system lets you install your favorite runtime, web server, database, or
middleware, configure the underlying system resources, such as disk space, disk I/O, or
networking, and build as you like.
But flexibility comes with a cost.
The smallest unit of compute is an app with its VM.
The guest OS might be large, even gigabytes in size, and take minutes to boot.
As demand for your application increases, you have to copy an entire VM and boot the
guest OS for each instance of your app, which can be slow and costly.
Now, with App Engine, you have access to programming services, so you only need to write your code
in self-contained workloads that use these services and include any dependent libraries.
This means that as demand for your app increases, the platform scales your app seamlessly and
independently by workload and infrastructure.
This scales rapidly but there’s no option to fine-tune the underlying architecture to
save cost.
A container is an invisible box around your code and its dependencies with limited access
to its own partition of the file system and hardware.
It only requires a few system calls to create and it starts as quickly as a process.
All that’s needed on each host is an OS kernel that supports containers and a container
runtime.
In essence, the OS is being virtualized.
It scales like PaaS but gives you nearly the same flexibility as IaaS.
This makes code ultra portable, and the OS and hardware can be treated as a black box.
So you can go from development, to staging, to production, or from your laptop to the
cloud, without changing or rebuilding anything.
As an example, let’s say you want to scale a web server.
With a container, you can do this in seconds and deploy dozens or hundreds of servers,
depending on the size or your workload, on a single host.
That's just a simple example of scaling one container running the whole application on
a single host.
However, you'll probably want to build your applications using lots of containers, each
performing their own function, as is done when using a microservices architecture.
If you build applications this way and connect them with network connections, you can make
them modular, easily deployable, and scaled independently across a group of hosts.
The hosts can scale up and down and start and stop containers as demand for your app
changes or as hosts fail.
Kubernetes is a container orchestration tool you can use to simplify the management of
containerized environments.
You can install Kubernetes on a group of your own managed servers or run it as a hosted
service in Google Cloud on a cluster of managed Compute Engine instances called Google Kubernetes
Engine (more on that shortly).
Kubernetes was built by Google to run applications at scale.
It lets you install the system on local servers in the cloud, manage container networking
and data storage, deploy rollouts and rollbacks, and monitor and manage container and host
health.
A software container makes it easier for teams to package, manage, and ship their code.
They write software applications that run in a container.
The container provides the operating system needed to run their application.
The container will run on any container platform.
This can save a lot of time and cost compared to running servers or virtual machines.
Like a virtual machine imitates a computer, a container imitates an operating system.
Everything at Google runs on containers: Gmail, Web search, Maps, MapReduce, batch, Google
File System, Colossus, even Cloud Functions (VMs in containers).
Google launches over 2 billion containers per week.
Docker is the tool that puts the application and everything it needs in the container.
Once the application is in a container, it can be moved anywhere that will run Docker
containers—any laptop, server, or cloud provider.
This portability makes code easier to produce, manage, troubleshoot, and update.
For service providers, containers make it easy to develop code that can be easily transferred
and run both in the cloud and on a customer's on-premises servers.
Kubernetes is an open source container orchestration tool for managing a cluster of Docker Linux
containers as a single system.
It can be run in the cloud and on-premises environments.
It’s inspired and informed by Google’s experiences and internal systems.
Google Kubernetes Engine, GKE, is a managed environment for deploying containerized apps.
It brings Google’s latest innovations in developer productivity, resource efficiency,
automated operations, and open source flexibility to accelerate time to market.
GKE is a powerful cluster manager and orchestration system for running Docker containers in Google
Cloud.
GKE manages containers automatically based on specifications such as CPU and memory.
It's built on the open source Kubernetes system, making it easy for users to orchestrate container
clusters or groups of containers, and it also gives customers the flexibility to take advantage
of on-premises, hybrid, or public cloud infrastructure.