Cloud Native 3 min read

Viewing and Scaling Pods in Kubernetes with kubectl

This guide demonstrates how to list current pod instances, increase the replica count of a deployment, and verify the updated pod status in a Kubernetes cluster using kubectl commands.

Practical DevOps Architecture
Practical DevOps Architecture
Practical DevOps Architecture
Viewing and Scaling Pods in Kubernetes with kubectl

Step 1 – View the current number of pod containers:

[root@master ~]# kubectl get pod
NAME                     READY   STATUS    RESTARTS   AGE
java-web-5ff9df4965-7txnb   1/1     Running   1          55d
java-web-5ff9df4965-8ctn5   1/1     Running   1          55d
java-web-5ff9df4965-zl8mb   1/1     Running   1          55d
nginx-6799fc88d8-9h95f     1/1     Running   1          56d
nginx-offi                 1/1     Running   1          59d
nginx-test-fb5b8568f-67cvv 1/1     Running   1          55d
nginx.1-6469f98fc5-75hl8    1/1     Running   1          56d
nginx.2-868f589584-jxgtd   1/1     Running   1          56d

Step 2 – Increase the number of pod replicas for the nginx deployment:

[root@master ~]# kubectl scale deployment nginx --replicas=5
deployment.apps/nginx scaled

Step 3 – Verify the updated pod count and status:

[root@master ~]# kubectl get pod
NAME                     READY   STATUS            RESTARTS   AGE
java-web-5ff9df4965-7txnb   1/1     Running           1          55d
java-web-5ff9df4965-8ctn5   1/1     Running           1          55d
java-web-5ff9df4965-zl8mb   1/1     Running           1          55d
nginx-6799fc88d8-8djlb     0/1     ContainerCreating 0          14s
nginx-6799fc88d8-9h95f     1/1     Running           1          56d
nginx-6799fc88d8-nx542     0/1     ContainerCreating 0          14s
nginx-6799fc88d8-qrchk     0/1     ContainerCreating 0          14s
nginx-6799fc88d8-z8hxj     0/1     ContainerCreating 0          14s
nginx-offi                 1/1     Running           1          59d
nginx-test-fb5b8568f-67cvv 1/1     Running           1          55d
nginx.1-6469f98fc5-75hl8    1/1     Running           1          56d
nginx.2-868f589584-jxgtd   1/1     Running           1          56d
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

OperationskubectlPod Scaling
Practical DevOps Architecture
Written by

Practical DevOps Architecture

Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.