DevOps for the Desperate: A Hands-On Survival Guide
DevOps for the Desperate is a hands-on, no-nonsense guide for those who land in a DevOps environment and need to get up and running quickly.

This book introduces fundamental concepts software developers need to know to flourish in a modern DevOps environment including infrastructure as code, configuration management, security, containerization and orchestration, monitoring and alerting, and troubleshooting. Readers will follow along with hands-on examples to learn how to tackle common DevOps tasks.
 
The book begins with an exploration of DevOps concepts using Vagrant and Ansible to build systems with repeatable and predictable states, including configuring a host with user-based security. Next up is a crash course on containerization, orchestration, and delivery using Docker, Kubernetes, and a CI/CDpipeline. The book concludes with a primer in monitoring and alerting with tips for troubleshootingcommon host and application issues.
 
You'll learn how to:
  • Use Ansible to manage users and groups, and enforce complex passwords
  • Create a security policy for administrative permissions, and automate a host-based firewall
  • Get started with Docker to containerize applications, use Kubernetes for orchestration, and deploycode using a CI/CD pipeline
  • Build a monitoring stack, investigate common metric patterns, and trigger alerts
  • Troubleshoot and analyze common issues and errors found on hosts
  • 1140540173
    DevOps for the Desperate: A Hands-On Survival Guide
    DevOps for the Desperate is a hands-on, no-nonsense guide for those who land in a DevOps environment and need to get up and running quickly.

    This book introduces fundamental concepts software developers need to know to flourish in a modern DevOps environment including infrastructure as code, configuration management, security, containerization and orchestration, monitoring and alerting, and troubleshooting. Readers will follow along with hands-on examples to learn how to tackle common DevOps tasks.
     
    The book begins with an exploration of DevOps concepts using Vagrant and Ansible to build systems with repeatable and predictable states, including configuring a host with user-based security. Next up is a crash course on containerization, orchestration, and delivery using Docker, Kubernetes, and a CI/CDpipeline. The book concludes with a primer in monitoring and alerting with tips for troubleshootingcommon host and application issues.
     
    You'll learn how to:
  • Use Ansible to manage users and groups, and enforce complex passwords
  • Create a security policy for administrative permissions, and automate a host-based firewall
  • Get started with Docker to containerize applications, use Kubernetes for orchestration, and deploycode using a CI/CD pipeline
  • Build a monitoring stack, investigate common metric patterns, and trigger alerts
  • Troubleshoot and analyze common issues and errors found on hosts
  • 17.99 In Stock
    DevOps for the Desperate: A Hands-On Survival Guide

    DevOps for the Desperate: A Hands-On Survival Guide

    by Bradley Smith
    DevOps for the Desperate: A Hands-On Survival Guide

    DevOps for the Desperate: A Hands-On Survival Guide

    by Bradley Smith

    eBook

    $17.99 

    Available on Compatible NOOK devices, the free NOOK App and in My Digital Library.
    WANT A NOOK?  Explore Now

    Related collections and offers


    Overview

    DevOps for the Desperate is a hands-on, no-nonsense guide for those who land in a DevOps environment and need to get up and running quickly.

    This book introduces fundamental concepts software developers need to know to flourish in a modern DevOps environment including infrastructure as code, configuration management, security, containerization and orchestration, monitoring and alerting, and troubleshooting. Readers will follow along with hands-on examples to learn how to tackle common DevOps tasks.
     
    The book begins with an exploration of DevOps concepts using Vagrant and Ansible to build systems with repeatable and predictable states, including configuring a host with user-based security. Next up is a crash course on containerization, orchestration, and delivery using Docker, Kubernetes, and a CI/CDpipeline. The book concludes with a primer in monitoring and alerting with tips for troubleshootingcommon host and application issues.
     
    You'll learn how to:
  • Use Ansible to manage users and groups, and enforce complex passwords
  • Create a security policy for administrative permissions, and automate a host-based firewall
  • Get started with Docker to containerize applications, use Kubernetes for orchestration, and deploycode using a CI/CD pipeline
  • Build a monitoring stack, investigate common metric patterns, and trigger alerts
  • Troubleshoot and analyze common issues and errors found on hosts

  • Product Details

    ISBN-13: 9781718502499
    Publisher: No Starch Press
    Publication date: 07/12/2022
    Sold by: Penguin Random House Publisher Services
    Format: eBook
    Pages: 176
    File size: 2 MB

    About the Author

    Bradley Smith is a Director of Infrastructure and resides in Denver, Colorado. He has been an engineer for more than 20 years at many startups and businesses of varying sizes. He's built and trained numerous DevOps, SRE, and software engineering teams. A Boston native, Bradley graduated from the University of Massachusetts Lowell.

    Table of Contents

    Acknowledgments xiv

    Introduction xv

    What is the Current State of DevOps? xvi

    Who Should Read This Book? xvii

    How This Book Is Organized xvii

    Part I Infrastructure as Code, Configuration Management, Security, and Administration xvii

    Part II Containerization and Deploying Modern Applications xviii

    Part III Observability and Troubleshooting xviii

    What You'll Need xviii

    Downloading and Installing VirtualBox xx

    Companion Repository xxi

    Editor xxi

    Part I Infrastructure as Code, Configuration Management, Security, and Administration 1

    1 Setting Up a Virtual Machine 3

    Why Use Code to Build Infrastructure? 3

    Getting Started with Vagrant 4

    Installation 4

    Anatomy of a Vagrantfile 5

    Basic Vagrant Commands 6

    Getting Started with Ansible 6

    Installation 7

    Key Ansible Concepts 7

    Ansible Playbook 8

    Basic Ansible Commands 9

    Creating an Ubuntu VM 9

    Summary 11

    2 Using Ansible to Manage Passwords, Users, and Groups 13

    Enforcing Complex Passwords 14

    Installing libpam-pwquality 14

    Configuring pam_pwquality to Enforce a Stricter Password Policy 15

    Linux User Types 16

    Getting Started with the Ansible User Module 16

    Generating a Complex Password 17

    Linux Groups 18

    Getting Started with the Ansible Group Module 18

    Assigning a User to the Group 19

    Creating Protected Resources 19

    Updating the VM 20

    Testing User and Group Permissions 21

    Summary 23

    3 Using Ansible to Configure SSH 25

    Understanding and Activating Public Key Authentication 26

    Generating a Public Key Pair 26

    Using Ansible to Get Your Public Key on the VM 27

    Adding Two-Factor Authentication 28

    Installing Google Authenticator 29

    Configuring Google Authenticator 29

    Configuring PAM for Google Authenticator 30

    Configuring the SSH Server 31

    Restarting the SSH Server with a Handler 32

    Provisioning the VM 33

    Testing SSH Access 34

    Summary 35

    4 Controlling User Commands with Sudo 37

    What Is sudo? 38

    Planning a sudoers Security Policy 38

    Installing the Greeting Web Application 39

    Anatomy of a sudoers File 41

    Creating the sudoers File 42

    The sudoers Template 43

    Provisioning the VM 44

    Testing Permissions 45

    Accessing the Web Application 45

    Editing greeting.py to Test the sudoers Policy 46

    Stopping and Starting with systemctl 46

    Audit Lags 47

    Summary 48

    5 Automating and Testing a Host-Based Firewall 49

    Planning the Firewall Rules 50

    Automating UFW Rules 50

    Provisioning the VM 53

    Testing the Firewall 54

    Scanning Ports with Nmap 55

    Firewall Logging 56

    Rate Limiting 57

    Summary 58

    Part II Containerization and Deploying Modern Applications 59

    6 Containerizing an Application with Docker 61

    Docker from 30,000 Feet 62

    Getting Started with Docker 62

    Dockerfile Instructions 63

    Container Images and Layers 64

    Containers 64

    Namespaces and Cgroups 64

    Installing and Testing Docker 65

    Installing the Docker Engine with Minikube 65

    Installing the Docker Client and Setting Up Docker Environment Variables 66

    Testing the Docker Client Connectivity 66

    Containerizing a Sample Application 66

    Dissecting the Example telnet-server Dockerfile 67

    Building the Container Image 68

    Verifying the Docker Image 69

    Running the Container 70

    Other Docker Client Commands 71

    Exec 71

    Rm 72

    Inspect 72

    History 73

    Stats 74

    Testing the Container 74

    Connecting to the Telnet-Server 74

    Getting Logs from the Container 75

    Summary 76

    7 Orchestrating with Kubernetes 77

    Kubernetes from 30,000 Feet 78

    Kubernetes Workload Resources 79

    Pods 79

    ReplicaSet 79

    Deployments 79

    StatefulSets 80

    Services 80

    Volumes 80

    Secrets 81

    ConfigMaps 81

    Namespaces 81

    Deploying the Sample telnet-server Application 82

    Interacting with Kubernetes 82

    Reviewing the Manifests 82

    Creating a Deployment and Services 87

    Viewing the Deployment and Services 88

    Testing the Deployment and Services 89

    Accessing the Telnet Server 89

    Troubleshooting Tips 91

    Killing a Pod 92

    Scaling 92

    Logs 93

    Summary 94

    8 Deploying Code 95

    CI/CD in Modern Application Stacks 96

    Setting Up Your Pipeline 97

    Reviewing the skaffold.yaml File 98

    Reviewing the Container Tests 99

    Simulating a Development Pipeline 100

    Making a Code Change 102

    Testing the Code Change 103

    Testing a Rollback 104

    Other CI/CD Tooling 105

    Summary 106

    Part III Observability and Troubleshooting 107

    9 Observability 109

    Monitoring Overview 110

    Monitoring the Sample Application 111

    Installing the Monitoring Stack 112

    Verifying the Installation 113

    Metrics 115

    Golden Signals 115

    Adjusting the Monitoring Pattern 115

    The telnet-server Dashboard 116

    PromQL: A Primer 118

    Alerts 119

    Reviewing Golden Signal Alerts in Prometheus 119

    Routing and Notifications 121

    Summary 123

    10 Troubleshooting Hosts 125

    Troubleshooting and Debugging: A Primer 126

    Scenario: High Load Average 127

    Uptime 127

    Top 128

    Next Steps 129

    Scenario: High Memory Usage 129

    Free 129

    Vmstat 130

    Ps 131

    Next Steps 131

    Scenario: High iowait 131

    Iostat 132

    Iotop 133

    Next Steps 133

    Scenario: Hostname Resolution Failure 133

    Resolv.conf 134

    Resolvectl 135

    Dig 136

    Next Steps 137

    Scenario: Out of Disk Space 138

    Df 138

    Find 138

    Isof 139

    Next Steps 139

    Scenario: Connection Refused 140

    Curl 140

    Ss 140

    Tcpdump 141

    Next Steps 142

    Searching Logs 142

    Common Logs 143

    Common journals Commands 144

    Parsing Logs 146

    Probing Processes 148

    Strace 148

    Summary 151

    Index 153

    From the B&N Reads Blog

    Customer Reviews