Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Kubernetes for Developers

You're reading from  Kubernetes for Developers

Product type Book
Published in Apr 2018
Publisher Packt
ISBN-13 9781788834759
Pages 374 pages
Edition 1st Edition
Languages
Author (1):
Joseph Heck Joseph Heck
Profile icon Joseph Heck

Table of Contents (16) Chapters

Title Page
Packt Upsell
Contributors
Preface
1. Setting Up Kubernetes for Development 2. Packaging Your Code to Run in Kubernetes 3. Interacting with Your Code in Kubernetes 4. Declarative Infrastructure 5. Pod and Container Lifecycles 6. Background Processing in Kubernetes 7. Monitoring and Metrics 8. Logging and Tracing 9. Integration Testing 10. Troubleshooting Common Problems and Next Steps 1. Other Books You May Enjoy Index

Kubernetes concept – container


Kubernetes (and other technologies in this space) are all about managing and orchestrating containers. A container is really a name wrapped around a set of Linux technologies, the two most prominent being the container image format and the way Linux can isolate processes from one another, leveraging cgroups.

For all practical purposes, when someone is speaking of a container, they are generally implying that there is an image with everything needed to run a single process. In this context, a container is not only the image, but also the information about what to invoke and how to run it. Containers also act like they have their own network access. In reality, it's being shared by the Linux operating system that's running the containers.

When we want to write code to run under Kubernetes, we will always be talking about packaging it up and preparing it to run within a container. The more complex examples later in the book will utilize multiple containers all working together.

Note

It is quite possible to run more than a single process inside a container, but that's generally frowned upon as a container is ideally suited to represent a single process and how to invoke it, and shouldn't be considered the same thing as a full virtual machine.

If you usually develop in Python, then you are likely familiar with using something like pip to download libraries and modules that you need, and you invoke your program with a command akin to python your_file. If you're a Node developer, then it is more likely you're familiar with npm or yarn to install the dependencies you need, and you run your code with node your_file.

If you wanted to wrap that all up and run it on another machine, you would likely either redo all the instructions for downloading the libraries and running the code, or perhaps ZIP up the whole directory and move it where you want to run it. A container is a way to collect all the information together into a single image so that it can be easily moved around, installed, and run on a Linux operating system. Originally created by Docker, the specifications are now maintained by the Open Container Initiative (OCI) (https://www.opencontainers.org).

While a container is the smallest building block of what goes into Kubernetes, the smallest unit that Kubernetes works with is a Pod.

You have been reading a chapter from
Kubernetes for Developers
Published in: Apr 2018 Publisher: Packt ISBN-13: 9781788834759
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}