top of page
Search

CKA EXAM QS-8 2025

Question - 8:

Reconfigure the existing Deployment front-end in namespace spline-reticulator to

expose port 80/tcp of the existing container nginx.

Create a new service named front-end-svc exposing the container port80/tcp

Configure the new service to also expose the indivisual Pods via a NodePort

=======================================================

Answer: We will have to modify deployment only

# kubectl edit deployment front-end -n spline-reticulator

navigate to :

spec.template.spec.containers:

spec:

containers:

- name: nginx

image: nginx

ports:

- containerPort: 80 # Add this

protocol: TCP # and this the save and exit from file

After you need to expose it over NodePort by executing below command.

#kubectl expose deploy front-end -n spline-reticulator --name=front-end-svc --type=NodePort

================================================================

Home lab practice pre-requisite:


#kubectl create ns spline-reticulator

#kubectl create deployment front-end --image=nginx -n spline-reticulator

 
 
 

1 Comment

Rated 0 out of 5 stars.
No ratings yet

Add a rating
Rr
Oct 21
Rated 5 out of 5 stars.

Very useful

Like
bottom of page