MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

Openshift: Lab 7 – Scale applications using the oc CLI tool

Lab 7 summary

This lab teaches how to use the oc CLI to scale an OpenShift application up and down by changing the number of pod replicas in a Kubernetes/OpenShift Deployment. The sample app used is Parksmap, deployed from the container image:

quay.io/openshiftroadshow/parksmap

The lab first logs into Developer Sandbox using an oc login --token=... --server=... command copied from the OpenShift web console, then deploys the app, exposes it, checks the deployment, scales it to 3 replicas, and scales it back to 1 replica.

Main commands from the lab

# Login using token copied from OpenShift web console
oc login --token=<token> --server=<api-server>

# Deploy Parksmap from container image
oc new-app quay.io/openshiftroadshow/parksmap

# Expose the service
oc expose service/parksmap

# Check deployment
oc get deployment

# Scale up to 3 pods
oc scale deployment parksmap --replicas=3

# Verify scale-up
oc get deployment -l app=parksmap

# Scale down to 1 pod
oc scale deployment parksmap --replicas=1

# Verify scale-down
oc get deployment -l app=parksmap
Code language: PHP (php)

Expected outputs shown in the lab

After oc new-app quay.io/openshiftroadshow/parksmap, the lab shows output like:

imagestream.image.openshift.io "parksmap" created
deployment.apps "parksmap" created
service "parksmap" created
Code language: CSS (css)

Then OpenShift suggests exposing the app:

oc expose service/parksmap

Expected output:

route.route.openshift.io/parksmap exposed

For scale-up:

oc scale deployment parksmap --replicas=3

Expected output:

deployment.apps/parksmap scaled

Then:

NAME       READY   UP-TO-DATE   AVAILABLE   AGE
parksmap   3/3     3            3           43m

For scale-down:

oc scale deployment parksmap --replicas=1

Expected output:

deployment.apps/parksmap scaled

Then:

NAME       READY   UP-TO-DATE   AVAILABLE   AGE
parksmap   1/1     1            1           43m

Clean corrected version of Lab 7

There are two copy-paste wording issues in the PDF:

  1. It says “Install an application from source code using oc new-app”, but the actual command uses a container image, not source code.
  2. It says the following sections describe using the web console, but this lab is actually about using the oc CLI.

The corrected lab flow should be:

# 1. Log in with token copied from OpenShift web console
oc login --token=<your-token> --server=<your-api-server>

# 2. Confirm user
oc whoami

# 3. Check current project
oc project

# 4. Deploy Parksmap from container image
oc new-app quay.io/openshiftroadshow/parksmap

# 5. Check created resources
oc get all

# 6. Expose the service as a route
oc expose service/parksmap

# 7. Get the route
oc get route parksmap

# 8. Check current deployment replica count
oc get deployment parksmap

# 9. Scale up to 3 pods
oc scale deployment parksmap --replicas=3

# 10. Verify scale-up
oc get deployment -l app=parksmap
oc get pods -l app=parksmap

# 11. Scale down to 1 pod
oc scale deployment parksmap --replicas=1

# 12. Verify scale-down
oc get deployment -l app=parksmap
oc get pods -l app=parksmap

# 13. Optional cleanup
oc delete all -l app=parksmap
oc delete route parksmap
Code language: PHP (php)

Difference from Lab 6

LabToolMain Skill
Lab 6OpenShift web consoleScale app using Topology UI
Lab 7oc CLIScale app using oc scale deployment

So yes: Lab 7 is the CLI version of Lab 6, using the same Parksmap-style scaling concept.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

Kubernetes Assignment and Project

This page is a five-day Kubernetes assignment. It starts with architecture and Pods, then moves through ReplicaSets, DaemonSets, Deployments, Services, CoreDNS service discovery and StatefulSets, and ends…

Read More

Interview Questions & Answers Complete Guide for Kubernetes

Kubernetes What is Kubernetes? Why organizations are using it? What is a Kubernetes Cluster? Kubernetes Nodes What is a Node? What the master node is responsible for?…

Read More

Kubernetes API Reference: Complete Guide

Namespaces Working with Kubernetes Cluster using Kubectl Part – 6 – Namespaces Pod Kubernetes Pod Example Programs Working with Kubernetes Pods & Deployment Kubernetes POD observability and…

Read More

An Overview of Kubernetes

Kubernetes is a powerful container management tool that automates the deployment and management of containers. Kubernetes is container-runtime agnostic. Kubernetes will keep those containers running and handle…

Read More

Kubernetes configmaps: How to update configmap automatically into pods?

We often come acorss following questions while working with ConfigMap and secret are as follows; How to Updating Kubernetes Deployments on a ConfigMap Change? How Mounted ConfigMap…

Read More

Kubernetes Interview Questions and Answer Part – 6

Which of the following is correct about Kubernetes Pods? Pods can only contain a single VM Pods can only contain a single container Pods can contain one…

Read More
Subscribe
Notify of
guest
2 Comments
Newest
Oldest Most Voted
Puja kushwaha
Puja kushwaha
1 month ago

Scaling applications with the oc CLI is a useful way to see how replica counts affect workload availability. Before scaling, teams should check resource limits and confirm that the application can handle multiple instances. Commands such as oc get pods help verify that new replicas become ready. It is also worth testing traffic during scale-up and scale-down to spot service disruptions. Monitoring response times and resource use helps teams choose replica counts based on actual demand.

Skylar Bennett
Skylar Bennett
5 months ago

The lab demonstrates application scaling with the oc CLI effectively, but it could also discuss how scaling decisions are influenced by workload behavior in production. Simply increasing replica counts does not always improve performance, especially for stateful services or applications with external dependencies. Including topics such as autoscaling policies, resource requests and limits, and monitoring key metrics would give readers a better understanding of how to scale applications efficiently while controlling infrastructure costs and maintaining reliability.

2
0
Would love your thoughts, please comment.x
()
x