Containers for Developers Handbook: A practical guide to developing and delivering applications using software containers

This document was uploaded by one of our users. The uploader already confirmed that they had the permission to publish it. If you are author/publisher or own the copyright of this documents, please report to us by using this DMCA report form.

Simply click on the Download Book button.

Yes, Book downloads on Ebookily are 100% Free.

Sometimes the book is free on Amazon As well, so go ahead and hit "Search on Amazon"

Developers are changing their deployment artifacts from application binaries to container images, giving rise to the need to build container-based apps as part of their new development workflow. Managing an app’s life cycle is complex and requires effort—this book will show you how to efficiently develop, share, and execute applications. You’ll learn how to automate the build and delivery process using CI/CD tools with containers as container orchestrators manage the complexity of running cluster-wide applications, creating infrastructure abstraction layers, while your applications run with high availability, resilience, and persistence. As you advance, you’ll develop, test, and debug applications on your desktop and get them ready to run in production with optimal security standards, using deployment patterns and monitoring tools to help identify common issues. You’ll also review deployment patterns that’ll enable you to solve common deployment problems, providing high availability, scalability, and security to your applications. Finally, you’ll explore different solutions to monitor, log, and instrument your applications as per open-source community standards. By the end of this book, you’ll be able to manage your app’s life cycle by implementing CI/CD workflows using containers to automate the building and delivery of its components. What you will learn

Author(s): Urea, Francisco Javier Ramírez, 0 / 5.0 0 comments
Publisher: Packt
Year: 2023

Language: English
Pages: 490

