Chapter 1. Introduction

Cloud computing is the provisioning and maintaining of computing services, such as servers, networking, and storage, over the internet. A cloud provider supplies various computing resources and services, and it charges users based on their actual usage of those resources and services, just as a utility, such as an electricity provider does.

A succinct definition of cloud provisioning is: a computing model that remotely provisions scalable and measured computing resources and services.

Cost effectiveness and speedy provisioning of computing infrastructure and services are two important benefits of running your computing workloads in the cloud rather than in your own datacenter. Cloud computing is a different paradigm from the historical way of running private datacenters, although traditional datacenters and cloud computing can coexist. The cloud provider may provide an organization just the computing infrastructure, or it may offer additional services that run on top of the infrastructure, such as big data and analytics.

Note

An IT resource can be a physical or virtual server, software programs, services, storage, or network devices.

A cloud provider owns the computing resources and is responsible for making those cloud resources and services available to cloud consumers, according to previously agreed-upon Service Level Agreements (SLAs). The cloud provider provisions and manages the compute resources and owns the resources that it leases to the cloud consumers. However, it’s possible for a provider to resell the resources it leases from even larger cloud providers.

Regardless of whether it’s Amazon Web Services (AWS), Google Cloud Platform (GCP), or Microsoft Azure, all clouds consist of a set of physical assets that support virtual resources, such as virtual machines (VMs). These computing assets and resources run within datacenters located around the globe, in regions such as Western Europe or the eastern United States.

The distribution of computing resources across the globe offers redundancy in failure situations and higher speed (lower latency), by locating computing resources closer to users. Software and hardware both become services in a cloud environment. It’s through these services that you gain access to the underlying resources.

Leading cloud providers, such as AWS, GCP, and Microsoft Azure offer a long list of services, such as computing, storage, databases, and identity and security, as well as big data and analytics services. You can mix and match the services to create custom computing infrastructures to meet your needs and then add your own applications on top of the infrastructure to build your computing environment.

Many cloud computing services let developers work with them via REST APIs, as well as via a command-line interface (CLI). All cloud vendors offer easy-to-use dashboards to control resources; manage billing, security and users; and to optimize your cloud usage.

How the Cloud Is Being Used

Cloud computing is being used for more things than many realize. Adobe Creative Cloud is based on Azure, and the Seattle Seahawks use Azure to power their customizable, technology-integrated Sports Performance Platform. Most of the popular movie, music, streaming video, games, and picture- and document-storing services use cloud computing to serve their users.

Many companies use a hybrid cloud environment, with some on-premises infrastructure running alongside, in concert with a public cloud infrastructure. So the cloud is increasingly a venue for regular enterprise IT workloads.

Benefits of Cloud Computing

The immense popularity of cloud computing is due to its many benefits, including:

Agility

You can implement a cloud environment very quickly. Traditional datacenters involve ordering and setting up hardware, provisioning power and cooling, and securing the premises, all of which involve considerable time and effort. Often, the projects take multiple years due the budgeting, contracting, and implementation work involved in running onsite datacenters. Cloud implementation, on the other hand, is extremely fast—you can spin up virtually unlimited servers and storage in a matter of minutes.

Pay-for-use billing model

In a cloud environment, you lease computing resources, on a pay-for-use model. You are billed for only your actual usage of the IT resources. Obviously, this has the potential to reduce both your initial infrastructure investment and your operational costs, as compared to a datacenter-based computing model.

Cost

Although you must be smart about how you utilize cloud computing and use all the deals offered by the cloud providers to reduce costs (such as spot pricing of compute instances), cloud computing doesn’t involve the traditional capital expense of buying hardware and other components required for running a datacenter.

Elasticity

The ability to quickly ramp up (and down, if needed) computing capacity is a hallmark of cloud computing and serves as a strong differentiator from traditional datacenter-based computing environments.

Reliability

Traditional concerns, such as disaster recovery and data backups, become less worrisome since cloud providers offer built-in resiliency by storing data in multiple, geographically separate from zones.

Security

When you run workloads in a public cloud, you follow a shared responsibility model for security, in which you’re responsible for application security and the cloud provider secures the computing infrastructure from external threats.

Performance

Since a cloud provider can offer the very latest in computing hardware, as well as lower network latency, application performance is usually enhanced in a cloud environment.

Types of Cloud Services: Iaas, PaaS, and Saas

Cloud providers offer various types of services, depending on the depth and breadth of the computing stack they offer. Figure 1-1 illustrates the three broad types of cloud services.

