Hands-On Kubernetes on Azure
eBook - ePub

Hands-On Kubernetes on Azure

Run your applications securely and at scale on the most widely adopted orchestration platform

Shivakumar Gopalakrishnan, Gunther Lenz

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

Hands-On Kubernetes on Azure

Run your applications securely and at scale on the most widely adopted orchestration platform

Shivakumar Gopalakrishnan, Gunther Lenz

Book details
Book preview
Table of contents
Citations

About This Book

Efficiently deploy and manage Kubernetes clusters on a cloud

Key Features

  • Deploy highly scalable applications with Kubernetes on Azure
  • Leverage AKS to deploy, manage, and operations of Kubernetes
  • Gain best practices from this guide to increase efficiency of container orchestration service on Cloud

Book Description

Microsoft is now one of the most significant contributors to Kubernetes open source projects. Kubernetes helps to create, configure, and manage a cluster of virtual machines that are preconfigured to run containerized applications.

This book will be your resource for achieving successful container orchestration and deployment of Kubernetes clusters on Azure. You will learn how to deploy and manage highly scalable applications, along with how to set up a production-ready Kubernetes cluster on Azure. With this book, you will be able to reduce the complexity and operational overheads of managing a Kubernetes cluster on Azure.

By the end of this book, you will not only be capable of deploying and managing Kubernetes clusters on Azure with ease, but also have the knowledge of industry best practices to work with advanced Azure Kubernetes Services (AKS) concepts for complex systems.

What you will learn

  • Get to grips with Microsoft AKS deployment, management, and operations
  • Learn about the benefits of using Microsoft AKS, as well as the limitations, and avoid potential problems
  • Integrate Microsoft toolchains such as Visual Studio Code, and Git
  • Implement simple and advanced AKS solutions
  • Implement the automated scalability and high reliability of secure deployments with Microsoft AKS
  • Use kubectl commands to monitor applications

Who this book is for

If you're a cloud engineer, cloud solution provider, sysadmin, site reliability engineer, or a developer interested in DevOps and are looking for an extensive guide to running Kubernetes in the Azure environment then, this book is for you.

Though any previous knowledge of Kubernetes is not expected, some experience with Linux and Docker containers would be beneficial.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
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 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
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 here.
Is Hands-On Kubernetes on Azure an online PDF/ePUB?
Yes, you can access Hands-On Kubernetes on Azure by Shivakumar Gopalakrishnan, Gunther Lenz in PDF and/or ePUB format, as well as other popular books in Computer Science & Cloud Computing. We have over one million books available in our catalogue for you to explore.

Information

Year
2019
ISBN
9781789535235
Edition
1

Section 1: The Basics

Section 1 of the book focuses on establishing the baseline and explaining the basic concepts necessary to build the foundational knowledge that the reader will require in order to follow the examples in the book. We not only want to make sure that the reader understands the basics of the underlying concepts, such as Docker and Kubernetes, but also that they are knowledgeable regarding the tools that they can use, such as Visual Studio, Visual Studio Code, and Cloud Shell.
The following chapters will be covered in this section:
  • Chapter 1, Introduction to Docker and Kubernetes
  • Chapter 2, Kubernetes on Azure (AKS)

Introduction to Docker and Kubernetes

The perfect storm – that is how the current state of the software development world can be described. The sources of this storm are as follows:
  • Open source software (OSS): This provides a foundational framework that makes almost any software possible.
  • Technology and architecture advancements: This enables the orchestration of loosely coupled systems that consist of micro applications leveraging microservices, micro frontends, and multiple databases.
  • Public clouds: For instance, Azure, AWS, and Google Cloud – these provide scalable infrastructure for a company of any size.
  • Containerization and orchestration: For instance, Docker and Kubernetes – making DevOps culture possible.
Azure Kubernetes Service (AKS) packages and manages the complexity of putting together all of the preceding sources for you. As an engineer, it is still very useful to know the underpinnings of AKS technologies. We will explore the foundations of the technologies (you might be surprised to see how really old they are) that power AKS. You will learn about processes in Linux, and how Linux is related to Docker. Even though Kubernetes is technically a container runtime-agnostic platform (you will find out what this means shortly), Docker is the de facto container technology that is used practically everywhere. You will see how various processes fit nicely into Docker, and how Docker fits nicely into Kubernetes (just like the cute Russian dolls).
This chapter is the longest chapter that you will read in terms of theory in this book. You will get your hands dirty pretty quickly in the following chapters. Step by step, you will be building applications that can scale and are secure. This chapter gives you a brief introduction to the information that you will need if you want to dig deeper, or wish to troubleshoot when something goes wrong (remember, Murphy was an optimist!). Having cursory knowledge of this chapter will demystify much of the magic as you build your Azure AD-authenticated, Let's Encrypt-protected application that scales on demand based on the metrics that you are monitoring.
The following topics will be covered in this chapter:
  • The foundational technologies that enable AKS
  • The fundamentals of Docker
  • The fundamentals of Kubernetes

