Fundamentals of DevOps and Software Delivery

By Yevgeniy Brikman

There are many guides out there on how to write software. This book is a guide to software delivery: that is, all the processes, tools, and techniques that are required to run software in production and maintain it on an ongoing basis. In particular, this book is a guide to DevOps, one of the methodologies used today to make software delivery vastly more efficient.

Whereas most DevOps content tends to focus primarily on culture and theory, this book is a hands-on guide that includes dozens of examples that walk you, step-by-step, through how to run real systems and real code. You’ll start with the basics—running a single server—and work all the way up to Kubernetes clusters, automated deployment pipelines, distributed data systems, and more.

By the time you’re done with the book, you will have had hands-on practice with all the core concepts and best practices of modern DevOps and software delivery.

Buy Now

About the book

This book is for individual contributors in operations (e.g., current and aspiring Site Reliability Engineers, DevOps Engineers, Sysadmins, Operations Engineers, and Release Engineers) who want to level up their knowledge of software delivery, individual contributors in dev (e.g., Software Engineers, Software Developers, Web Developers, and Full Stack Engineers) who want to learn more about the operations side of the house, and managers in engineering (e.g., Engineering Managers, Engineering Directors, CTOs, VPEs, and CIOs) who want to learn how to adopt DevOps and software delivery best practices in their organizations.

Chapter 1
An Introduction to DevOps and Software Delivery

Key ideas you'll explore
  • The evolution of DevOps.
  • On-prem vs cloud.
  • Platform as a Service (PaaS) vs Infrastructure as a Service (IaaS).
Examples you'll try
  • Run an app on Fly.io.
  • Run an app on an EC2 instance in AWS.

Chapter 2
How to Manage Your Infrastructure as Code

Key ideas you'll explore
  • Ad hoc scripts.
  • Configuration management tools.
  • Server templating tools.
  • Provisioning tools.
Examples you'll try
  • Use Bash to deploy an EC2 instance.
  • Use Ansible to deploy an EC2 instance.
  • Use Packer to build an AMI.
  • Use OpenTofu to deploy an EC2 instance.

Chapter 3
How to Deploy Many Apps: VMs, Containers, and Serverless

Key ideas you'll explore
  • Server orchestration.
  • VM orchestration.
  • Container orchestration.
  • Serverless orchestration.
Examples you'll try
  • Use Ansible to deploy app servers & Nginx.
  • Use OpenTofu to deploy an ASG and ALB.
  • Deploy a Dockerized app in Kubernetes.
  • Deploy a serverless app with AWS Lambda.

Chapter 4
How to Version, Build, and Test Your Code

Key ideas you'll explore
  • Version control.
  • Build systems.
  • Dependency management.
  • Automated testing.
Examples you'll try
  • Store your code in GitHub and use PRs.
  • Configure your build in NPM.
  • Set up automated tests for a Node.js app.
  • Set up automated tests for OpenTofu code.

Chapter 5
How to set up CI and CD

Key ideas you'll explore
  • Trunk-based development.
  • Branch by abstraction.
  • Feature toggles.
  • Deployment strategies and pipelines.
Examples you'll try
  • Use OIDC with GitHub Actions and AWS.
  • Run tests in GitHub Actions.
  • Run deployments in GitHub Actions.

Chapter 6
How to Work with Multiple Teams and Environments

Key ideas you'll explore
  • Internal developer platforms.
  • Microservices.
  • Updating and patching.
Examples you'll try
  • Create multiple AWS accounts.
  • Deploy microservices in Kubernetes.
  • Configure automated updates.

Chapter 7
How to set up Networking: VPCs, VPN, and DNS

Key ideas you'll explore
  • DNS, domain names, CDN.
  • Virtual private clouds (VPCs).
  • Service discovery, service meshes.
  • Network access and hardening.
Examples you'll try
  • Set up a custom domain name in Route 53.
  • Deploy a custom VPC in AWS.
  • Do service discovery with Kubernetes.
  • Use SSH and EC2 Instance Connect.

Chapter 8
How to Manage Authentication, Authorization, and Secrets

Key ideas you'll explore
  • Authentication and user management.
  • Authorization, permissions, ACLs.
  • Encryption at rest and in transit.
  • Secrets management.
Examples you'll try
  • Set up SSO and roles for AWS.
  • Use ACM to provision a TLS certificate.
  • Store secrets in AWS Secrets Manager.

Chapter 9
How to store data: SQL, NoSQL, Queues, and more

Key ideas you'll explore
  • Local and network drives.
  • Relational DBs, schema management.
  • NoSQL, queues, data warehouses.
  • File storage.
Examples you'll try
  • Deploy PostgreSQL using RDS.
  • Deploy Redis using ElastiCache.
  • Use Flyway for schema migrations.
  • Use S3 and CloudFront for static assets.

Chapter 10
How to Monitor Your Systems: Metrics, Logs, and Alerts

Key ideas you'll explore
  • Metrics and dashboards.
  • Logs and log aggregation.
  • Alerts and on-call rotations.
  • Observability and tracing.
Examples you'll try
  • Create a dashboard in Grafana.
  • Aggregate logs in Elasticsearch.
  • Set up alerts in CloudWatch.

Chapter 11
The Future of DevOps and Software Delivery

