Kubernetes on AWS
eBook - ePub

Kubernetes on AWS

Deploy and manage production-ready Kubernetes clusters on AWS

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

Kubernetes on AWS

Deploy and manage production-ready Kubernetes clusters on AWS

About this book

Learn to implement container orchestration on AWS with ease

Key Features

  • Leverage the power of Kubernetes on AWS to deploy highly scalable applications
  • Provision Kubernetes clusters on Amazon EC2 environments
  • Implement best practices to improve efficiency and security of Kubernetes on the cloud

Book Description

Docker containers promise to radicalize the way developers and operations build, deploy, and manage applications running on the cloud. Kubernetes provides the orchestration tools you need to realize that promise in production.

Kubernetes on AWS guides you in deploying a production-ready Kubernetes cluster on the AWS platform. You will then discover how to utilize the power of Kubernetes, which is one of the fastest growing platforms for production-based container orchestration, to manage and update your applications. Kubernetes is becoming the go-to choice for production-grade deployments of cloud-native applications. This book covers Kubernetes from first principles. You will start by learning about Kubernetes' powerful abstractions - Pods and Services - that make managing container deployments easy. This will be followed by a guided tour through setting up a production-ready Kubernetes cluster on AWS, while learning the techniques you need to successfully deploy and manage your own applications.

By the end of the book, you will have gained plenty of hands-on experience with Kubernetes on Amazon Web Services. You will also have picked up some tips on deploying and managing applications, keeping your cluster and applications secure, and ensuring that your whole system is reliable and resilient to failure.

What you will learn

  • Learn how to provision a production-ready Kubernetes cluster on AWS
  • Deploy your own applications to Kubernetes with Helm
  • Discover strategies for troubleshooting your cluster and know where to find help with issues
  • Explore the best ways to monitor your cluster and the applications running on it
  • Supercharge your cluster by integrating it with the tools provided by the AWS platform
  • Architect your cluster for high availability

Who this book is for

If you're a cloud engineer, cloud solution provider, sysadmin, site reliability engineer, or developer with an interest in DevOps and are looking for an extensive guide to running Kubernetes in the AWS environment, this book is for you. Though any previous knowledge of Kubernetes is not expected, some experience with Linux and Docker containers would be a bonus.

Trusted by 375,005 students

Access to over 1.5 million titles for a fair monthly price.

Study more efficiently using our study tools.

Information

Year
2018
Print ISBN
9781788390071
eBook ISBN
9781788392358
Edition
1

Planning for Production

