Kahibaro
Discord Login Register

6 Accessing and Using OpenShift

How Users Interact with an OpenShift Cluster

From a user’s perspective, “using OpenShift” means connecting to a cluster, authenticating, and working with applications and resources through tools that OpenShift provides. At a high level there are two main entry points:

On top of this, OpenShift organizes work into logical containers called projects/namespaces and enforces limits through resource quotas and limits. This chapter focuses on how you, as a user, actually access and operate within an OpenShift cluster at a practical level, without yet going into the deep details that are covered in later chapters.

In this chapter you will:

Ways to Access an OpenShift Cluster

OpenShift is typically exposed as one or more HTTPS endpoints:

In practice, your platform or cluster administrator will provide:

You usually:

  1. Open the web console in your browser for a visual workflow.
  2. Use oc on your workstation, in a terminal or integrated into scripts/CI.

Typical Authentication Flow

Although details of authentication and authorization are covered in their own chapter, the basic experience for an end user looks like:

Your identity and group membership then determine what projects and resources you can see and modify.

Web Console: Graphical Access

The OpenShift web console provides a browser-based way to interact with the cluster. It is designed for both developers and administrators, with different views and levels of detail.

Main Areas of the Web Console

While the exact layout can change slightly between versions and themes, common sections include:

Common Developer Workflows in the Console

Some typical actions that developers perform through the web console:

The console is particularly useful for learning, for exploratory debugging, and for users who prefer a visual interface over raw YAML or CLI commands.

Administrator-Oriented Views

Even if you’re not a cluster admin, it helps to know that the console’s admin perspective exposes:

Your role determines whether you can see or change these settings. From an “access and use” standpoint, be aware that some menu items may be visible but disabled, or completely hidden, depending on your authorization.

CLI Access with `oc`

The oc tool is the primary command-line interface for OpenShift. It extends the standard Kubernetes kubectl with OpenShift-specific functionality (for example, working with projects, routes, and certain OpenShift APIs).

Installing and Configuring `oc`

In a typical setup:

  1. Download oc:
    • The web console often has a “Command Line Tools” link with platform-specific binaries.
  2. Place oc on your system PATH.
  3. Verify installation with:
    • oc version
  4. Authenticate:
    • oc login https://api.example.com:6443
    • Provide credentials or token as instructed.

The oc configuration (including cluster URL, user, and active project) is stored locally, allowing you to manage multiple clusters and contexts.

Basic Usage Patterns

Even before diving into specific resource commands, there are a few patterns that you will use everywhere:

As an adaptation for OpenShift-specific conventions, you’ll also see commands such as:

Later chapters will cover specific resource types and deployment models in more depth. Here, the key is to understand that oc is your scripted and automation-friendly way to do anything you can do in the console, and often more.

Working with Multiple Contexts

oc can manage multiple clusters and users through “contexts” in your configuration file. Common operations include:

This is especially important if you work in different environments (e.g., development, staging, production) or with multiple OpenShift clusters.

Projects and Namespaces in Daily Use

OpenShift organizes workloads and resources into objects called projects, which map to Kubernetes namespaces but add some OpenShift-specific metadata and workflows. From a user’s perspective, the “project” is the main scope you operate in day to day.

What a Project Represents for a User

A project is typically used to group:

In most real environments, projects are created to reflect both organizational structure and environment lifecycle (development, test, production, etc.).

Project Lifecycle from a User Perspective

Depending on your permissions and organizational policies:

Once a project exists, you typically:

In both interfaces, your view of resources (pods, services, deployments, etc.) is scoped to the selected project by default.

Access Control Around Projects

Authorization is covered separately, but from a usage perspective:

Practically, this means:

If something you expect is not visible, checking your active project (and your access rights) is often the first step.

Resource Quotas and Limits: How They Affect Your Work

OpenShift uses resource quotas and limits to ensure fair use of shared cluster capacity and to prevent misbehaving workloads from consuming excessive resources. As a user, you don’t typically define cluster-wide policies, but you must operate within them.

Resource Quotas at Project Level

A resource quota is a set of hard caps applied to a project. Examples include limits on:

For instance, a project could have:

From your perspective:

You can view quota definitions in your project via both console and CLI (e.g., oc get quota).

Limits and LimitRanges

Limit ranges define defaults and per-container or per-pod boundaries for compute resources such as CPU and memory. They interact with Kubernetes resource requests and limits (covered in more detail elsewhere), but at a high level:

A limit range can define, for example:

As a user, you will notice:

Understanding your project’s limit ranges helps you choose sensible resource values for your applications the first time, avoiding deployment errors.

Day-to-Day Workflow Examples

Putting these pieces together, a typical developer or user workflow on OpenShift might look like:

  1. Log in
    • Open the web console and authenticate via SSO.
    • Or open a terminal and run oc login.
  2. Select a project
    • In the console, choose the appropriate project from the dropdown.
    • In the CLI, run oc project my-team-dev.
  3. Inspect existing resources
    • Check what’s already running:
      • Console: use the topology or workloads view.
      • CLI: oc get pods, oc get deployments, etc.
  4. Deploy or update an application
    • Use a console wizard (e.g., “Deploy image from registry”).
    • Or apply configuration via CLI:
      • oc apply -f deployment.yaml
  5. Monitor and debug
    • View logs in the console or with oc logs.
    • Watch status with oc get pods -w.
    • Check events for errors about quota or limits.
  6. Adjust resources within quotas
    • If a deployment fails due to quotas:
      • Reduce replica count or CPU/memory requests.
      • Remove unused resources.
      • Coordinate with admins if more capacity is needed.
  7. Repeat for different environments
    • Switch projects (e.g., from my-app-dev to my-app-stage) and repeat the same pattern.

Over time, you may automate many of these steps via CI/CD pipelines and GitOps tools, but the underlying access methods and constraints remain the same.

Practical Tips for New Users

These foundations—web console, oc CLI, projects, quotas, and limits—form the basic toolkit you will use in all later chapters as you build, deploy, secure, and operate applications on OpenShift.

Views: 65

Comments

Please login to add a comment.

Don't have an account? Register now!