Difficulty: beginner
Estimated Time: 10-15 minutes

In this self paced tutorial you will learn how to use the OpenShift Container Platform to build and deploy containerized applications.

Let's get started

If you are not familiar with the OpenShift Container Platform, it's worth taking a few minutes to understand the basics of the platform as well as the environment that you will be using for this self paced tutorial.

The goal of OpenShift is to provide a great experience for both Developers and System Administrators to develop, deploy, and run containerized applications. Developers should love using OpenShift because it enables them to take advantage of both containerized applications and orchestration without having to the know the details. Developers are free to focus on their code instead of spending time writing Dockerfiles and running docker builds.

OpenShift is a full platform that incorporates several upstream projects while also providing additional features and functionality to make those upstream projects easier to consume. The core of the platform is containers and orchestration. For the container side of the house, the platform uses images adhering to the Open Container Initiative (OCI) image specification. For the orchestration side, we have put a lot of work into the upstream Kubernetes project. Beyond these two upstream projects, we have created a set of additional Kubernetes objects such as routes and deployment configs that we will learn how to use during this course.

Both Developers and Operators communicate with the OpenShift Platform via one of the following methods:

Command Line Interface

The command line tool that we will be using as part of this tutorial is called the oc tool. This tool is written in the Go programming language and is a single executable that is provided for Windows, MacOS, and the Linux Operating Systems.

Web Console

OpenShift also provides a feature rich Web Console that provides a friendly graphical interface for interacting with the platform. The Web Console has both an Administrator Perspective and a Developer Perspective.

REST API

Both the command line tool and the web console communicate to OpenShift via the same method, the REST API. Having a robust API allows users to create their own scripts and automation depending on their specific requirements. For detailed information about the REST API, check out the official documentation at: https://docs.openshift.org/latest/rest_api/index.html

During this tutorial, you will be using both the command line tool and the web console. However, it should be noted that there are plugins for several integrated development environments as well. Learn more about the Red Hat IDE Extensions for OpenShift here.

The Environment

During this tutorial you will be using a hosted OpenShift environment that is created just for you. This environment is not shared with other users of the system. Because each user taking this tutorial has their own environment, we had to make some concessions to ensure the overall platform is stable and used only for this tutorial. For that reason, your environment will only be active for a one hour period. Keep this in mind before embarking on getting through the content. Each time you start this tutorial, a new environment will be created on the fly.

The OpenShift environment that has been created for you is running version 4.2 of Red Hat OpenShift Container Platform. This deployment is a self-contained environment that provides everything you need to be successful in learning the platform. This includes such things as the command line, web console, and public URLs.

Let's get started!

Continue Learning

You can continue learning more about OpenShift and how to develop applications on the platform by completing other tutorials at https://learn.openshift.com.

There are several categories of tutorials:

Run OpenShift Locally with CodeReady Containers

CodeReady Containers allows you to run a minimal, pre-configured OpenShift 4 cluster on your local machine. The project supports Windows 10, macOS, and Linux. To find out more or download CodeReady Containers, visit https://developers.redhat.com/products/codeready-containers/overview

Compare Hosted, Managed, or On Premises OpenShift

Learn more about the different OpenShift platform variants here: https://www.openshift.com/products

Browse the Documentation

If you want to learn about particular OpenShift concepts in more depth, visit the documentation: https://docs.openshift.com/container-platform/latest

Getting Started with OpenShift for Developers

Step 1 of 6

Step 1 - Exploring The Command Line

Command Line Interface (CLI)

The OpenShift CLI is accessed using the command oc. From here, you can administrate the entire OpenShift cluster and deploy new applications.

The CLI exposes the underlying Kubernetes orchestration system with the enhancements made by OpenShift. Users familiar with Kubernetes will be able to adapt to OpenShift quickly. oc provides all of the functionality of kubectl, along with additional functionality to make it easier to work with OpenShift. The CLI is ideal in situations where you are:

1) Working directly with project source code

2) Scripting OpenShift operations

3) Restricted by bandwidth resources and cannot use the web console

In this tutorial, we're not focusing on the OpenShift CLI, but we want you to be aware of it in case you prefer using the command line. You can check out our other courses that go into the use of the CLI in more depth. Now, we're just going to practice logging in so you can get some experience with how the CLI works.

Exercise: Logging in with the CLI

Let's get started by logging in. Your task is to enter the following into the console:

oc login

When prompted, enter the following username and password:

Username: developer

Password: developer

Next, you can check if it was successful:

oc whoami

oc whoami should return a response of:

developer

That's it!

In the next step, we'll get started with creating your first project using the web console.