Serverless Architectures with Kubernetes
eBook - ePub

Serverless Architectures with Kubernetes

Create production-ready Kubernetes clusters and run serverless applications on them

  1. 474 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Serverless Architectures with Kubernetes

Create production-ready Kubernetes clusters and run serverless applications on them

About this book

Deploy, orchestrate, and monitor serverless applications using Kubernetes

Key Features

  • Get hands-on experience with frameworks, such as Kubeless, Apache OpenWhisk, and Funktion
  • Master the basics of Kubernetes and prepare yourself for challenging technical assessments
  • Learn how to launch Kubernetes both locally and in a public cloud

Book Description

Kubernetes has established itself as the standard platform for container management, orchestration, and deployment. By learning Kubernetes, you'll be able to design your own serverless architecture by implementing the function-as-a-service (FaaS) model.

After an accelerated, hands-on overview of the serverless architecture and various Kubernetes concepts, you'll cover a wide range of real-world development challenges faced by real-world developers, and explore various techniques to overcome them. You'll learn how to create production-ready Kubernetes clusters and run serverless applications on them. You'll see how Kubernetes platforms and serverless frameworks such as Kubeless, Apache OpenWhisk and OpenFaaS provide the tooling to help you develop serverless applications on Kubernetes. You'll also learn ways to select the appropriate framework for your upcoming project.

By the end of this book, you'll have the skills and confidence to design your own serverless applications using the power and flexibility of Kubernetes.

What you will learn

  • Deploy a Kubernetes cluster locally with Minikube
  • Get familiar with AWS Lambda and Google Cloud Functions
  • Create, build, and deploy a webpage generated by the serverless functions in the cloud
  • Create a Kubernetes cluster running on the virtual kubelet hardware abstraction
  • Create, test, troubleshoot, and delete an OpenFaaS function
  • Create a sample Slackbot with Apache OpenWhisk actions

Who this book is for

This book is for software developers and DevOps engineers who have basic or intermediate knowledge about Kubernetes and want to learn how to create serverless applications that run on Kubernetes. Those who want to design and create serverless applications running on the cloud, or on-premise Kubernetes clusters will also find this book useful.

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Information

1. Introduction to Serverless

Learning Objectives

By the end of this chapter, you will be able to:
  • Identify the benefits of serverless architectures
  • Create and invoke simple functions on a serverless platform
  • Create a cloud-native serverless function and package it as a container using Kubernetes
  • Create a Twitter Bot Backend application and package it in a Docker container
In this chapter, we will explain the serverless architecture, then create our first serverless function and package it as a container.

Introduction to Serverless

