By frank.bailey.jr ·August 6, 2026· 1 min read
Task ๐ญ๐ฎ of KodeKloud's ๐๐๐ฏ๐ฒ๐ฟ๐ป๐ฒ๐๐ฒ๐ - ๐๐ฒ๐๐ฒ๐น ๐ญ curriculum. Today's task was to Update Deployment and Service in Kubernetes.
Task ๐ญ๐ฎ of KodeKloud's ๐๐๐ฏ๐ฒ๐ฟ๐ป๐ฒ๐๐ฒ๐ - ๐๐ฒ๐๐ฒ๐น ๐ญ curriculum. Today's task was to Update Deployment and Service in Kubernetes.
After a deployment and services has been executed, sometime you have make an update. In cases like this, having the chops to fix the issue is a must!
Here's today's task requirements:
The deployment is named ๐ป๐ด๐ถ๐ป๐ -๐ฑ๐ฒ๐ฝ๐น๐ผ๐๐บ๐ฒ๐ป๐. The service is called ๐ป๐ด๐ถ๐ป๐ -๐๐ฒ๐ฟ๐๐ถ๐ฐ๐ฒ
Modify the service nodeport from 30008 to 32165
Change the replicas count from 1 to 5
Update the image from ๐ฏ๐จ๐ช๐ฏ๐น:1.19 to ๐ฏ๐จ๐ช๐ฏ๐น:๐ญ๐ข๐ต๐ฆ๐ด๐ต
Here's how I completed this task:
Update the service using the ๐๐๐๐๐๐๐ ๐๐๐๐ command to update the configuration:
๐๐๐๐@๐๐๐๐-๐๐๐๐ ~$ ๐๐๐๐๐๐๐ ๐๐๐๐ ๐๐๐๐๐๐๐๐ ๐๐๐๐๐ก-๐๐๐๐๐๐๐
Change this line from 30008 to 32165:
Before:
๐๐๐๐:
- ๐๐๐๐๐ฟ๐๐๐: ๐น๐ถ๐ถ๐ถ๐พ
After:
๐๐๐๐:
- ๐๐๐๐๐ฟ๐๐๐: ๐น๐ธ๐ท๐ผ๐ป
Then save it:
๐๐๐๐๐๐๐/๐๐๐๐๐ก-๐๐๐๐๐๐๐ ๐๐๐๐๐๐
Verify by viewing the services:
๐๐๐๐@๐๐๐๐-๐๐๐๐ ~$ ๐๐๐๐๐๐๐ ๐๐๐ ๐๐๐๐๐๐๐๐ ๐๐๐๐๐ก-๐๐๐๐๐๐๐
๐ฝ๐ฐ๐ผ๐ด ๐๐๐ฟ๐ด ๐ฒ๐ป๐๐๐๐ด๐-๐ธ๐ฟ ๐ด๐๐๐ด๐๐ฝ๐ฐ๐ป-๐ธ๐ฟ ๐ฟ๐พ๐๐(๐) ๐ฐ๐ถ๐ด
๐๐๐๐๐ก-๐๐๐๐๐๐๐ ๐ฝ๐๐๐๐ฟ๐๐๐ ๐ท๐ถ.๐บ๐น.๐ท๐ท๐ถ.๐ท๐ฟ๐ท <๐๐๐๐> ๐พ๐ถ:๐น๐ธ๐ท๐ผ๐ป/๐๐ฒ๐ฟ ๐ท๐ถ๐
Next, edit the deployment for the replicaSet count and the image:
๐๐๐๐@๐๐๐๐-๐๐๐๐ ~$ ๐๐๐๐๐๐๐ ๐๐๐๐ ๐๐๐๐๐๐ข๐๐๐๐ ๐๐๐๐๐ก-๐๐๐๐๐๐ข๐๐๐๐
Relevant lines before change:
๐๐๐๐:
๐๐๐๐๐๐๐๐: ๐ท
๐๐๐๐:
๐๐๐๐๐๐๐๐๐๐: - ๐๐๐๐๐: ๐๐๐๐๐ก:๐ท.๐ท๐ฟRelevant lines after update:
๐๐๐๐:
๐๐๐๐๐๐๐๐: ๐ป
๐๐๐๐:
๐๐๐๐๐๐๐๐๐๐: - ๐๐๐๐๐: ๐๐๐๐๐ก:๐๐๐๐๐๐Save the changes:
๐๐๐๐๐๐ข๐๐๐๐.๐๐๐๐/๐๐๐๐๐ก-๐๐๐๐๐๐ข๐๐๐๐ ๐๐๐๐๐๐
Verify the ReplicaSet now shows 5 pods, instead of 1:
๐๐๐๐@๐๐๐๐-๐๐๐๐ ~$ ๐๐๐๐๐๐๐ ๐๐๐ ๐๐
๐ฝ๐ฐ๐ผ๐ด ๐ณ๐ด๐๐ธ๐๐ด๐ณ ๐ฒ๐๐๐๐ด๐ฝ๐ ๐๐ด๐ฐ๐ณ๐ ๐ฐ๐ถ๐ด
๐๐๐๐๐ก-๐๐๐๐๐๐ข๐๐๐๐-๐ผ๐ผ๐ป๐ป๐๐๐พ๐๐๐ ๐ถ ๐ถ ๐ถ ๐ท๐ฟ๐
๐๐๐๐๐ก-๐๐๐๐๐๐ข๐๐๐๐-๐ผ๐พ๐บ๐ฟ๐พ๐พ๐บ๐๐ป๐ ๐ป ๐ป ๐ป ๐ท๐ถ๐ฝ๐
Verify the container image updated:
๐๐๐๐@๐๐๐๐-๐๐๐๐ ~$ ๐๐๐๐๐๐๐ ๐๐๐๐๐๐๐๐ ๐๐๐๐๐๐ข๐๐๐๐๐ ๐๐๐๐๐ก-๐๐๐๐๐๐ข๐๐๐๐ | ๐๐๐๐ ๐๐๐๐๐๐๐๐๐ -๐ฐ ๐บ
๐๐๐๐๐ก-๐๐๐๐๐๐๐๐๐:
๐ธ๐๐๐๐: ๐๐๐๐๐ก:๐๐๐๐๐๐
I hope you found this informative! More to come!
#kubernetes #devops #kodekloud