The three types of cloud services
Figure 1-1. The three types of cloud services
Infrastructure as a service (IaaS)

IaaS is the most common type of cloud service, and this is how most people use the cloud. Under IaaS, the cloud provider supplies the IT infrastructure, such as servers, storage, and networks, which you’ll pay for based on usage. Most of the IT resources offered under the IaaS model aren’t preconfigured, meaning that the cloud consumer has a high degree of control over the cloud environment. The consumer must configure and maintain the bare infrastructure provisioned by the cloud providers.

Platform as a service (PaaS)

PaaS is a computing model in which the cloud provider provisions, sets up, and manages all the computing infrastructure, such as servers, networks, and databases, and you do the rest. PaaS is a ready-to-use computing environment since the resources and services are already deployed and configured. PaaS computing services include those that help you develop, test, and deliver custom software applications. Developers can quickly create their apps, and the cloud provider sets up and manages the underlying computing infrastructure. The cloud consumer can replace their entire on-premise computing environment in favor of a PaaS. Or they can use the PaaS to scale up their IT environment and/or reduce costs with the cloud environment.

Software as a service (SaaS)

SaaS is how a cloud provider delivers software applications on demand over the internet. In this mode, the provider manages not only the infrastructure but also the software applications, and users connecting to the application over the internet. The software program is modeled as a shared cloud service and made available to users as a product. Cloud consumers have limited administrative and management control, with a SaaS cloud delivery model.

A good example of a SaaS model is the transitioning of Adobe’s well-known Creative Suite to a SaaS model called Adobe Creative Cloud. As Adobe migrates more products to this model, it has signed a strategic partnership with Microsoft to make Microsoft Azure its preferred cloud platform.

“Adobe is offering consumer and enterprise applications in Azure, along with our next-gen applications, like Adobe Cloud Platform,” says Brandon Pulsipher, Vice President of Technical Operations and Managed Services at Adobe. “Our partnership with Microsoft demonstrates that cloud-native applications in Azure make great sense for large and small customers alike.”

For more information about Adobe’s use of the Microsoft Azure platform to successfully transition to the cloud through a SaaS model, please read “Adobe runs its vast open-source application portfolio in Azure”.

Figure 1-1 illustrates how the three types of cloud services (IaaS, PaaS, and SaaS) differ from each other.

It’s important to understand that cloud providers offer a mix of the three cloud services paradigms described here and their derivatives, including functions as a service, containers as a service, and others. Users often subscribe to more than one type of cloud service.

Types of Cloud Deployments

You can deploy cloud computing resources in three different ways: public, private, and hybrid.

Public cloud

A public cloud is run by a third-party cloud provider, such as Microsoft Azure, AWS, or GCP. Users access the cloud publicly over the internet.

Private cloud

In a private cloud, you maintain the computing infrastructure and services on a private network. Your organization owns the private cloud and helps you employ cloud computing technologies to centralize access to companywide IT resources by internal users/departments. An organization can run its private cloud in its on-site datacenter, or it can hire a third-party service to host it.

Hybrid cloud

A hybrid cloud environment consists of two or more cloud deployment models. In a hybrid cloud, your private cloud and the public cloud share data and applications. Data can freely flow between the private and public clouds, or you may use a private cloud for hosting sensitive data and host other cloud services on the public cloud.

Cloud-Enabling Technology

The cloud owes its phenomenal growth over the past decade to several technological developments, of which virtualization (server, storage, and network, among others) is but one. Other key innovations include various web technologies, service-oriented architectures, multitenant technologies, resource replication, cloud storage devices, and object storage. I briefly describe the main cloud enabling technologies in the following sections.

Virtualization

The largest cloud platforms, such as AWS and Azure, have set up a number of massive datacenters across the world, specifically designed to deliver services at a massive scale. By the end of 2017, Synergy Research Group, which tracks IT and cloud-related markets, estimated that there would be 390 hyperscale datacenters in the world. Each of the companies that fall under the large cloud platforms has at least 16 datacenter sites, on average, according to Synergy, with the biggest cloud providers (AWS, Microsoft, GCP, and IBM) operating the most datacenters.

Hyperscale virtualization is at the heart of cloud computing. A software called hypervisor sits on the physical server and helps abstract the machine’s resources. Most of us are familiar with server virtualization, but in the cloud, other resources, such as storage and networks, are also virtualized.

