Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Learn OpenShift
Learn OpenShift

Learn OpenShift: Deploy, build, manage, and migrate applications with OpenShift Origin 3.9

Arrow left icon
Profile Icon Denis Zuev Profile Icon Artemii Kropachev Profile Icon Aleksey Usov
Arrow right icon
NZ$14.99 NZ$51.99
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3 (2 Ratings)
eBook Jul 2018 504 pages 1st Edition
eBook
NZ$14.99 NZ$51.99
Paperback
NZ$64.99
Subscription
Free Trial
Arrow left icon
Profile Icon Denis Zuev Profile Icon Artemii Kropachev Profile Icon Aleksey Usov
Arrow right icon
NZ$14.99 NZ$51.99
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3 (2 Ratings)
eBook Jul 2018 504 pages 1st Edition
eBook
NZ$14.99 NZ$51.99
Paperback
NZ$64.99
Subscription
Free Trial
eBook
NZ$14.99 NZ$51.99
Paperback
NZ$64.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Learn OpenShift

Kubernetes Overview

In the previous chapter, we discussed container architecture, worked with Docker images and containers, took a look at different Docker registries, learned how to manage persistent storage for containers, and finally, learned how to build our own Docker image with Dockerfile. All these skills will be required in Chapter 3, CRI-O Overview, where we start working with Kubernetes. Kubernetes is an essential and critical OpenShift component. It all works like a snowball: Docker skills are required by Kubernetes, and Kubernetes skills are required by OpenShift.

Container management in a distributed environment is difficult, but not with Kubernetes. This brief introduction to Kubernetes will give you an idea of what Kubernetes is and how it works. In this chapter, you will learn how to install and configure a Kubernetes cluster using a simplified method. We will...

Technical requirements

In this chapter, we are going to use the following technologies and software:

  • Minikube
  • Bash Shell
  • GitHub
  • Kubernetes
  • Docker
  • Firefox

You will be required to install Minikube on your laptop or any other virtual environment you are going to use. All the instructions for installing Minikube can be found at https://kubernetes.io/docs/tasks/tools/install-minikube/.

All the code for this chapter is located on GitHub at https://github.com/PacktPublishing/Learn-OpenShift.

Bash Shell will be used as a part of your virtual environment.

Firefox or any other browser can be used to navigate through Docker Hub.

Container management systems overview

Containers offer unmatched benefits in terms of density, deployment speed, and scalability in comparison to virtualization. But containers by themselves are not enough to match all the requirements of today's business, which expects the infrastructure to be adaptable to dynamic challenges. It is quite simple to start and manage a couple dozen containers, but things get complicated when the number climbs to hundreds, which is very common for large workloads. This is where Container Orchestration Engines (COE) come in. They bring true power to containers, offering various mechanisms to deploy, destroy, and scale multiple containers rapidly.

There are multiple container management solutions available, with the most popular being Kubernetes and Docker Swarm:

  • Kubernetes: First released in July 2015, Kubernetes comes directly from Borg—...

Kubernetes versus Docker Swarm

Kubernetes and Docker Swarm are the most commonly used orchestration frameworks. They provide a similar set of capabilities and essentially solve the same problem—management containers in an unsafe and highly dynamic environment. While some of their features overlap, there are also significant differences and the choice of system depends on many factors, such as the number of containers, availability requirements, and team expertise, to name a few.

The table provides an insight into the most important differences:

Kubernetes

Docker Swarm

A separate modular design project that has its own dependencies.

Native container orchestration solution available out of the box.

Relatively steep learning curve due to new concepts and complex architecture.

Easy to get started; uses familiar terminology; more lightweight.

A pod is...

Kubernetes key concepts

Like any complex system, a Kubernetes cluster can be viewed from multiple perspectives. From the infrastructure perspective, it comprises two sets of nodes; they can be bare-metal servers as well as VMs:

  • Masters:

This type of node is responsible for cluster management, network allocation, quota enforcement, synchronization, and communication. Master nodes act as the main point of contact for clients—be it actual people or some external system. In the simplest setup, there can be only one master, but highly available clusters require at least two to prevent common fail situations. The most important service that masters run is the API.

  • Nodes:

