In this self paced tutorial you will learn how to use the OpenShift Container Platform to build and deploy applications using both containers and orchestration.
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 based upon the docker image format. 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 training is called the oc tool. This tool is written in the Go programming language and is a single executable that is provided for Windows, OS X, and the Linux Operating Systems.
OpenShift also provides a feature rich Web Console that provides a friendly graphical interface for interacting with the platform.
Both the command line tool and the web console actually 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 training, 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. For example, to use OpenShift from the Eclipse IDE, you would want to use the official JBoss Tools plugin.
During this training course 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 training has their own environment, we had to make some concessions to ensure the overall platform is stable and used only for this training. 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 training, a new environment will be created on the fly.
The OpenShift environment that has been created for you is running the latest version of our open source project called OKD. 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.
With that being said, grab your favorite choice of beverage and let's do this!
Congratulations! You just finished learning the basics of how to get started with the OpenShift Container Platform. Feels good doesn't it?
At this point you are probably itching to keep working with OpenShift as you have had a glimpse of the power this can bring to your own applications. We are currently working on more advanced tutorials that will be hosted here but in the meantime, you can certainly run your own version of OpenShift or use a hosted model. You are welcome to use one of the following options:
Minishift is a complete OpenShift environment that you can run on your local machine. The project supports Windows, OS X, and the Linux operating system. To find more about minishift, visit https://www.okd.io/minishift/
The OpenShift team provides a hosted environment which includes a free starter plan which you can use to develop and test applications for OpenShift. You can find details for OpenShift Online and sign up at https://www.openshift.com/products/pricing/
You can also let Red Hat host an OpenShift instance for you on a public cloud. This is an ideal scenario for larger teams that doesn't want to deal with the operational aspects or running a full environment. To find out more, visit https://www.openshift.com/products/dedicated/
Getting Started with OpenShift for Developers
Step 1 - Exploring The Command Line
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. 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
For this section, our task is going to be creating our first project.
What is a project? Why does it matter?
The goal of this section is to get a project created and running, which you'll be doing with the web console in the next section.
OpenShift is often referred to as a container application platform in that it is a platform designed for the development and deployment of containers.
To contain your application, we use projects. The reason for having a project to contain your application is to allow for controlled access and quotas for developers or teams.
More technically, it's a visualization of the Kubernetes namespace based on the developer access controls.
Command Line Interface (CLI)
In this course, we're not focusing on the OpenShift CLI, but we want you to be aware of it in case using the command line is your thing. 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.
Let's get started by logging in. Your task is to enter the following into the console:
When prompted, enter the following username and password:
Next, you can check if it was successful:
oc whoami should return a response of:
In the next step, we'll get started with creating your first project using the web console.