Cloud computing relies on virtualization, but it’s much more than simple virtualization. A cloud provider allocates virtual resources into centralized resource pools called a cloud. Cloud computing is the orchestration of these clouds of computing resources through management and automation software. In addition to virtualized resources, a cloud offers features such as self-service, automatic scaling, and enhanced security.

Virtualization is the process of converting a physical IT resource into (multiple) virtual resources. Cloud-based systems virtualize many types of IT resources, such as:

Servers

Physical servers are the basis of virtual servers.

Storage

Virtual storage devices or virtual disks are based on underlying physical storage.

Network

Physical routers and switches can serve as the basis of logical network fabrics, such as VLANs.

Power

You can abstract physical uninterruptable power supplies (UPSs) and power distribution units into virtual UPSs.

The best-known virtualization technology, of course, is server virtualization. In a nonvirtualized environment, the OS is configured for a specific hardware and you must usually reconfigure the OS, if you modify the IT resources. Virtualization translates IT hardware into emulated and standardized software-based copies. Thus, virtual servers are hardware independent. It’s this hardware independence that enables you to move a virtual server to anther virtualization host, without worrying about the hardware-software compatibility requirements.

Virtualization, by allowing multiple virtual servers to share a single physical server, enables server consolidation, which leads to higher hardware utilization, load balancing, and optimization of computing resources. On top of this, virtual machines can run different guest operating systems on the same host. All these virtualization features support the hallmarks of cloud computing, including on-demand provisioning and usage, elasticity, scalability, and resiliency.

Web Technologies

Web technologies are used by cloud providers in two ways: as the implementation medium for web-based services, and as a management interface for cloud services. Well-known elements, such as Uniform Resource Locators (URLs), the Hypertext Transfer Protocol (HTTP), and markup languages, such as HTML and XML, are the essential components of the technology architecture of the web.

Web applications are distributed applications that use these web-based technologies, and their easy accessibility makes them part of all cloud-based environments. PaaS cloud deployment models help consumers develop and deploy their web applications by providing separate web server, application server, and database server environments. Many applications benefit from the cloud model, particularly from the elastic nature of of cloud infrastructure provisioning. Cloud providers themselves use a lot of web technologies for enablement, most notably REST APIs and JSON, among others.

Web services are the first popular medium for sophisticated web-based service logic. Web services are also called SOAP-based, since they rely on the SOAP messaging format for exchanging requests and responses between web services. The API of a web service uses a markup language called Web Service Description Language (WSDL), and the messages exchanged by the web services are expressed using the XML Schema Definition (XSD) language (XML Schema).

Along with the Universal Description, Discovery, and Integration (UDDI) standard for regulating service registries where WSDL definitions can be published, XML schema, SOAP, and WSDL are the essential components of early web service technologies. Later web service technologies (called WS-*) address other functional areas, such as security, transactions, and reliability.

Representational State Transfer (REST) services are based on a service architecture that operates according to a set of constraints to emulate the properties of the web. REST describes a set of architectural principles through which data is transmitted over a standard interface, such as HTTP. REST focuses on the design rules for creating stateless services. A client accesses the resources using unique URIs for the resources, and unique representations of the resources are returned to the client. With microservices or, at the very least, a proliferation of endpoints and applications, the cloud needs a lot of messaging and so all cloud providers have queues, buses, notifications, and other message passing and orchestration abilities.

Resource Replication

Resource replication is the creation of multiple instances of the same computing resource. Typically, virtualization strategies are used to implement the replication of the resources. For example, a hypervisor replicates multiple instances of a virtual server, using stored virtual server images. Most commonly, servers, cloud storage devices, and networks are replicated in a cloud environment.

Cloud Storage Devices and Object Storage

In a cloud environment, you can reference and store various types of data as web resources. This type of storage is called object storage and supports a wide variety of data and media types. Cloud storage device mechanisms implement the interfaces to object storage, and you can access these object storage interface mechanisms via REST or web services.

For Linux system administrators, cloud storage represents new challenges that they’re not used to with their local storage area network/network attached storage (SAN/NAS) storage systems. Cloud storage involves a lot of REST-based storage operations versus filesystem operations. Just like in Azure, you have blob storage, files, managed disks, and Third-party–provided NAS-like appliances. And that’s just for files (blobs). Key-value pairs, secrets, document storage, and ultimately, database persistence are a whole different ball game.

Cloud Computing Architectures

Most cloud computing providers offer a set of common cloud features, as summarized in the following sections.

On-Demand Usage of Resources

