Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.

Unlimited Access

Get Unlimited Contributor Access to the all ExamTopics Exams!
Take advantage of PDF Files for 1000+ Exams along with community discussions and pass IT Certification Exams Easily.

Exam CKA topic 1 question 6 discussion

Actual exam question from CNCF's CKA
Question #: 6
Topic #: 1
[All CKA Questions]


Task -
Reconfigure the existing deployment front-end and add a port specification named http exposing port 80/tcp of the existing container nginx.
Create a new service named front-end-svc exposing the container port http.
Configure the new service to also expose the individual Pods via a NodePort on the nodes on which they are scheduled.

Show Suggested Answer Hide Answer
Suggested Answer:


Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
Highly Voted 1 year, 8 months ago
if you add port, name, and protocol in the deployment spec, then you only need to run: kubectl expose deployment front-ed--type=NodePort --name=front-end-svc
upvoted 15 times
Highly Voted 5 months ago
for reconfiguring part ; #kubectl edit deployment front-end then add the following in the container part; containers: - name: nginx-dep-cont image: nginx:1.14.2 ports: - name: http containerPort: 80 protocol: TCP and to Finally expose it; ## kubectl expose deployment front-end --name front-end-svc --target-port http --type=NodePort extra steps; # kubectl describe svc front-end-svc ## curl PICK-ANY-IP-FROM-ENDPOINTS:80 in my case # curl Tested!
upvoted 7 times
Most Recent 1 month, 3 weeks ago
after editing the existing ,kubectl expose deployment front-end --name=front-end-svc --port=80 --target-port=80 --type=NodePort
upvoted 1 times
5 months, 1 week ago
kubectl config use-context k8s kubectl expose deployment front-end --port=80 --target-port=80 --protocol=TCP --type=NodePort --name=front-end-svc with this solution it is much more easier
upvoted 3 times
7 months, 1 week ago
1 kubectl edit deploy front-end ports: - containerPort: 80 name: http 2 apiVersion: v1 kind: Service metadata: name: svc1 spec: selector: app: nginx ports: - name: name-of-service-port protocol: TCP port: 80 targetPort: http 3 apiVersion: v1 kind: Service metadata: name: svc2 type: NodePort selector: app: nginx ports: - port: 80 targetPort: http nodePort: 30007
upvoted 1 times
7 months, 3 weeks ago
which this one makes you think more than you need to answer. When asked to export (http) you can put a flag - name: http : example: ports: - container port: 80 name: http However, when you create the service and export port 80 from it.
upvoted 1 times
11 months, 1 week ago
The question as I understood: kubectl create deployment front-end --image=nginx --replicas=1 --dry-run=client -oyaml > dep1.yaml kubectl apply -f dep1.yaml vi dep1.yaml # manually add the name: http and containerPort: 80 kubectl expose deployment front-end --target-port=http --name=front-end-svc --type=ClusterIP/NodePort --dry-run=client -oyaml>svc1.yaml kubectl apply -f svc1.yaml kubectl describe svc front-end-svc
upvoted 2 times
1 year ago
I dont realy understand if we need to do two or three actions- 1.reconfigure the yaml file - add ports. 2 create sa and 3. edit service adding type Nodeport or is it ok just reconfigure yaml and run k expose deployment front-end --name front-end-svc --type NodePort --port 80 --target-port HTTP ?
upvoted 2 times
1 year ago
This is what I asked too. Search here for my user "iiiaz". But I think for your comment at action 2 is not sa (service account) but svc (service). I guess there are 3 actions but can LinuxFoundation tell if you first done action 2 (create service) and then action 3 (change this service type to NodePort)? As you can directly create a service type NodePort.
upvoted 1 times
1 year ago
Who can explain the difference between these tasks: "T1. Create a new service named front-end-svc exposing the container port http. T2. Configure the new service to also expose the individual Pods via a NodePort on the nodes on which they are scheduled." Is it T1: first expose the deployment as default (service type ClusterIP is created) on port http? Then, T2, edit the service from type ClusterIP to type NodePort? I see the solutions mentioned here go directly to task 2. Quite confusing question.
upvoted 1 times
1 year, 2 months ago
This. is more align with the question k expose deployment front-end --name front-end-svc --type NodePort --port 80 --target-port HTTP
upvoted 7 times
Community vote distribution
A (35%)
C (25%)
B (20%)
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

Loading ...
ex Want to SAVE BIG on Certification Exam Prep?
ex Unlock All Exams with ExamTopics Pro 75% Off
  • arrow Choose From 1000+ Exams
  • arrow Access to 10 Exams per Month
  • arrow PDF Format Available
  • arrow Inline Discussions
  • arrow No Captcha/Robot Checks
Limited Time Offer
Ends in