Book Image

Learn OpenShift

By : Denis Zuev, Artemii Kropachev, Aleksey Usov
Book Image

Learn OpenShift

By: Denis Zuev, Artemii Kropachev, Aleksey Usov

Overview of this book

Docker containers transform application delivery technologies to make them faster and more reproducible, and to reduce the amount of time wasted on configuration. Managing Docker containers in the multi-node or multi-datacenter environment is a big challenge, which is why container management platforms are required. OpenShift is a new generation of container management platforms built on top of both Docker and Kubernetes. It brings additional functionality to the table, something that is lacking in Kubernetes. This new functionality significantly helps software development teams to bring software development processes to a whole new level. In this book, we’ll start by explaining the container architecture, Docker, and CRI-O overviews. Then, we'll look at container orchestration and Kubernetes. We’ll cover OpenShift installation, and its basic and advanced components. Moving on, we’ll deep dive into concepts such as deploying application OpenShift. You’ll learn how to set up an end-to-end delivery pipeline while working with applications in OpenShift as a developer or DevOps. Finally, you’ll discover how to properly design OpenShift in production environments. This book gives you hands-on experience of designing, building, and operating OpenShift Origin 3.9, as well as building new applications or migrating existing applications to OpenShift.
Table of Contents (24 chapters)

To get the most out of this book

This books assumes that you have practical experience with Linux and open source, are comfortable working with a command-line interface (CLI), are familiar with text editors such as nano or vi/vim, and know how to use SSH to access running machines. Since OpenShift can only be installed on RHEL-derived Linux distributions, previous experience of RHEL/CentOS 7 is preferable, as opposed to Debian-based variants. Knowing about cloud technologies and containers will certainly be a plus, but is not required.

To ensure the smoothest experience, we recommend using a laptop or desktop with an adequate amount of RAM, as this is the most critical resource for OpenShift. You can see all requirements for your learning environment in the Software Hardware List section that is included in the GitHub repository. Using a system with less than 8 GB RAM may result in occasional failures during the installation of OpenShift and overall instability, which will be distracting, even though it will boost your troubleshooting skills.

Another important aspect concerns the DNS of your environment. Some network providers, such as Cox (https://www.cox.com), redirect requests for all non-existent domains (those that result in an NXDOMAIN response from upstream DNS) to a custom web page with partner search results. Normally, that is not a problem, but during the installation of OpenShift, it will manifest itself by failing the installation. This happens because local DNS lookup settings for your virtual machine and containers managed by OpenShift include several domains to contact in order before NXDOMAIN is returned to the client making the request, and the next one is tried only after the previous one has returned NXDOMAIN. So, when your provider intercepts such requests, it may return its own IP, which will result in the OpenShift installer trying to reach a certain service at that IP for a health check. As expected, the request will not be answered and the installation will fail. For Cox, this feature is called Enhanced Error Results, so we suggest you opt out of it on your account.

Download the example code files

You can download the example code files for this book from your account at www.packtpub.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packtpub.com.
  2. Select the SUPPORT tab.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Learn-OpenShift. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Let's assume that the template is stored locally as wordpress.yaml."

A block of code is set as follows:

...
node('nodejs') {
stage('build') {
openshiftBuild(buildConfig: 'nodejs-mongodb-example', showBuildLogs: 'true')
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

openshiftBuild(buildConfig: 'nodejs-mongodb-example', showBuildLogs: 'true')
}
stage('approval') {
input "Approve moving to deploy stage?"
}
stage('deploy') {
openshiftDeploy(deploymentConfig: 'nodejs-mongodb-example')
}

Any command-line input or output is written as follows:

$ vagrant ssh

Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "Once you click on the Log In button, the following page is displayed."

Warnings or important notes appear like this.
Tips and tricks appear like this.