A cloud consumer is completely free to provision any IT resources offered by a cloud provider. The cloud consumer doesn’t need to interact with the cloud provider to provision and use any of the cloud-based services, thus establishing an on-demand, self-service usage pattern.

Measured Usage

Closely related to the ability to use computing resources on demand is the concept of measured usage. All cloud providers charge their consumers just for the IT resources used, rather than for the resources that are provisioned or allocated to the consumer. Measuring usage supports customer billing, as well as usage reporting.

Resource Pooling

Resource pooling is how a cloud provider pools a large amount of computing resources to service multiple consumers. The cloud provider dynamically allocates and deallocates virtual resources to cloud consumers according to fluctuations in demand. Multitenancy (multiple cloud consumers, unbeknownst to each other, sharing a single instance of a computing resource) supports resource pooling.

Dynamic Scalability (Elastic Resource Capability)

Dynamic scalability and elasticity refer to the ability of a cloud provider to transparently scale computing resources in response to the runtime conditions of a user’s environment. Virtualization enables cloud providers to maintain large pools of computing capacity on hand to service the needs of their customers with minimum delays. One of the key reasons for migrating to the cloud is its built-in elasticity, which obviates the need to incur large capital expenditures on infrastructure, in anticipation of an organization’s growth.

Resiliency (Servers and Storage)

Resiliency is a hallmark of cloud environments and is one of the biggest benefits offered by the cloud. Cloud providers frequently provide resiliency by locating redundant computing resources in different geographical areas, called Availability Zones in AWS and Microsoft Azure. The redundant implementation of cloud services means that the secondary (or standby) service can immediately and automatically take over the processing, in the event of primary services failure.

Load Balancing

Load balancing is how a cloud platform manages online traffic by distributing workloads across multiple servers and other computing resources. Load balancing can be automatic or on demand. The goal of load balancing is to keep workload performance at the highest possible levels by preventing overloading of the computing resources, thus enhancing the user experience.

Running Linux in the Cloud: The Role of Containers

As I explained earlier in this introduction, virtualization is a key enabling factor in the success of cloud computing. Microsoft Azure, for example, provides Azure Linux virtual machines running on Red hat, Ubuntu, or a Linux distribution of your choice. Azure provides its customers with the ability to run a Linux virtual machine in the cloud, whether it’s Red Hat, Ubuntu, CentOS, SUSE, Debian, or other distributions, as well as the ability to bring their own Linux images.

Linux-based containers offer easier deployments through the maintenance of a secure registry of container images, and a more efficient use of resources. You also can manage and orchestrate sets of containers using dedicated orchestration tools, such as Kubernetes.

Although VMs are still the predominant way to run workloads in the cloud (and in on-premise datacenters), containers are becoming increasingly popular in cloud environments, with AWS offering the Amazon container services, and from Microsoft Azure, the Azure Container Service.

Container Use Cases

The three major use cases for running containers in the cloud include running microservices, batch jobs, and continuous integration and continuous deployment (CI/CD) of applications.

Running microservices

Containers are ideal for running small, self-contained applications that perform single tasks or run single processes. You can, for example, run separate containers for a web server, application server, or message queue, among others. Since the containers run independent of the other containers, it’s easy to scale specific parts of the application up or down, as needed.

Running batch jobs

You can take advantage of one of the foundational principles of containers—isolation—to run batch and extract, transform, and load (ETL) jobs in containers. You can run multiple such containers on the same cluster, since they’re all isolated from each other. Because containers start up very quickly, you can use them to handle spurts in demand, by launching more containers.

Continuous integration and deployment

Docker enables you to version your Docker container images, making it easy to use containers for continuous integration and deployment. An automated build process supported by a CI tool, such as Jenkins, can pull the latest code from the code repository and can build/package the code into a Docker image. Jenkins can then push the new Docker image to your Docker repository, where your deployment process can pull the image, test the app, and deploy it to production.

You can achieve easily replicable, speedy, reliable, and manageable deployments by orchestrating the deployment of the containers you use for CI/CD, using Kubernetes in the Azure Container Service. Figure 1-2 shows a container-based CI/CD architecture using Jenkins and Kubernetes on the Azure Container Service.

CI/CD with Jenkins and Kubernetes on the Azure Container Service
Figure 1-2. CI/CD with Jenkins and Kubernetes on the Azure Container Service

Running Containers in the Cloud