Nodes do the actual work of hosting Docker containers. More specifically, nodes provide a runtime environment for running pods, which are described later in this book. These servers run the kubelet service...

Kubernetes installation and configuration

In this chapter, you will install Minikube—a simple single-node Kubernetes cluster. While not suitable for any production-grade workload, it is a useful tool to learn the basics of cluster management quickly. Although it supports several drivers for VM providers, in this tutorial we will use the KVM2 driver since KVM virtualization is available even in a base Linux environment.

The easiest method is to go to https://kubernetes.io/docs/getting-started-guides/minikube/ and install Minikube on your favorite OS. Then go to https://kubernetes.io/docs/tasks/tools/install-kubectl/ and install kubectl. kubectl is a CLI command to manage Kubernetes. Once you are done, it is time to start Minikube:

$ minikube start
Starting local Kubernetes v1.9.0 cluster...
Starting VM...
Downloading Minikube ISO
...
<output omitted>
...
Kubectl is now configured...

Working with kubectl

Kubectl is a command-line interface for managing a Kubernetes cluster and its resources. In this section, you will learn about the most common commands and their use cases.

The syntax for all the commands follows this convention:

$ kubectl <COMMAND> <RESOURCE_TYPE> <RESOURCE_NAME> <OPTIONS>

Commands in angle brackets <> mean the following:

  • COMMAND: An action to be executed against one or more resources.
  • RESOURCE_TYPE: The type of resource to be acted upon, for example, a pod or service.
  • RESOURCE_NAME: The name of the resource(s) to manage.
  • OPTIONS: Various flags used to modify the behavior of kubectl commands. They have higher priority than default values and environment variables, thus overriding them.

Getting help

...

Clearing the virtual environment

Once you are done working with Kubernetes, you can easily stop the Minikube cluster by running the minikube stop command:

$ minikube stop
Stopping local Kubernetes cluster...
Machine stopped.

After that, you can delete the Minikube VM if you want by running the minikube delete command:

$ minikube delete
Deleting local Kubernetes cluster...
Machine deleted.

Verify that the Minikube cluster no longer exists:

$ minikube status
minikube:
cluster:
kubectl:

Kubernetes limitations

Although it is a powerful orchestration engine, Kubernetes doesn't have the features that are commonly required by PaaS solutions such as OpenShift and others:

  • Security:

Kubernetes namespaces are provided mainly for the purpose of resource quota enforcement for different groups of users, but they do not provide any security constraints or authentication. For example, every user from every namespace can see all other namespaces and their resources.

  • Deployments:

Kubernetes provides the means to create a deployment from an image with a single command, but doesn't create a service for external clients.

  • SCM integration:

Kubernetes doesn't support integration with SCM via webhooks to facilitate deployment.

  • Builds:

Kubernetes doesn't provide advanced build modes such as Source-to-Image (S2I) and Custom Builder.

  • Authentication:

Support...

Summary

In this chapter, we have briefly discussed Kubernetes concepts and the Kubernetes architecture, and the main difference between Kubernetes and Docker Swarm. We installed Kubernetes using Minikube, which is a very easy-to-use CLI tool with which to set up a Kubernetes lab environment. Then we used the kubectl command to perform various tasks such as running, editing, describing, and deleting Kubernetes pods and other Kubernetes resources. Finally, we finished by listing the main Kubernetes limitations, which we are going to address later in this book.

In the next chapter, we are going to work with CRI-O, which is a universal container runtime interface that allows Kubernetes to provide support for different container platforms.

Questions

  1. What are the two Node types used by Kubernetes?:
    1. Node
    2. Minikube
    3. Vagrant
    4. Master
  1. Which container platforms are supported by Kuberntes? choose two:
    1. Docker
    2. OpenShift
    3. Rkt
    4. Minishift
  2. In Kubernetes, a pod is a minimal unit of deployment which represents a group of containers:
    1. True
    2. False
  3. What are the main two Kubernetes services running on a Kubernetes Node? choose two:
    1. etcd
    2. kubelet
    3. kube-proxy
    4. kube-node
    5. kube-apiserver
  4. What are acceptable file formats for creating Kubernetes resources with the kubectl create -f command? choose two:
    1. JSON
    2. Jinja2
    3. CSV
    4. YANG
    5. YAML
  5. Kubernetes has a built-in CI/CD toolset to improve corporate software delivery frameworks:
    1. True
    2. False

