Kubernetes for Developers

A developer's field-guide to designing scalable services using Kubernetes
Preview in Mapt

Kubernetes for Developers

Joseph Heck
New Release!

A developer's field-guide to designing scalable services using Kubernetes
Mapt Subscription
FREE
$24.99/m after trial
eBook
$10.00
RRP $35.99
Save 72%
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$10.00
$44.99
$29.99 p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 14 Day Trial

Frequently bought together


Kubernetes for Developers Book Cover
Kubernetes for Developers
$ 35.99
$ 10.00
Kubernetes Cookbook - Second Edition Book Cover
Kubernetes Cookbook - Second Edition
$ 35.99
$ 10.00
Buy 2 for $20.00
Save $51.98
Add to Cart

Book Details

ISBN 139781788834759
Paperback374 pages

Book Description

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

Chapter 1: Setting Up Kubernetes for Development
What you need for development
Getting a local cluster up and running
Resetting and restarting your cluster
Looking at what's built-in and included with Minikube
Verifying Docker
Clearing and cleaning Docker images
Kubernetes concept – container
Kubernetes resource – Pod
Kubernetes resource – Node
Kubernetes resource – ReplicaSet
Kubernetes resource – Deployment
Summary
Chapter 2: Packaging Your Code to Run in Kubernetes
Container images
Making your first container
Example – Python/Flask container image
Example – Node.js/Express container image
Tagging your container images
Summary
Chapter 3: Interacting with Your Code in Kubernetes
Practical notes for writing software to run in a container
Logs
More debugging techniques
Kubernetes concepts – labels
Kubernetes concepts – selectors
Kubernetes resources – service
Discovering services from within your Pod
Exposing services outside the cluster
Example service – Redis
Deployments and rollouts
Summary
Chapter 4: Declarative Infrastructure
Imperative versus declarative commands
Declaring your first application
Kubernetes resource – Annotations
Kubernetes resource – ConfigMap
Kubernetes resource – Secrets
Example – Python/Flask deployment with ConfigMap
Summary
Chapter 5: Pod and Container Lifecycles
Pod lifecycle
Probes 
Container lifecycle hooks
Initialization containers
Handling a graceful shutdown
Summary
Chapter 6: Background Processing in Kubernetes
Job
CronJob
A worker queue example with Python and Celery
Persistence with Kubernetes
Stateful Sets
Custom Resource Definition
Summary
Chapter 7: Monitoring and Metrics
Built-in metrics with Kubernetes
Kubernetes concept – Quality of Service
Capturing metrics with Prometheus
Installing Grafana
Using Prometheus to view application metrics
Summary
Chapter 8: Logging and Tracing
A Kubernetes concept – DaemonSet
Installing and using Elasticsearch, Fluentd, and Kibana
Viewing logs using Kibana
Distributed tracing with Jaeger
Example – adding tracing to your application
Summary
Chapter 9: Integration Testing
Testing strategies using Kubernetes
Simple validation with Bats
Example – integration testing with Python
Example – integration testing with Node.js
Continuous integration with Kubernetes
Summary
Chapter 10: Troubleshooting Common Problems and Next Steps
Common errors and how to resolve them
Emerging projects for developers
Interacting with the Kubernetes project
Summary

What You Will Learn

  • Build your software into containers.
  • Deploy and debug software running in containers within Kubernetes.
  • Declare and add configuration through Kubernetes.
  • Define how your application fits together, using internal and external services.
  • Add feedback to your code to help Kubernetes manage your services
  • Monitor and measure your services through integration testing and in production deployments.

Authors

Table of Contents

Chapter 1: Setting Up Kubernetes for Development
What you need for development
Getting a local cluster up and running
Resetting and restarting your cluster
Looking at what's built-in and included with Minikube
Verifying Docker
Clearing and cleaning Docker images
Kubernetes concept – container
Kubernetes resource – Pod
Kubernetes resource – Node
Kubernetes resource – ReplicaSet
Kubernetes resource – Deployment
Summary
Chapter 2: Packaging Your Code to Run in Kubernetes
Container images
Making your first container
Example – Python/Flask container image
Example – Node.js/Express container image
Tagging your container images
Summary
Chapter 3: Interacting with Your Code in Kubernetes
Practical notes for writing software to run in a container
Logs
More debugging techniques
Kubernetes concepts – labels
Kubernetes concepts – selectors
Kubernetes resources – service
Discovering services from within your Pod
Exposing services outside the cluster
Example service – Redis
Deployments and rollouts
Summary
Chapter 4: Declarative Infrastructure
Imperative versus declarative commands
Declaring your first application
Kubernetes resource – Annotations
Kubernetes resource – ConfigMap
Kubernetes resource – Secrets
Example – Python/Flask deployment with ConfigMap
Summary
Chapter 5: Pod and Container Lifecycles
Pod lifecycle
Probes 
Container lifecycle hooks
Initialization containers
Handling a graceful shutdown
Summary
Chapter 6: Background Processing in Kubernetes
Job
CronJob
A worker queue example with Python and Celery
Persistence with Kubernetes
Stateful Sets
Custom Resource Definition
Summary
Chapter 7: Monitoring and Metrics
Built-in metrics with Kubernetes
Kubernetes concept – Quality of Service
Capturing metrics with Prometheus
Installing Grafana
Using Prometheus to view application metrics
Summary
Chapter 8: Logging and Tracing
A Kubernetes concept – DaemonSet
Installing and using Elasticsearch, Fluentd, and Kibana
Viewing logs using Kibana
Distributed tracing with Jaeger
Example – adding tracing to your application
Summary
Chapter 9: Integration Testing
Testing strategies using Kubernetes
Simple validation with Bats
Example – integration testing with Python
Example – integration testing with Node.js
Continuous integration with Kubernetes
Summary
Chapter 10: Troubleshooting Common Problems and Next Steps
Common errors and how to resolve them
Emerging projects for developers
Interacting with the Kubernetes project
Summary

Book Details

ISBN 139781788834759
Paperback374 pages
Read More

Read More Reviews

Recommended for You

Kubernetes Cookbook - Second Edition Book Cover
Kubernetes Cookbook - Second Edition
$ 35.99
$ 10.00
React 16 Tooling Book Cover
React 16 Tooling
$ 35.99
$ 10.00
Google Cloud Platform for Developers Book Cover
Google Cloud Platform for Developers
$ 35.99
$ 10.00
Matplotlib for Python Developers - Second Edition Book Cover
Matplotlib for Python Developers - Second Edition
$ 31.99
$ 10.00
Hybrid Cloud for Developers Book Cover
Hybrid Cloud for Developers
$ 31.99
$ 10.00
Docker for Serverless Applications Book Cover
Docker for Serverless Applications
$ 31.99
$ 10.00