Cloud technology right now is in a state of constant transformation to create scalable, reliable, and robust environments. In order to create such an environment, every improvement in cloud technology aims to increase both the end user experience and the developer experience. End users demand fast and robust applications that are reachable from everywhere in the world. At the same time, developers demand a better development environment to design, deploy, and maintain their applications in. In the last decade, the journey of cloud technology has started with cloud computing, where servers are provisioned in cloud data centers and applications are deployed on the servers. The transition to cloud data centers decreased costs and removed the need for responsibility for data centers. However, as billions of people are accessing the internet and demanding more services, scalability has become a necessity. In order to scale applications, developers have created smaller microservices that can scale independently of each other. Microservices are packaged into containers as building blocks of software architectures to better both the developer and end user experience. Microservices enhance the developer experience by providing better maintainability while offering high scalability to end users. However, the flexibility and scalability of microservices cannot keep up with the enormous user demand. Today, for instance, millions of banking transactions take place daily, and millions of business-to-business requests are made to backend systems.
Finally, serverless started gaining attention for creating future-proof and ad hoc-scalable applications. Serverless designs focus on creating even smaller services than microservices and they are designed to last much longer into the future. These nanoservices, or functions, help developers to create more flexible and easier-to-maintain applications. On the other hand, serverless designs are ad hoc-scalable, which means if you adopt a serverless design, your services are naturally scaled up or down with the user requests. These characteristics of serverless have made it the latest big trend in the industry, and it is now shaping the cloud technology landscape. In this section, an introduction to serverless technology will be presented, looking at serverless's evolution, origin, and use cases.
Before diving deeper into serverless design, let's understand the evolution of cloud technology. In bygone days, the expected process of deploying applications started with the procurement and deployment of hardware, namely servers. Following that, operating systems were installed on the servers, and then application packages were deployed. Finally, the actual code in application packages was executed to implement business requirements. These four steps are shown in Figure 1.1:
Figure 1.1: Traditional software development
Figure 1.1: Traditional software development
Organizations started to outsource their data center operations to cloud providers to improve the scalability and utilization of servers. For instance, if you were developing an online shopping application, you first needed to buy some servers, wait for their installation, and operate them daily and deal with their potential problems, caused by electricity, networking, and misconfiguration. It was difficult to predict the usage level of servers and not feasible to make huge investments in servers to run applications. Therefore, both start-ups and large enterprises started to outsource data center operations to cloud providers. This cleared away the problems related to the first step of hardware deployment, as shown in Figure 1.2:
Figure 1.2: Software development with cloud computing
Figure 1.2: Software development with cloud computing
With the start of virtualization in cloud computing, operating systems became virtualized so that multiple virtual machines (VMs) could run on the same bare-metal machine. This transition removed the second step, and service providers provision VMs as shown in Fig 1.3. With multiple VMs running on the same hardware, the costs of running servers decreases and the flexibility of operations increases. In other words, the low-level concerns of software developers are cleared since both the hardware and the operating system are now someone else's problem:
Figure 1.3: Software development with virtualization
Figure 1.3: Software development with virtualization
VMs enable the running of multiple instances on the same hardware. However, using VMs requires installing a complete operating system for every application. Even for a basic frontend application, you need to install an operating system, which results in an overhead of operating system management, leading to limited scalability. Application developers and the high-level usage of modern applications requires faster and simpler solutions with better isolation than creating and managing VMs. Containerization technology solves this issue by running multiple instances of "containerized" applications on the same operating system. With this level of abstraction, problems related to operating systems are also removed, and containers are delivered as application packages, as illustrated in Figure 1.4. Containerization technology enables a microservices architecture where software is designed as small and scalable services that interact with each other.
This architectural approach makes it possible to run modern applications such as collaborative spreadsheets in Google Drive, live streams of sports events on YouTube, video conferences on Skype, and many more:
Figure 1.4: Software development with containerization
Figure 1.4: Software development with containerization
The next architectural phenomena, serverless, removes the burden of managing containers and focuses on running the actual code itself. The essential characteristic of serverless architecture is ad hoc scalability. Applications in serverless architecture are ad hoc-scalable, which means they are scaled up or down automatically when they are needed. They could also be scaled down to zero, which means no hardware, network, or operation costs. With serverless applications, all low-level concerns are outsourced and managed, and the focus is on the last step – Run the code – as shown in Figure 1.5. With the serverless design, the focus is on the last step of traditional software development. In the following section, we will focus on the origin and manifesto of serverless for a more in-depth introduction:
Figure 1.5: Software development with serverless
Figure 1.5: Software development with serverless

Serverless Origin and Manifesto

Serverless is a confusing term since there are various definitions used in conferences, books, and blogs. Although it theoretically means not having any servers, it practically means leaving the responsibility of servers to third-party organizations. In other words, it means not getting rid of servers but server operations. When you run serverless, someone else handles the procurement, shipping, and installation of your server operations. This decreases your costs because you do not need to operate servers or even data centers; ...

Table of contents

  1. Preface
  2. 1. Introduction to Serverless
  3. 2. Introduction to Serverless in the Cloud
  4. 3. Introduction to Serverless Frameworks
  5. 4. Kubernetes Deep Dive
  6. 5. Production-Ready Kubernetes Clusters
  7. 6. Upcoming Serverless Features in Kubernetes
  8. 7. Kubernetes Serverless with Kubeless
  9. 8. Introduction to Apache OpenWhisk
  10. 9. Going Serverless with OpenFaaS
  11. Appendix

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 990+ topics, we’ve got you covered! Learn about our mission
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
Yes, you can access Serverless Architectures with Kubernetes by Onur Yilmaz, Sathsara Sarathchandra in PDF and/or ePUB format, as well as other popular books in Computer Science & Computer Networking. We have over one million books available in our catalogue for you to explore.