Book Image

Managing Kubernetes Resources Using Helm - Second Edition

By : Andrew Block, Austin Dewey
Book Image

Managing Kubernetes Resources Using Helm - Second Edition

By: Andrew Block, Austin Dewey

Overview of this book

Containerization is one of the best ways to implement DevOps, and learning how to execute it effectively is an essential part of a developer’s skillset. Kubernetes is the current industry standard for container orchestration. This book will help you discover the efficiency of managing applications running on Kubernetes with Helm. Starting with a brief introduction to Helm and its impact on users working with containers and Kubernetes, you’ll delve into the primitives of Helm charts and their architecture and use cases. From there, you’ll understand how to write Helm charts in order to automate application deployment on Kubernetes and work your way toward more advanced strategies. These enterprise-ready patterns are focused on concepts beyond the basics so that you can use Helm optimally, looking at topics related to automation, application development, delivery, lifecycle management, and security. By the end of this book, you’ll have learned how to leverage Helm to build, deploy, and manage applications on Kubernetes.
Table of Contents (18 chapters)
1
Part 1: Introduction and Setup
5
Part 2: Helm Chart Development
12
Part 3: Advanced Deployment Patterns

Deploying a Kubernetes application

Deploying an application on Kubernetes is fundamentally similar to deploying an application outside of Kubernetes. All applications, whether containerized or not, must consider the following configuration details:

  • Networking
  • Persistent storage and file mounts
  • Resource allocation
  • Availability and redundancy
  • Runtime configuration
  • Security

Configuring these details on Kubernetes is done by interacting with the Kubernetes application programming interface (API). The Kubernetes API serves as a set of endpoints that can be interacted with to view, modify, or delete different Kubernetes resources, many of which are used to configure different details of an application.

There are many different Kubernetes API resources, but the following table shows some of the most common ones:

Resource Name

Definition

Pod

The smallest deployable unit in Kubernetes. Encapsulates one or more containers.

Deployment

Used to deploy and manage a set of Pods. Maintains the desired amount of Pod replicas (1 by default).

StatefulSet

Similar to a Deployment resource, except a StatefulSet maintains a sticky identity for each Pod replica and can also provision PersistentVolumeClaims resources (explained further down in this table) unique to each Pod.

Service

Used to load-balance between Pod replicas.

Ingress

Provides external access to services within the cluster.

ConfigMap

Stores application configuration to decouple configuration from code.

Secret

Used to store sensitive data such as credentials and keys. Data stored in Secrets resources are only obfuscated using Base64 encoding, so administrators must ensure that proper access controls are in place.

PersistentVolumeClaim

A request for storage by a user. Used to provide persistence for running Pods.

Role

Represents a set of permissions to be allowed against the Kubernetes API.

RoleBinding

Grants the permissions defined in a role to a user or set of users.

Table 1.1 – Common Kubernetes resources

Creating resources is central to deploying and managing an application on Kubernetes, but what does a user need to do to create them? We will explore this question further in the next section.