Further reading

Since we are covering the very basics of Docker containers, you may be interested in diving into specific topics. Here's a list of links that may be helpful to look through to learn more about Docker and containers in general:

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • •Gain hands-on experience of working with Kubernetes and Docker
  • •Learn how to deploy and manage applications in OpenShift
  • •Get a practical approach to managing applications on a cloud-based platform
  • •Explore multi-site and HA architectures of OpenShift for production

Description

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.

Who is this book for?

The book is for system administrators, DevOps engineers, solutions architects, or any stakeholder who wants to understand the concept and business value of OpenShift.

What you will learn

  • •Understand the core concepts behind containers and container orchestration tools
  • •Understand Docker, Kubernetes, and OpenShift, and their relation to CRI-O
  • •Install and work with Kubernetes and OpenShift
  • •Understand how to work with persistent storage in OpenShift
  • •Understand basic and advanced components of OpenShift, including security and networking
  • •Manage deployment strategies and application's migration in OpenShift
  • •Understand and design OpenShift high availability

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jul 30, 2018
Length: 504 pages
Edition : 1st
Language : English
ISBN-13 : 9781788999649
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jul 30, 2018
Length: 504 pages
Edition : 1st
Language : English
ISBN-13 : 9781788999649
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just NZ$7 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just NZ$7 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total NZ$ 217.97
Learn Ansible
NZ$80.99
Learn OpenShift
NZ$64.99
Getting Started with Kubernetes
NZ$71.99
Total NZ$ 217.97 Stars icon
Banner background image

Table of Contents

23 Chapters
Containers and Docker Overview Chevron down icon Chevron up icon
Kubernetes Overview Chevron down icon Chevron up icon
CRI-O Overview Chevron down icon Chevron up icon
OpenShift Overview Chevron down icon Chevron up icon
Building an OpenShift Lab Chevron down icon Chevron up icon
OpenShift Installation Chevron down icon Chevron up icon
Managing Persistent Storage Chevron down icon Chevron up icon
Core OpenShift Concepts Chevron down icon Chevron up icon
Advanced OpenShift Concepts Chevron down icon Chevron up icon
Security in OpenShift Chevron down icon Chevron up icon
Managing OpenShift Networking Chevron down icon Chevron up icon
Deploying Simple Applications in OpenShift Chevron down icon Chevron up icon
Deploying Multi-Tier Applications Using Templates Chevron down icon Chevron up icon
Building Application Images from Dockerfile Chevron down icon Chevron up icon
Building PHP Applications from Source Code Chevron down icon Chevron up icon
Building a Multi-Tier Application from Source Code Chevron down icon Chevron up icon
CI/CD Pipelines in OpenShift Chevron down icon Chevron up icon
OpenShift HA Architecture Overview Chevron down icon Chevron up icon
OpenShift HA Design for Single and Multiple DCs Chevron down icon Chevron up icon
Network Design for OpenShift HA Chevron down icon Chevron up icon
What is New in OpenShift 3.9? Chevron down icon Chevron up icon
Assessments Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3
(2 Ratings)
5 star 50%
4 star 0%
3 star 0%
2 star 0%
1 star 50%
Amazon Customer Nov 07, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book has the enormous advantage of covering in a single volume all the basic concepts (docker then k8s) before reaching the Openshift part. It also provides the reader with a detailed understanding of the foundations as well as of the top layer. And when you link the explanations with easy to use hands-on exercises it just makes all of it a very valuable addition to the technical library of those who want to become better and more knowledgeable about this new IT trend.I hope the authors will take the time to refresh the current edition as Openshift moves forward.Keep up the good work
Amazon Verified review Amazon
Vik Feb 03, 2019
Full star icon Empty star icon Empty star icon Empty star icon Empty star icon 1
E.g. 1 page 122 - the concept of labels is explained using selectors when the latter has not been introduced yet. E.g. 2 page 124- the word "uneven" is used to mean an "odd" number when talking about the recommended no. of etcd service.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.