Cover
Title Page
Copyright
Dedication
Contributors
Table of Contents
Preface
Part 1:Key Concepts of Containers
Chapter 1: Modern Infrastructure and Applications with Docker
Technical requirements
From monoliths to distributed microservice architectures
Exploring monolithic applications
Virtual machines
Three-tier architecture
Microservices architecture
Developing distributed applications
What are containers?
Understanding the main concepts of containers
Understanding dynamism in container-based applications
Tools for managing containers
Comparing virtualization and containers
Building, sharing, and running containers
Explaining Windows containers
Improving security using software containers
Labs
Installing Docker Desktop
Summary
Chapter 2: Building Docker Images
Technical requirements
Understanding how copy-on-write filesystems work
Creating container images
Using Dockerfiles to create container images
Creating container images interactively
Creating images from scratch
Understanding common Dockerfile keys
FROM
ARG
WORKDIR
COPY and ADD
RUN
USER
ENTRYPOINT
EXPOSE
HEALTHCHECK
VOLUME
The command line for creating images
Actions for creating images
Managing container images
Actions for sharing images
Advanced image creation techniques
Best practices for container image creation
Labs
Caching layers
Executing a multi-stage build process
Building images for different architectures
Summary
Chapter 3: Sharing Docker Images
Technical requirements
Container image registries and repositories
What is a registry?
Understanding how image registries work
Searching in repositories
Improving security by signing container images
Scanning image content for vulnerabilities
Labs
Deploying and using your own local registry
Signing images with Cosign
Improving security by using image content vulnerability scanners
Summary
Chapter 4: Running Docker Containers
Technical requirements
Understanding Docker software container objects
Learning about using the command line to work with containers
Limiting container access to host resources
Network isolation
Managing persistent data with containers
Limiting access to host hardware resources
Extending access to host resources
Managing container behavior
Container runtime maintenance tasks
Pruning container objects
Configuring container runtime logging
Labs
Reviewing container networking concepts
Access to container services
Exposing applications
Limiting containers’ resource usage
Avoiding the use of root users inside containers
Cleaning the container runtime
Summary
Chapter 5: Creating Multi-Container Applications
Technical requirements
Installing and using Docker Compose
Introducing the Docker Compose file syntax
YAML file definition keys
Building and sharing multi-container applications
Running and debugging multi-container applications
Managing multiple environments with Docker Compose
Labs
Deploying a simple demo application
Deploying another project using the same Compose YAML file
Removing all projects
Summary
Part 2:Container Orchestration
Chapter 6: Fundamentals of Container Orchestration
Introducing the key concepts of orchestration
Understanding stateless and stateful applications
Stateful applications
Stateless applications
Exploring container orchestrators
Kubernetes
Docker Swarm
Nomad
Apache Mesos
Cloud vendor-specific orchestration platforms
Summary
Chapter 7: Orchestrating with Swarm
Technical requirements
Deploying a Docker Swarm cluster
Understanding Docker Swarm’s architecture
Docker Swarm manager nodes
Docker Swarm worker nodes
Creating a Docker Swarm cluster
Providing high availability with Docker Swarm
Creating tasks and services for your applications
A review of stacks and other Docker Swarm resources
Secrets
Configs
Networking and exposing applications with Docker Swarm
Understanding the Docker Swarm overlay network
Using service discovery and internal load balancing
Publishing your applications
Updating your application’s services
Labs
Deploying a single-node Docker Swarm cluster
Reviewing the main features of Docker Swarm services
Deploying a complete application with Docker
Summary
Chapter 8: Deploying Applications with the Kubernetes Orchestrator
Technical requirements
Introducing the main features of Kubernetes
Comparing Kubernetes and Docker Swarm
Exploring the control plane
Understanding Kubernetes’ HA
Kubeadm Kubernetes deployment
Interacting with Kubernetes using kubectl
Deploying a functional Kubernetes cluster
Docker Desktop
Rancher Desktop
Minikube
Alternative Kubernetes desktop deployments
Creating Pods and Services
Pods
Services
Deploying orchestrated resources
ReplicaSets
Deployments
DaemonSets
StatefulSets
Jobs
CronJobs
ReplicationControllers
Improving your applications’ security with Kubernetes
Labs
Deploying a Minikube cluster with two nodes
Interacting with the Minikube deployed cluster
Exposing a Pod with a NodePort Service
Summary
Part 3:Application Deployment
Chapter 9: Implementing Architecture Patterns
Technical requirements
Applying Kubernetes resources to common application patterns
Pods
ReplicaSets
ReplicationControllers
Deployments
StatefulSets
DaemonSets
Jobs
CronJobs
Ensuring resilience and high availability with Kubernetes resources
Understanding advanced Pod application patterns
Init containers
Sidecar containers
Ambassador containers
Adaptor containers
Verifying application health
Understanding the execution of probes
Termination of Pods
Container life cycle hooks
Resource management and scalability
Horizontal Pod autoscaling
Improving application security with Pods
Security contexts
Security best practices
Labs
Summary
Chapter 10: Leveraging Application Data Management in Kubernetes
Technical requirements
Understanding the data within your application
Applying configurations using ConfigMaps
Using the downward API to inject configuration data
Managing sensitive data using Secret resources
Managing stateless and stateful data
Using volumes for storing data
Enhancing storage management in Kubernetes with PV resources
Provisioning and decommissioning storage
Labs
Summary
Chapter 11: Publishing Applications
Technical requirements
Understanding Kubernetes features for publishing applications cluster-wide
Proxying and forwarding applications for debugging
Kubernetes client proxy feature
Kubernetes client port-forward feature
Using the host network namespace for publishing applications
Using the hostNetwork key
Using hostPort
Publishing applications with Kubernetes’ NodePort feature
Providing access to your Services with LoadBalancer Services
Understanding Ingress Controllers
Deploying an Ingress Controller
Ingress resources
Improving our applications’ security
Network policies
Service mesh
Labs
Improving application access by deploying your own Ingress Controller
Publishing the simplestlab application on Kubernetes using an Ingress Controller
Summary
Chapter 12: Gaining Application Insights
Technical requirements
Understanding your application’s behavior
Obtaining access to your Kubernetes resources
Understanding Kubernetes operators
Monitoring your application’s metrics
Exploring Prometheus architecture
Installing Prometheus
Reviewing the Prometheus environment
Understanding how Prometheus manages metrics data
Scraping metrics with Prometheus
Logging your application’s important information
Installing and configuring Loki and Promtail
Load testing your applications
Adding instrumentation to your application’s code
Reviewing the OpenTelemetry demo
Labs
Summary
Part 4:Improving Applications’ Development Workflow
Chapter 13: Managing the Application Life Cycle
Technical requirements
Reviewing the application life cycle
Planning a software solution
Developing the application’s components
Testing your application
Deploying the solution
Maintaining the application
Shifting our application’s security left
Software life cycle methodologies
Security at the application level
Introducing linters
Understanding CI patterns
Versioning the code
Introducing DevOps methodology
Building artifacts
Testing your application’s components
Monitoring the build processes and tests
Sharing information about the development process
Excluding configurations from code
Automating continuous application deployment
Orchestrating CI/CD with Kubernetes
Understanding the CI component of the workflow
Using Helm to package our application’s resource manifests
Adding CD to the workflow
Labs
Summary
Index
About Packt
Other Books You May Enjoy