All cloud providers support containers, with Google Cloud Platform seemingly having embraced them earlier than its competitors. (Kubernetes, the most popular container orchestration system, was developed at Google.) However, both AWS and Microsoft Azure fully support containerization through dedicated container services that support the orchestration of containers.

Azure started out with DC/OS and Docker Swarm for managing containers and eventually added Kubernetes. However, Azure was first to the market with the launching of container instances, followed by AWS Fargate. GCP has no equivalent as of the time of this writing. In summary, all major cloud providers (AWS, Azure, and GCP) now have a Kubernetes play when it comes to managing containers in the cloud.

Container Instances and Cloud Container Services

When you run containers in the cloud, you can run them on the VMs that you create. You can install Docker on the VM and download container images from any registry that you choose.

Many cloud providers, however, also offer a container service to facilitate the creation and management of the underlying infrastructure. So you can either spin up your own containers on VMs provisioned for you, or let the cloud provider create and manage them for you by subscribing to its container service. You may also choose to start with a container-optimized distribution such as Rancher or CoreOS. If you’re going the PaaS route, you can start with a container-based PaaS, such as Tectonic, OpenShift, or Cloud Foundry.

Container instances and container orchestration

If you choose to run your own container cluster, you must have a way of managing the containers and launching applications on the cluster. Although you can launch and manage containers individually, with homegrown tools, you almost always use an orchestrator to automate the deployment of multicontainer workloads. Two well-known orchestration tools are Kubernetes and Docker Swarm.

Kubernetes helps you run a container cluster and deploy applications to the cluster and is quite popular in the container world. Docker Swarm is the other commonly used container orchestrator. You can use the three Docker-container related tools—Swarm, Machine, and Compose—together to put together a valid alternative to Kubernetes, although Kubernetes offers an easier way to get it all done.

Microsoft Azure offers various services to support your container needs, including:

Azure Kubernetes Service (AKS)

For orchestrating containers using Kubernetes, DC/OS, or Docker. It may come as a surprise that AKS is fully Linux-based, showing that you can be all Linux in the Azure cloud.

Azure Container Instances (ACI)

For running Docker containers on Axure VMs.

Azure Container Registry (ACR)

For storing and managing container images.

Note

In addition to the Azure Container Service, you can use Azure Service Fabric to develop microservices and orchestrate containers on Linux. You can also use Azure App Service to deploy web applications on Linux using containers and Azure Batch to run repetitive compute jobs using containers.

Using a Container Service

Planning and deploying fully orchestrated containerized applications, even with a sophisticated orchestration tool, such as Kubernetes, isn’t trivial. Setting up a Kubernetes managed cluster is complex and takes quite a bit of time.

A container service, such as Azure Container Service, lets you easily manage your containers without any expertise in container management. You can provision clusters very quickly and monitor/manage the cluster with a built-in operations console. Azure’s Container Service offers a fully managed Kubernetes cluster, but you can deploy an alternative orchestrator if you wish, such as unmanaged Kubernetes, Docker, or DC/OS. But you must bring your own management and monitoring tools when you do this, whereas the fully managed Kubernetes cluster comes with everything already included.

The Azure Container Service aims to offer its customers the benefits of open source Kubernetes without the headaches and operational overhead. Azure also offers container monitoring, which shows all your running containers and the images they’re running, as well as auditing information about the commands that are being run on the containers. Instead of remotely viewing the Docker hosts, you can troubleshoot containers by searching centralized logs.

When running a Kubernetes managed cluster within the Azure Container Service, you can use the open source packaging tool Helm (similar to Linux package managers, such as apt-get and yum) to install, deploy, and manage containers in the Kubernetes cluster. Helm manages Kubernetes charts, which are packages of preconfigured Kubernetes resources.

In addition to Helm, Microsoft also offers the Brigade and Draft tools, all of which cater to developers, and container administrators. Brigade (event-driven scripting for Kubernetes) helps you to build any ordered workflow of containers in Kubernetes and to trigger the workflow by listening for arbitrary events. Draft makes it easy to develop container-based applications and to deploy them to Kubernetes clusters without worrying about Docker and Kubernetes (you don’t even need to install them). Teams can focus on building applications with Kubernetes rather than on managing the container infrastructure.

Although you do pay for the Kubernetes nodes you use (as well as the underlying infrastructure resources you consume, such as storage and networking), the managed Kubernetes service offered by Azure is free, thus making the management of your Kubernetes cluster a free affair!

Get Five Principles for Deploying and Managing Linux in the Cloud now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.