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.
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 56dStep 2 – Increase the number of pod replicas for the nginx deployment:
[root@master ~]# kubectl scale deployment nginx --replicas=5 deployment.apps/nginx scaledStep 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 56dSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
