Bookmark this page

Chapter 2.  Deploying Simple Applications

Abstract

Goal

Deploy simple applications by using the Red Hat OpenShift web console and command-line tools.

Objectives
  • Navigate and explore the features of the Red Hat OpenShift web console.

  • Deploy simple applications by using the various methods that the Red Hat OpenShift web console provides.

  • Create and deploy applications by using the odo and oc CLI tools.

Sections
  • Navigating the Red Hat OpenShift Web Console (and Guided Exercise)

  • Deploying Applications by Using the Red Hat OpenShift Web Console (and Guided Exercise)

  • Deploying Applications by Using the oc and odo CLIs (and Guided Exercise)

Lab
  • Deploying Simple Applications

Navigating the Red Hat OpenShift Web Console

Objectives

  • Navigate and explore the features of the Red Hat OpenShift web console.

Overview of the Red Hat OpenShift Web Console

The Red Hat OpenShift Web Console provides a graphical user interface to perform development and administrative tasks within a cluster. The web console provides two separate perspectives to better facilitate the different needs of developers and administrators. The menus, tasks, and features within the web console are also available by using the command-line interface (CLI). Note that the OpenShift web console is not related to the Kubernetes dashboard, but is a separate tool.

Accessing the OpenShift Web Console

The web console is accessible via any modern web browser. The URL is configurable and is found by using the oc CLI.

[user@host ~]$ oc whoami --show-console
https://console-openshift-console.apps.ocp4.example.com

Use a web browser to navigate to the URL, which displays the authentication page. Using the credentials for your cluster access brings you to the home page for the web console.

Figure 2.1: The OpenShift home page

Note

An initial login to the web console presents the option for a short informational tour. Click Skip Tour to dismiss the tour.

Web Console Perspectives

Within the web console, the primary means of navigation is the sidebar on the left. The sidebar organizes cluster functions and tasks into several major categories. The first selection menu in the sidebar menu switches between the Administrator and the Developer perspectives.

Figure 2.2: OpenShift web console perspective selection

The sidebar menu layout and the features that it displays differ between these two perspectives. The Developer perspective primarily focuses on building and deploying applications. The Administrator perspective focuses on cluster configuration, deployments, and operations of the cluster itself. Many features are available in both perspectives, but differ in interface specifics to better match each of the personas.

Developer Perspective

The Developer perspective includes many sections that facilitate CI/CD methodology, which centers around automatically building application source code. The details of such automation is relevant to later chapters in this course.

The Developer perspective includes the following sections:

Section NameUses
Topology Interactively explore high-level overview project resources
Observe View high-level information about project resource utilization, such as CPU, memory, network, and storage limits
Search Construct queries to find resources based on resource type and labels
Builds View and manage BuildConfig resources in the selected project
Helm List installed Helm Charts and add charts from the developer catalog
Project View a mixture of information relevant to the selected project, such as cluster resource usage and events
Config Maps View and manage ConfigMap resources in the selected project
Secrets View and manage Secret resources in the selected project

Topology View

The topology explorer is only in the Developer perspective. This view shows the main development resources within a project and provides a visual and interactive way to explore other resources.

For example, the following image shows the topology view for a project called top-view.

Figure 2.3: OpenShift web console topology view

This project contains two deployment configurations: one for a PostgreSQL database and another for a Node.js application. Because the Node.js deployment configuration has an associated build configuration, there is an indicator for the status of that build.

Figure 2.4: The build status indicator shows that the most recent build succeeded.

In the opposite corner, a link to the application is available. This link appears because the deployment configuration has an associated route resource.

Within the graph, you can click a resource to see quick details about it. The details side panel also includes a Resources tab with information about related resources. This tab also provides quick ways to get to common information, such as build and pod logs.

For example, the following image shows the related pods, builds, and services for the Node.js deployment configuration.

Figure 2.5: Topology view details panel

Administrator Perspective

The Administrator perspective includes more sections, each of which provide sub-sections with more granularity. The upper-level administrator sections include the following:

Section NameUses
Home View a mixture of information relevant to the selected project, such as cluster resource usage and events
Operators Install and manage cluster operators, which extend the features and functions of your cluster
Workloads Manage resources within the Workload API, which includes Pods, Deployments, Jobs, and others
Networking Manage network resources, such as Services and Routes, which are used in conjunction to expose applications internally and externally
Storage Manage storage resources, such as StorageClasses and PersistentVolumeClaims, which pods use to request persistent storage
Builds View and manage BuildConfig resources in the selected project
User Management Manage users and assign roles within the cluster
Administration Manage ResourceQuotas and LimitRanges

Warning

Administrator users that have the cluster-admin role have unrestricted access to the cluster. For security reasons, if the task does not require a high level of permission, log in with a user that has lower privileges.

With many of the sections in both perspectives, you can navigate deeper into the pages to explore various resource types.

For example, the BuildConfigs section in the Administrator perspective is similar to the Builds section in the Developer perspective. Within the Builds tab for that build configuration, you can select an individual Build to view its details. This details page shows information about the individual build, such as completion status, relevant dates, and the type of build. You can use the tabs on the page to explore even more details, such as the YAML definition and the build logs.

Figure 2.6: Build logs for an example Node.js application

Note

You can access the Administrator perspective as a user with no special privileges. This allows the user to use the Administrator perspective with only the user's projects. It does not give the user cluster administrator privileges.

References

For more information about the OpenShift web console, refer to Red Hat OpenShift Container Platform Web Console documentation at https://access.redhat.com/documentation/en-us/openshift_container_platform/4.12/html-single/web_console/index

What is CI/CD?

Revision: do288-4.12-0d49506