Book Image

Kubernetes for Developers

By : Joseph Heck
Book Image

Kubernetes for Developers

By: Joseph Heck

Overview of this book

Kubernetes is documented and typically approached from the perspective of someone running software that has already been built. Kubernetes may also be used to enhance the development process, enabling more consistent testing and analysis of code to help developers verify not only its correctness, but also its efficiency. This book introduces key Kubernetes concepts, coupled with examples of how to deploy and use them with a bit of Node.js and Python example code, so that you can quickly replicate and use that knowledge. You will begin by setting up Kubernetes to help you develop and package your code. We walk you through the setup and installation process before working with Kubernetes in the development environment. We then delve into concepts such as automating your build process, autonomic computing, debugging, and integration testing. This book covers all the concepts required for a developer to work with Kubernetes. By the end of this book, you will be in a position to use Kubernetes in development ecosystems.
Table of Contents (16 chapters)
Title Page
Packt Upsell
Contributors
Preface
Index

Initialization containers


Initialization containers are containers that can be defined on your Pod, and will be invoked in the specific sequence that they are defined prior to your main container (or containers) being started. Initialization containers became a normal part of Pod specification in Kubernetes version 1.6.

These containers can use the same container image and simply have alternate commands, but they can also use entirely different images, leveraging the Kubernetes Pod guarantees of shared network and filesystem mounts to do initialization and setup work prior to the main container operating. These containers also use namespaces, so they can be given specific access that the main container doesn't have; consequently, they can be given access to Kubernetes Secrets that the main container cannot access.

Initialization containers are expected to have code that runs to completion and exits with a success response. As mentioned previously, these containers are also invoked in sequence...