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
€18.99 per month
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3 (2 Ratings)
Paperback Jul 2018 504 pages 1st Edition
eBook
€8.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Denis Zuev Profile Icon Artemii Kropachev Profile Icon Aleksey Usov
Arrow right icon
€18.99 per month
Full star icon Full star icon Full star icon Empty star icon Empty star icon 3 (2 Ratings)
Paperback Jul 2018 504 pages 1st Edition
eBook
€8.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€8.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
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 : 9781788992329
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

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

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.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
€189.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 €5 each
Feature tick icon Exclusive print discounts
€264.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 €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 111.97
Learn Ansible
€41.99
Learn OpenShift
€32.99
Getting Started with Kubernetes
€36.99
Total 111.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

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.