Key ideas you'll explore
  • Serverless.
  • AI.
  • DevSecOps, shift left, supply chain security.
  • Infrastructure from code, runbooks.

 
Open source code samples

The book includes dozens of code samples for you to try. You can find the code here:

https://github.com/brikis98/fundamentals-of-devops-code.

About the author

Yevgeniy Brikman

Yevgeniy (Jim) Brikman is the co-founder of Gruntwork, a company that that offers products & services for setting up world-class DevOps Foundations. He's also the author of two other books published by O'Reilly: Terraform: Up & Running, the definitive book on Terraform and OpenTofu, and Hello, Startup, which is a hands-on guide to building products, technologies, and teams in a startup.

Previously, Jim spent more than a decade building infrastructure and products that serve hundreds of millions of users at LinkedIn, TripAdvisor, Cisco Systems, and Thomson Financial. For more info, check out ybrikman.com.

This is a hands-on guide

Table of Contents

1. An Introduction to DevOps & Software Delivery 19
A Primer on DevOps 20
Where DevOps Came From 21
The Evolution of DevOps 23
Adopting DevOps Practices 33
An Introduction to Deploying Apps 35
Example: Run the Sample App Locally 35
Deploying an App on a Server 37
Deploying On Prem Versus in the Cloud 39
Deploying An App Using PaaS 43
Deploying an App Using IaaS 47
Comparing PaaS and IaaS 60
Conclusion 62
2. How to Manage Your Infrastructure as Code 65
The Benefits of IaC 67
Ad Hoc Scripts 69
Example: Deploy an EC2 Instance Using a Bash Script 70
How Ad Hoc Scripts Stack Up 72
Configuration Management Tools 74
Example: Deploy an EC2 Instance Using Ansible 75
Example: Configure a Server Using Ansible 77
How Configuration Management Tools Stack Up 82
Server Templating Tools 84
Example: Create a VM Image Using Packer 86
How Server Templating Tools Stack Up 89
Provisioning Tools 90
Example: Deploy an EC2 Instance Using OpenTofu 91
Example: Update and Destroy Infrastructure Using OpenTofu 97
Example: Deploy an EC2 Instance Using an OpenTofu Module 99
Example: Deploy an EC2 Instance Using an OpenTofu Module from GitHub 104
How Provisioning Tools Stack Up 105
Using Multiple IaC Tools Together 107
Provisioning Plus Configuration Management 107
Provisioning Plus Server Templating 107
Provisioning Plus Server Templating Plus Orchestration 108
Conclusion
3. How to Deploy Many Apps 111
An Introduction to Orchestration 112
Server Orchestration 115
Example: Deploy Multiple Servers in AWS Using Ansible 115
Example: Deploy an App Securely and Reliably Using Ansible 117
Example: Deploy a Load Balancer Using Ansible and Nginx 122
Example: Roll Out Updates with Ansible 126
VM Orchestration 127
Example: Build a VM Image Using Packer 128
Example: Deploy a VM Image in an Auto Scaling Group Using OpenTofu 130
Example: Deploy an Application Load Balancer Using OpenTofu 133
Example: Roll Out Updates with OpenTofu and Auto Scaling Groups 137
Container Orchestration 141
Example: A Crash Course on Docker 143
Example: Create a Docker Image for a Node.js app 145
Example: Deploy a Dockerized App with Kubernetes 148
Example: Deploy a Load Balancer with Kubernetes 154
Example: Roll Out Updates with Kubernetes 155
Example: Deploy a Kubernetes Cluster in AWS Using EKS 157
Example: Push a Docker Image to ECR 160
Example: Deploy a Dockerized App into an EKS Cluster 162
Serverless Orchestration 164
Example: Deploy a Serverless Function with AWS Lambda 168
Example: Deploy an API Gateway in Front of AWS Lambda 171
Example: Roll Out Updates with AWS Lambda 173
Comparing Orchestration Options 174
Conclusion 179

A snippet of the table of contents highlighting a few of the hands-on examples in the book. Try scrolling down to see more!

A book on weight lifting can teach you principles, routines, and exercises, but it's only after you spend hours in the gym practicing, sweating, and applying what you read that you'll be able to lift serious weight. Likewise, this book will teach you principles, techniques, and tools of DevOps and software delivery, but it's only after you spend hours writing code, running code, and applying what you read that you'll be able to achieve serious results.

That's what the dozens of hands-on code examples in this book are for. Instead of only reading, you get to learn by doing, following the step-by-step instructions to write and run a lot of code. You can find the sample code for the book in this GitHub repo.

Buy now

The Early Release of Fundamentals of DevOps and Software Delivery is now available at O'Reilly! Grab a copy of the ebook before the final version is done, so you can start learning today, receive new chapters as they are written, and provide feedback directly to the author to help shape the book:

Not an O'Reilly subscriber? Get a 30-day trial free with this link!

If you prefer to wait for the print version, you can pre-order the book now at the following stores:

News

Subscribe to the Foundations of DevOps Newsletter! Get the latest news, blog posts, and talks on DevOps and software delivery. No spam, ever.

The early release and pre-orders are now available!

The early release is now available at O'Reilly Media! Grab a copy of the ebook before the final version is done so you can start learning today, and receive new chapters and updates as they are written, plus the final ebook bundle when the book is released. If you prefer to wait for the final version, you can preorder the book at online stores now!

Get the early release or pre-order now! »