O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Deploying to OpenShift

Book Description

Get an in-depth tour of OpenShift, the container-based software deployment and management platform from Red Hat that provides a secure multi-tenant environment for the enterprise. This practical guide describes in detail how OpenShift, building on Kubernetes, enables you to automate the way you create, ship, and run applications in a containerized environment.

Author Graham Dumpleton provides the knowledge you need to make the best use of the OpenShift container platform to deploy not only your cloud-native applications, but also more traditional stateful applications. Developers and administrators will learn how to run, access, and manage containers in OpenShift, including how to orchestrate them at scale.

  • Build application container images from source and deploy them
  • Implement and extend application image builders
  • Use incremental and chained builds to accelerate build times
  • Automate builds by using a webhook to link OpenShift to a Git repository
  • Add configuration and secrets to the container as project resources
  • Make an application visible outside the OpenShift cluster
  • Manage persistent storage inside an OpenShift container
  • Monitor application health and manage the application lifecycle

This book is a perfect follow-up to OpenShift for Developers: A Guide for Impatient Beginners (O’Reilly).

Table of Contents

  1. Preface
    1. Who Should Read This Book
    2. Why I Wrote This Book
    3. Online Resources
    4. Conventions Used in This Book
    5. O’Reilly Safari
    6. How to Contact Us
    7. Acknowledgments
  2. 1. The OpenShift Container Platform
    1. The Role of Containers
    2. Orchestrating at Scale
    3. Containers as a Service
    4. Platform as a Service
    5. Deploying Your Application
  3. 2. Running an OpenShift Cluster
    1. Using OpenShift Online
    2. Installing OpenShift Origin
    3. Launching Using Minishift
    4. Running oc cluster up
    5. Summary
  4. 3. Accessing the OpenShift Cluster
    1. Using the Web Console
    2. Using the Command Line
    3. Using the OpenShift REST API
    4. Summary
  5. 4. Adding Applications to a Project
    1. The Role of a Project
    2. Creating a Project
    3. Adding a Collaborator
    4. Deploying Applications
    5. Deploying from the Catalog
    6. Deploying an Image
    7. Deploying a Set of Resources
    8. Summary
  6. 5. Deploying Applications from Images
    1. Deploying Your First Image
    2. Scaling Up the Application
    3. Runtime Configuration
    4. Deleting the Application
    5. Deploying Using the Web Console
    6. Importing an Image
    7. Pushing to the Registry
    8. Images and Security
    9. Summary
  7. 6. Building and Deploying from Source
    1. The Source Build Strategy
    2. Deploying from Source
    3. Creating a Separate Build
    4. Triggering a New Build
    5. Building from a Local Source
    6. Binary Input Builds
    7. Testing the Container Image
    8. Build and Runtime Configuration
    9. Summary
  8. 7. Building an Image from a Dockerfile
    1. The Docker Build Strategy
    2. Security and Docker Builds
    3. Creating the Build
    4. Deploying the Image
    5. Build and Runtime Configuration
    6. Using an Inline Dockerfile
    7. Summary
  9. 8. Understanding Source-to-Image Builders
    1. The Source-to-Image Project
    2. Building the Application Image
    3. Assembling the Source Code
    4. Creating an S2I Builder Image
    5. Building the S2I Builder Image
    6. Using the S2I Builder with OpenShift
    7. Adding an S2I Builder to the Catalog
    8. Summary
  10. 9. Customizing Source-to-Image Builds
    1. Using Environment Variables
    2. Overriding the Builder Scripts
    3. Read-Only Code Repositories
    4. Overriding the Runtime Image
    5. Updating the Image Metadata
    6. Summary
  11. 10. Using Incremental and Chained Builds
    1. Faster Builds Using Caching
    2. Using Incremental Builds
    3. Saving Artifacts from a Build
    4. Restoring the Build Artifacts
    5. Enabling Incremental Builds
    6. Using Chained Builds
    7. Summary
  12. 11. Webhooks and Build Automation
    1. Using a Hosted Git Repository
    2. Accessing a Private Git Repository
    3. Adding a Repository Webhook
    4. Customized Build Triggers
    5. Summary
  13. 12. Configuration and Secrets
    1. Passing Environment Variables
    2. Working with Configuration Files
    3. Handling of Secret Information
    4. Deleting Configuration and Secrets
    5. Summary
  14. 13. Services, Networking, and Routing
    1. Containers and Pods
    2. Services and Endpoints
    3. Connecting Between Projects
    4. Creating External Routes
    5. Using Secure Connections
    6. Internal and External Ports
    7. Exposing Non-HTTP Services
    8. Local Port Forwarding
    9. Summary
  15. 14. Working with Persistent Storage
    1. Types of Persistent Storage
    2. Claiming a Persistent Volume
    3. Unmounting a Persistent Volume
    4. Reusing a Persistent Volume Claim
    5. Sharing Between Applications
    6. Sharing Between Containers
    7. Deleting a Persistent Volume
    8. Copying Data to a Volume
    9. Summary
  16. 15. Resource Quotas and Limits
    1. What Is Managed by Quotas
    2. Quotas versus Limit Ranges
    3. Requests Versus Limits
    4. Resource Requirements
    5. Overriding Build Resources
    6. Summary
  17. 16. Monitoring Application Health
    1. The Role of a Readiness Probe
    2. The Role of a Liveness Probe
    3. Using an HTTP Request
    4. Using a Container Command
    5. Using a Socket Connection
    6. Probe Frequency and Timeouts
    7. Summary
  18. 17. Application Lifecycle Management
    1. Deployment Strategies
    2. Rolling Deployment
    3. Recreate Deployment
    4. Custom Deployments
    5. Container Runtime Hooks
    6. Init Containers
    7. Summary
  19. 18. Logging, Monitoring, and Debugging
    1. Viewing the Build Logs
    2. Viewing Application Logs
    3. Monitoring Resource Objects
    4. Monitoring System Events
    5. Viewing Container Metrics
    6. Running an Interactive Shell
    7. Debugging Startup Failures
    8. Summary
  20. Afterword
    1. What Was Covered
    2. Final Words
  21. Index