Technical requirements

You will need a modern web browser, such as Chrome, Firefox, or Edge, for this chapter.

The foundational technologies that enable AKS

The combination of OSS, public cloud, and containerization gives a developer a virtually unlimited number of compute power combined with the ability of rapidly composing applications that deliver more than the sum of the individual parts. The individual parts that make up an application generally do only one thing, and do it well (take, for instance, the Unix philosophy).
The developer is now able to architect applications that are deployed as microservices. When done right, microservices, such as SOA, enable quick feedback during development, testing, and deployment. Microservices are not a free lunch and has various problems, which are listed in the 2014 article—Microservices - Not A Free Lunch! (you can read this article at http://highscalability.com/blog/2014/4/8/microservices-not-a-free-lunch.html). With the technologies we listed earlier, developers have the power of having their cake and eating it too, as more and more of the not free lunch part is available as managed services, such as AKS. The public cloud providers are competing by investing in managed services to become the go-to provider for developers.

You build it, you run it

Even with more managed services coming to relieve the burden on the developer and operator, developers need to know the underlying workings of these services to make effective use of them in production. Just as developers write automated tests, future developers will be expected to know how their application can be delivered quickly and reliably to the customer.
Operators will take the hints from the developer specs and deliver them a stable system – whose metrics can be used for future software development, thus completing the virtuous cycle.
Developers owning the responsibility of running the software that they develop instead of throwing it over the wall for operations is a change in mindset that has origins in Amazon (https://www.slideshare.net/ufried/the-truth-about-you-build-it-you-run-it).
The advantages of the DevOps model not only change the responsibilities of the operations and development teams—it also changes the business side of organizations. The foundation of DevOps can enable businesses to accelerate the time to market significantly if combined with a lean and agile process and operations model.

Everything is a file

Microservices, Docker, and Kubernetes can get quickly overwhelming for anyone. We can make it easier for ourselves by understanding the basics. It would be an understatement to say that understanding the fundamentals is critical to performing root cause analysis on production problems.
Any application is ultimately a process that is running on an operating system (OS). The process requires the following to be usable:
  • Compute (CPU)
  • Memory (RAM)
  • Storage (disk)
  • Network (NIC)
Launch the online Linux Terminal emulator at https://bellard.org/jslinux/vm.html?url=https://bellard.org/jslinux/buildroot-x86.cfg. Then, type the ls command, as follows:
This command lists the files in the current directory (which happens to be the root user's home directory).
Congratulations, you have launched your first container!
Well, obviously, this is not really the case. In principle, there is no difference between the command you ran versus launching a container.
So, what is the difference between the two? The clue lies in the word, contain. The ls process has very limited containment (it is limited only by the rights that the user has). ls can potentially see all files, has access to all the memory, network, and the CPU that's available to the OS.
A container is contained by the OS by controlling access to computing, memory, storage, and network. Each container runs in its own namespace(https://medium.com/@teddyking/linux-namespaces-850489d3ccf). The rights of the namespace processes are controlled by control groups (cgroups).
Every container process has contained access via cgroups and namespaces, which makes it look (from the container process perspective) as if it is running as a complete instance of an OS. This means that it appears to have its own root filesystem, init process (PID 1), memory, compute, and network.
Since running containers is just a set of processes, it makes it extremely lightweight and fast, and all the tools that is used to debug and monitor processes can be used out of the box.
You can play with Docker by creating a free Docker Hub account at Docker Hub (https://hub.docker.com/) and using that login at play with Docker (https://labs.play-with-docker.com/).
First, type docker run -it ubuntu. After a short period of time, you will get a prompt such as root@<randomhexnumber>:/#. Next, type exit, and run the docker run -it ubuntu command again. You will notice that it is super fast! Even though you have launched a completely new insta...

Table of contents