Kubernetes provides an excellent platform for developers to rapidly build highly flexible distributed applications. By running our applications on Kubernetes, we have a number of tools at our disposal to simplify their operation, and for making them more reliable, resilient to errors, and, ultimately, highly available.
In order for us to depend on some of the guarantees and behaviors that our applications can inherit from Kubernetes, it is important that we understand how Kubernetes behaves, and some of the factors that have an impact on a production system.
It is important as a cluster administrator that you have an understanding of the requirements of the applications you are running, and of the users of those applications.
Having an awareness of the way that Kubernetes behaves in production is key, so it is invaluable to gain some practical experience of running your applications on Kubernetes before you start to serve mission-critical traffic. For example, when GitHub migrated their main application to Kubernetes, they started by moving traffic for internal users to their new Kubernetes-based infrastructure, before switching their main production traffic.
"The load from internal users helped us find problems, fix bugs, and start getting comfortable with Kubernetes in production. During this period, we worked to increase our confidence by simulating procedures we anticipated performing in the future, writing runbooks, and performing failure tests."
—Jesse Newland (https://githubengineering.com/kubernetes-at-github/)
While I can cover some of the things that you are likely to encounter when using Kubernetes on AWS in production, it is important to understand that every application and organization is unique in surprising ways. You should think of Kubernetes as a toolkit that will enable you to build a powerful and flexible environment for your organization. Kubernetes isn't a magic bullet that removes the need for operational expertise; it's a tool that assists you in managing your applications.

The design process

The design process is shown as follows:
When you think about preparing to use Kubernetes to manage your production infrastructure, you shouldn't think about Kubernetes as your end goal. It is a foundation for building a platform on which to run systems.
When you think about building a platform to meet the needs of the different people in your organization, it becomes much simpler to define the requirements you will place on Kubernetes. When trying to plan for a production environment, you need to understand the requirements that your organization has. Clearly, the technical requirements of the software you want to manage is important. But it is also key to understanding the operational process that your organization needs to support.
Adopting Kubernetes offers a lot of benefits to organizations that have complex requirements for the software that they run. Unfortunately, this complexity can also lead to challenges in safely adopting Kubernetes in a successful way.

Initial planning

You should consider where you will focus your efforts for your initial roll out. You should look for an application that will both deliver valuable results quickly, as well as having a lower risk profile. If we think about the example at GitHub, they initially focused their efforts on building an infrastructure for internal users to quickly test changes to their software. By focusing on a review or staging infrastructure, they found an application for Kubernetes that would both provide value quickly to developers in their organization, as well as an area that had low risks to their business as it was only accessed by internal users.
Applications like these that have a combination of immediate usefulness and a lower impact of downtime are very useful. They allow your organization to gain valuable operational experience using Kubernetes, as well as to drive out bugs and other issues well before you attempt to handle production workloads.
When getting started with Kubernetes, it can be tempting to choose the simplest application that your organization operates and start building processes and tooling around this. However, this can be a mistake because it might lead to you making assumptions about how your applications should be operated, that might make it much harder to later apply the same processes and configuration to more complex applications.
If you choose to start building your platform to support a simple application that doesn't require any backend services, such as a database, you might miss a number of things you need to consider as part of your deployment process. For example, applications that are backed by a database often need to run migration scripts to update the schema when a new version of an application is deployed. If you start by designing a deployment process to meet the needs of a very simple application, you might not surface these requirements until later. Remember, it will always be much simpler to deploy a simple application that only needs a subset of the features that your platform provides, than a more complex application that needs facilities you didn't consider when designing it.
If you choose to focus your efforts on a single application for your initial adoption of Kubernetes, make sure that you choose an application that is representative of your organization's needs. It can be tempting to start using Kubernetes for a greenfield project, as you can take application development decisions with the platform in mind. But remember that a new application may well be significantly simpler than an application that has been in use for a longer time. In the example from GitHub, the application they chose to deploy first was their largest application operated by their organization providing many core services.
If your organization has an application that requires a lot of operational time and effort every time it is deployed, it could be that this would be a good choice for an initial adoption of Kubernetes. Applications like these will be well known for their needs by your development and operational teams, and they will immediately be able to start to utilize Kubernetes to address the issues that previously cost time and effort.

Planning for success

There are a few things that you should try to avoid in order to deliver successfully on a project to adopt Kubernetes.
One trap that can be all too easy to fall into is to change too much too quickly. If you are taking the decision to adopt containerization and Kubernetes, it can be very tempting to adopt a lot of new processes and tools alongside this. This can slow down your progress quite significantly, because what started as a project to run your applications in containers can quickly grow to encompass many other tools and processes that your organization would like to adopt.
You should aim to avoid scope creep and try to change as little as possible in order to deliver your initial adoption of Kubernetes as quickly as possible. It is important to not try to deliver too many of the promises of containerization in one go, as they will hold your adoption back, and may indeed lead to failure of your whole project.
Try to consider the environment you are currently deploying your applications to and aim to replicate its facilities at first, later adding additional functionality. Many of the tools and procedures that we discuss in the rest of this book might indeed be optional for your Kubernetes cluster, items that you can add at a later date to provide additional valuable services, but not to be viewed as blockers to adoption.
If you have the opportunity to reduce the scope of the infrastructure your Kubernetes deployment provides at the time of your additional roll out, you should consider doing so. It reduces the scope of new tools and processes that your organization needs to understand. And it will give you the opportunity to focus on that topic in greater detail at a later time, with reference to the operational experience you will have gained running your applications on Kubernetes.
Consider log management as an example of this—if your current procedure is to log into servers with SSH and tail log files, you can provide the same functionality to operators of your Kubernetes cluster with the kubectl logs command. Implementing a solution to aggregate and search logs generated by your cluster might be desirable, but shouldn't necessarily be a blocker to using Kubernetes.
If you currently deploy your applications onto servers running a Linux distribution that is readily available as a container image, you should stick with that distribution, rather than looking for alternatives at this stage, as your developers and operational staff will already be knowledgeable about how it works, and you won't have to invest time fixing incompatibilities. Learning to operate your applications on Kubernetes should be your focus, rather than learning how to configure a new operating system distribution.

Planning for a successful roll out

It can be tempting to shake up the processes and responsibilities in your organization. But trying to do this as part of adopting a new tool like Kubernetes can be risky. For example, if in your organization you have an operations team responsible for deploying and monitoring your applications, the point at which you adopt Kubernetes is not the correct time to hand this responsibility to someone else, such as your development team, or to attempt to automate a manual process.
This can be frustrating because, often, adoption of Kubernetes comes as part of wider plans to improve the processes and tooling that your organization uses. You should wait to successfully establish the use and operation of Kubernetes first. This will put you in a much better position to introduce new tools and processes once you have a stable foundation to build upon. You should view the adoption of Kubernetes as building a foundation that will be flexible enough to implement whatever changes to tools and processes you want to make in the future.
You will discover that implementing new tools, services, and processes becomes much simpler once your application infrastructure is running on Kubernetes. Once you have a Kubernetes cluster at your disposal, you will discover that the barriers to trying out a new tool are significantly reduced. Instead of spending lots of time planning and provisioning, you can quickly evaluate and try out a new tool just by submitting a new configuration to your cluster.

Discovering requirements

The designing requirements are shown in the following diagram:
Availability, capacity, and performance are key properties that we should consider when preparing for production. When gathering the functional requirements for your cluster, it can help to categorize which requirements imply some consideration of these properties.
It is important to understand that it might not be possible to optimize for all three properties without making some trade-offs. For example, for applications that depend on very high network performance, AWS provides a tool called a cluster placement group. This ensures that the best network performance is available by provisioning the EC2 VMs in such a way that fast network interconnection...

Table of contents

  1. Title Page
  2. Copyright and Credits
  3. Dedication
  4. About Packt
  5. Contributors
  6. Preface
  7. Google's Infrastructure for the Rest of Us
  8. Start Your Engines
  9. Reach for the Cloud
  10. Managing Change in Your Applications
  11. Managing Complex Applications with Helm
  12. Planning for Production
  13. A Production-Ready Cluster
  14. Sorry My App Ate the Cluster
  15. Storing State
  16. Managing Container Images
  17. Other Books You May Enjoy

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.5M+ 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.5 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 Kubernetes on AWS by Ed Robinson in PDF and/or ePUB format, as well as other popular books in Informatique & Cloud Computing. We have over 1.5 million books available in our catalogue for you to explore.