McAfee Secure

CNCF CKA Bundle

Exam Code: CKA

Exam Name Certified Kubernetes Administrator

Certification Provider: CNCF

Corresponding Certification: CKA

CNCF CKA Bundle $44.99

100% CNCF CKA Guaranteed Success With Testking Training Materials

Get Real CKA Exam Questions & Expert Verified Answers as Experienced on the Real Exam!

  • Questions & Answers

    CKA Questions & Answers

    58 Questions & Answers

    The ultimate exam preparation tool, Questions & Answers mirrors the actual CKA exam while allowing you to hone and measure every aspect of your test-taking ability.

  • CKA Video Course

    CKA Training Course

    138 Video Lectures

    CKA Video Course is developed by CNCF Professionals to help you pass the CKA exam.

    Description

    This course will improve your knowledge and skills required to pass Certified Kubernetes Administrator exam.
  • Study Guide

    CKA Study Guide

    268 PDF Pages

    Developed by industry experts, this 268-page guide spells out in painstaking detail all of the information you need to ace CKA exam.

Certified Kubernetes Administrator (CKA) Practice Tests

Satisfaction Guaranteed

Money Back Guarantee

Testking provides hassle-free money back guarantee with our products. That is because we have 100% trust in the abilities of our professional and experience product team, and our record is a proof of that.

99.6% PASS RATE
Total Cost: $194.97
Bundle Price: $149.98

Purchase Individually

  • Questions & Answers

    Questions & Answers

    58 Questions

    $124.99
  • CKA Video Course

    Training Course

    138 Video Lectures

    $39.99
  • Study Guide

    Study Guide

    268 PDF Pages

    $29.99

CNCF CKA Practice Test 53

Question 520

At Northstar finance, in an isolated training cluster during a scheduled maintenance rehearsal: Service invoice-svc in ledger targets no Pods because its selector says app=legacy while Deployment invoice-api labels Pods app=invoice-api. Work only within the stated target and verify before declaring success. Which operational control most directly prevents this failure or configuration drift?

  1. Test Service selectors against actual Pod template labels during deployments and renames.
  2. Check gateway class/controller compatibility and delegate route attachment privileges deliberately.
  3. Audit controller capability and exposed service access policies before enabling public ingress.
  4. Monitor DNS replica readiness, restart trends and upstream resolution errors.

Explanation

Correct Answer

A:

Test Service selectors against actual Pod template labels during deployments and renames. This reduces recurrence of the specific operational failure. It reinforces the action: Run kubectl -n ledger patch service invoice-svc --type=merge -p '{"spec":{"selector":{"app":"invoice-api"}}}' after confirming the label is authoritative. The relevant mechanism is: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods.

Incorrect Answers

B:

This routine guards against another mechanism: Gateway API separates infrastructure listener ownership from application route attachments and depends on controller support. The recurring exposure in the current case is: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. The matching preventive check is “Test Service selectors against actual Pod template labels during deployments and renames”.

C:

The suggested review tracks a different technical risk: LoadBalancer Services request external routing from a supported infrastructure controller; a bare cluster does not guarantee an external address. Here the sustained control must address: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. Choose “Test Service selectors against actual Pod template labels during deployments and renames”.

D:

That safeguard is relevant to: DNS resolution may fail when CoreDNS replicas are unhealthy even when the requested Service and Pod endpoints exist. The current failure instead follows from: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. Its prevention measure is “Test Service selectors against actual Pod template labels during deployments and renames”.

Question 521

At Horizon observability, in a disposable simulated environment during a monitored release window: Service metrics-svc in observability targets no Pods because its selector says app=legacy while Deployment metrics-api labels Pods app=metrics-api. Work only within the stated target and verify before declaring success. Which command or initial safe diagnostic step best addresses the stated lab task?

  1. Run kubectl -n observability patch service metrics-svc --type=merge -p '{"spec":{"ports":[{"port":8080,"targetPort":3000}]}}' for the lab's single-port Service.
  2. Run kubectl -n observability expose deployment metrics-api --name=metrics-svc --type=NodePort --port=8080 --target-port=3000.
  3. Run kubectl -n observability patch service metrics-svc --type=merge -p '{"spec":{"selector":{"app":"metrics-api"}}}' after confirming the label is authoritative.
  4. Run kubectl -n observability apply -f ./gateway/metrics-api-route.yaml after confirming parentRefs, hostnames and backendRefs.

Explanation

Correct Answer

C:

Run kubectl -n observability patch service metrics-svc --type=merge -p '{"spec":{"selector":{"app":"metrics-api"}}}' after confirming the label is authoritative. This is the appropriate command-line action or first safe diagnostic. The technical reason is: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. Validate the result with: Run kubectl -n observability get endpointslices -l kubernetes.io/service-name=metrics-svc and verify addresses for the intended Pods. Execute changes only in an authorized disposable lab or after normal production change controls.

Incorrect Answers

A:

This alternative is a response to another technical cause: The Service port is what clients connect to, while targetPort must reach the actual backend listener. The reported case instead depends on: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. The action that directly addresses it is “Run kubectl -n observability patch service metrics-svc --type=merge -p '{"spec":{"selector":{"app":"metrics-api"}}}' after confirming the label is authoritative”.

B:

The proposed action belongs to the mechanism: A NodePort Service allocates a cluster-configured host port on each node while retaining its cluster IP routing. Here the stated fault follows a different mechanism: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. The corrective choice is “Run kubectl -n observability patch service metrics-svc --type=merge -p '{"spec":{"selector":{"app":"metrics-api"}}}' after confirming the label is authoritative”.

D:

This alternative is a response to another technical cause: Gateway API HTTPRoutes express matching and backend behavior while Gateway resources own compatible listeners. The reported case instead depends on: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. The action that directly addresses it is “Run kubectl -n observability patch service metrics-svc --type=merge -p '{"spec":{"selector":{"app":"metrics-api"}}}' after confirming the label is authoritative”.

Question 522

At Horizon observability, in a disposable simulated environment during a monitored release window: Service metrics-svc in observability targets no Pods because its selector says app=legacy while Deployment metrics-api labels Pods app=metrics-api. Work only within the stated target and verify before declaring success. Which Kubernetes behavior best explains the required change or diagnosis?

  1. Gateway API HTTPRoutes express matching and backend behavior while Gateway resources own compatible listeners.
  2. NetworkPolicy egress rules are additive and DNS lookup requires permitted traffic to the DNS server, not only a correct Service record.
  3. A ClusterIP Service provides stable in-cluster virtual addressing and directs traffic to selected ready Pod endpoints.
  4. Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods.

Explanation

Correct Answer

D:

Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. This explains the stated condition. The corresponding action is: Run kubectl -n observability patch service metrics-svc --type=merge -p '{"spec":{"selector":{"app":"metrics-api"}}}' after confirming the label is authoritative. The direct acceptance evidence is: Run kubectl -n observability get endpointslices -l kubernetes.io/service-name=metrics-svc and verify addresses for the intended Pods.

Incorrect Answers

A:

Gateway API HTTPRoutes express matching and backend behavior while Gateway resources own compatible listeners. That explanation applies to a different technical failure. Here the controlling principle is: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods.

B:

The offered statement is true for this other mechanism: NetworkPolicy egress rules are additive and DNS lookup requires permitted traffic to the DNS server, not only a correct Service record. It does not explain the facts described here, which follow from: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods.

C:

This principle describes a separate cause: A ClusterIP Service provides stable in-cluster virtual addressing and directs traffic to selected ready Pod endpoints. The reported condition is governed by: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. The two mechanisms should not be conflated.

Question 523

At Horizon observability, in a disposable simulated environment during a monitored release window: Service metrics-svc in observability targets no Pods because its selector says app=legacy while Deployment metrics-api labels Pods app=metrics-api. Work only within the stated target and verify before declaring success. Which observation best verifies the requested outcome rather than an unrelated state?

  1. Run kubectl -n observability get endpointslices -l kubernetes.io/service-name=metrics-svc and verify addresses for the intended Pods.
  2. Run kubectl -n kube-system logs deployment/coredns --tail=50 and compare to an in-Pod resolution test.
  3. Run kubectl -n observability get httproute metrics-route -o yaml and inspect parent acceptance and resolved-reference conditions.
  4. Run kubectl -n observability get service metrics-svc -o wide and inspect the allocated node port and endpoints.

Explanation

Correct Answer

A:

Run kubectl -n observability get endpointslices -l kubernetes.io/service-name=metrics-svc and verify addresses for the intended Pods. This validates the affected object or control path, rather than only showing a command completed. The underlying reason is: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. The intended action is: Run kubectl -n observability patch service metrics-svc --type=merge -p '{"spec":{"selector":{"app":"metrics-api"}}}' after confirming the label is authoritative.

Incorrect Answers

B:

This observation would test a different technical dependency: DNS resolution may fail when CoreDNS replicas are unhealthy even when the requested Service and Pod endpoints exist. The current issue is governed by: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. Its decisive check is “Run kubectl -n observability get endpointslices -l kubernetes.io/service-name=metrics-svc and verify addresses for the intended Pods”.

C:

The alternative verifies a different condition: Gateway API HTTPRoutes express matching and backend behavior while Gateway resources own compatible listeners. The current case instead depends on: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. Confirm that “Run kubectl -n observability get endpointslices -l kubernetes.io/service-name=metrics-svc and verify addresses for the intended Pods”.

D:

That test belongs to another control with this basis: A NodePort Service allocates a cluster-configured host port on each node while retaining its cluster IP routing. In the current case, the governing reason is: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. The direct verification is “Run kubectl -n observability get endpointslices -l kubernetes.io/service-name=metrics-svc and verify addresses for the intended Pods”.

Question 524

At Horizon observability, in a disposable simulated environment during a monitored release window: Service metrics-svc in observability targets no Pods because its selector says app=legacy while Deployment metrics-api labels Pods app=metrics-api. Work only within the stated target and verify before declaring success. Which operational control most directly prevents this failure or configuration drift?

  1. Prefer short-lived diagnostic tunnels and avoid treating port-forward as a production ingress path.
  2. Test Service selectors against actual Pod template labels during deployments and renames.
  3. Monitor DNS replica readiness, restart trends and upstream resolution errors.
  4. Maintain lightweight in-cluster DNS canaries and verify Service creation and DNS freshness.

Explanation

Correct Answer

B:

Test Service selectors against actual Pod template labels during deployments and renames. This reduces recurrence of the specific operational failure. It reinforces the action: Run kubectl -n observability patch service metrics-svc --type=merge -p '{"spec":{"selector":{"app":"metrics-api"}}}' after confirming the label is authoritative. The relevant mechanism is: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods.

Incorrect Answers

A:

This routine guards against another mechanism: Port-forwarding creates a client-side tunnel to a selected backend and does not change the Service type or network exposure. The recurring exposure in the current case is: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. The matching preventive check is “Test Service selectors against actual Pod template labels during deployments and renames”.

C:

That safeguard is relevant to: DNS resolution may fail when CoreDNS replicas are unhealthy even when the requested Service and Pod endpoints exist. The current failure instead follows from: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. Its prevention measure is “Test Service selectors against actual Pod template labels during deployments and renames”.

D:

This routine guards against another mechanism: Cluster DNS should resolve Service names inside its configured domain; host-side DNS results do not prove in-cluster resolution. The recurring exposure in the current case is: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. The matching preventive check is “Test Service selectors against actual Pod template labels during deployments and renames”.

Question 525

At Pinecrest logistics, in a sandbox Kubernetes cluster during a recovery tabletop exercise: Service dispatch-svc in fulfillment targets no Pods because its selector says app=legacy while Deployment dispatch-api labels Pods app=dispatch-api. Work only within the stated target and verify before declaring success. Which command or initial safe diagnostic step best addresses the stated lab task?

  1. Run kubectl -n fulfillment create ingress dispatch-ingress --class=nginx --rule='dispatch.example.test/=dispatch-svc:9090' after confirming the Service exists.
  2. Run kubectl -n fulfillment expose deployment dispatch-api --name=dispatch-svc --type=NodePort --port=9090 --target-port=9000.
  3. Run kubectl -n kube-system get deploy coredns; kubectl -n kube-system get pods -l k8s-app=kube-dns.
  4. Run kubectl -n fulfillment patch service dispatch-svc --type=merge -p '{"spec":{"selector":{"app":"dispatch-api"}}}' after confirming the label is authoritative.

Explanation

Correct Answer

D:

Run kubectl -n fulfillment patch service dispatch-svc --type=merge -p '{"spec":{"selector":{"app":"dispatch-api"}}}' after confirming the label is authoritative. This is the appropriate command-line action or first safe diagnostic. The technical reason is: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. Validate the result with: Run kubectl -n fulfillment get endpointslices -l kubernetes.io/service-name=dispatch-svc and verify addresses for the intended Pods. Execute changes only in an authorized disposable lab or after normal production change controls.

Incorrect Answers

A:

The proposed action belongs to the mechanism: An Ingress resource declares HTTP host/path routing but requires an actual installed Ingress controller. Here the stated fault follows a different mechanism: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. The corrective choice is “Run kubectl -n fulfillment patch service dispatch-svc --type=merge -p '{"spec":{"selector":{"app":"dispatch-api"}}}' after confirming the label is authoritative”.

B:

The offered action targets: A NodePort Service allocates a cluster-configured host port on each node while retaining its cluster IP routing. The case facts point instead to: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. Implement “Run kubectl -n fulfillment patch service dispatch-svc --type=merge -p '{"spec":{"selector":{"app":"dispatch-api"}}}' after confirming the label is authoritative” to address that specific condition.

C:

This alternative is a response to another technical cause: DNS resolution may fail when CoreDNS replicas are unhealthy even when the requested Service and Pod endpoints exist. The reported case instead depends on: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. The action that directly addresses it is “Run kubectl -n fulfillment patch service dispatch-svc --type=merge -p '{"spec":{"selector":{"app":"dispatch-api"}}}' after confirming the label is authoritative”.

Question 526

At Pinecrest logistics, in a sandbox Kubernetes cluster during a recovery tabletop exercise: Service dispatch-svc in fulfillment targets no Pods because its selector says app=legacy while Deployment dispatch-api labels Pods app=dispatch-api. Work only within the stated target and verify before declaring success. Which Kubernetes behavior best explains the required change or diagnosis?

  1. Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods.
  2. Gateway API separates infrastructure listener ownership from application route attachments and depends on controller support.
  3. DNS resolution may fail when CoreDNS replicas are unhealthy even when the requested Service and Pod endpoints exist.
  4. A ClusterIP Service provides stable in-cluster virtual addressing and directs traffic to selected ready Pod endpoints.

Explanation

Correct Answer

A:

Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. This explains the stated condition. The corresponding action is: Run kubectl -n fulfillment patch service dispatch-svc --type=merge -p '{"spec":{"selector":{"app":"dispatch-api"}}}' after confirming the label is authoritative. The direct acceptance evidence is: Run kubectl -n fulfillment get endpointslices -l kubernetes.io/service-name=dispatch-svc and verify addresses for the intended Pods.

Incorrect Answers

B:

This principle describes a separate cause: Gateway API separates infrastructure listener ownership from application route attachments and depends on controller support. The reported condition is governed by: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. The two mechanisms should not be conflated.

C:

DNS resolution may fail when CoreDNS replicas are unhealthy even when the requested Service and Pod endpoints exist. That explanation applies to a different technical failure. Here the controlling principle is: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods.

D:

The offered statement is true for this other mechanism: A ClusterIP Service provides stable in-cluster virtual addressing and directs traffic to selected ready Pod endpoints. It does not explain the facts described here, which follow from: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods.

Question 527

At Pinecrest logistics, in a sandbox Kubernetes cluster during a recovery tabletop exercise: Service dispatch-svc in fulfillment targets no Pods because its selector says app=legacy while Deployment dispatch-api labels Pods app=dispatch-api. Work only within the stated target and verify before declaring success. Which observation best verifies the requested outcome rather than an unrelated state?

  1. Run curl -fsS http://127.0.0.1:18082/healthz from another local shell while the tunnel is active.
  2. Run kubectl -n fulfillment get endpointslices -l kubernetes.io/service-name=dispatch-svc and verify addresses for the intended Pods.
  3. Run kubectl -n fulfillment get networkpolicy dispatch-api-deny-ingress -o yaml and perform an authorized denied-connection probe.
  4. Compare listed endpoints against the matching ready Pods and expected selector for dispatch-svc.

Explanation

Correct Answer

B:

Run kubectl -n fulfillment get endpointslices -l kubernetes.io/service-name=dispatch-svc and verify addresses for the intended Pods. This validates the affected object or control path, rather than only showing a command completed. The underlying reason is: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. The intended action is: Run kubectl -n fulfillment patch service dispatch-svc --type=merge -p '{"spec":{"selector":{"app":"dispatch-api"}}}' after confirming the label is authoritative.

Incorrect Answers

A:

This observation would test a different technical dependency: Port-forwarding creates a client-side tunnel to a selected backend and does not change the Service type or network exposure. The current issue is governed by: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. Its decisive check is “Run kubectl -n fulfillment get endpointslices -l kubernetes.io/service-name=dispatch-svc and verify addresses for the intended Pods”.

C:

That test belongs to another control with this basis: A selecting NetworkPolicy with ingress isolation and no allow rules denies new ingress to selected Pods except protocol-specific policy behavior; it does not itself control egress. In the current case, the governing reason is: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. The direct verification is “Run kubectl -n fulfillment get endpointslices -l kubernetes.io/service-name=dispatch-svc and verify addresses for the intended Pods”.

D:

This observation would test a different technical dependency: EndpointSlices represent Service backend addresses and readiness; Service existence alone does not prove endpoints exist. The current issue is governed by: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. Its decisive check is “Run kubectl -n fulfillment get endpointslices -l kubernetes.io/service-name=dispatch-svc and verify addresses for the intended Pods”.

Question 528

At Pinecrest logistics, in a sandbox Kubernetes cluster during a recovery tabletop exercise: Service dispatch-svc in fulfillment targets no Pods because its selector says app=legacy while Deployment dispatch-api labels Pods app=dispatch-api. Work only within the stated target and verify before declaring success. Which operational control most directly prevents this failure or configuration drift?

  1. Maintain lightweight in-cluster DNS canaries and verify Service creation and DNS freshness.
  2. Verify peer label governance and avoid permitting all namespace workloads accidentally.
  3. Test Service selectors against actual Pod template labels during deployments and renames.
  4. Treat cross-namespace route attachment and backend references as controlled trust boundaries.

Explanation

Correct Answer

C:

Test Service selectors against actual Pod template labels during deployments and renames. This reduces recurrence of the specific operational failure. It reinforces the action: Run kubectl -n fulfillment patch service dispatch-svc --type=merge -p '{"spec":{"selector":{"app":"dispatch-api"}}}' after confirming the label is authoritative. The relevant mechanism is: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods.

Incorrect Answers

A:

The suggested review tracks a different technical risk: Cluster DNS should resolve Service names inside its configured domain; host-side DNS results do not prove in-cluster resolution. Here the sustained control must address: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. Choose “Test Service selectors against actual Pod template labels during deployments and renames”.

B:

That safeguard is relevant to: An ingress rule with a podSelector selects source Pods in its own namespace unless combined with other peer selectors. The current failure instead follows from: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. Its prevention measure is “Test Service selectors against actual Pod template labels during deployments and renames”.

D:

The suggested review tracks a different technical risk: Gateway API HTTPRoutes express matching and backend behavior while Gateway resources own compatible listeners. Here the sustained control must address: Services select matching Pods; an unmatched selector can leave EndpointSlices without usable backends despite healthy Pods. Choose “Test Service selectors against actual Pod template labels during deployments and renames”.

Question 529

At Northstar finance, in an isolated training cluster during a scheduled maintenance rehearsal: Service invoice-svc in ledger uses the wrong targetPort; the application container is listening on 8080 and Service port must remain 80. Work only within the stated target and verify before declaring success. Which command or initial safe diagnostic step best addresses the stated lab task?

  1. Run kubectl -n ledger patch service invoice-svc --type=merge -p '{"spec":{"ports":[{"port":80,"targetPort":8080}]}}' for the lab's single-port Service.
  2. Run kubectl -n ledger expose deployment invoice-api --name=invoice-svc --type=NodePort --port=80 --target-port=8080.
  3. Run kubectl -n ledger apply -f ./ingress/invoice-api-tls.yaml after checking secret type and host match.
  4. Run kubectl -n observability port-forward service/metrics-svc 18081:8080 in a temporary session.

Explanation

Correct Answer

A:

Run kubectl -n ledger patch service invoice-svc --type=merge -p '{"spec":{"ports":[{"port":80,"targetPort":8080}]}}' for the lab's single-port Service. This is the appropriate command-line action or first safe diagnostic. The technical reason is: The Service port is what clients connect to, while targetPort must reach the actual backend listener. Validate the result with: Run kubectl -n ledger describe service invoice-svc and perform a connection test to port 80. Execute changes only in an authorized disposable lab or after normal production change controls.

Incorrect Answers

B:

This alternative is a response to another technical cause: A NodePort Service allocates a cluster-configured host port on each node while retaining its cluster IP routing. The reported case instead depends on: The Service port is what clients connect to, while targetPort must reach the actual backend listener. The action that directly addresses it is “Run kubectl -n ledger patch service invoice-svc --type=merge -p '{"spec":{"ports":[{"port":80,"targetPort":8080}]}}' for the lab's single-port Service”.

C:

The proposed action belongs to the mechanism: Ingress TLS termination relies on a controller and a referenced TLS Secret; updating a Service alone does not install certificates. Here the stated fault follows a different mechanism: The Service port is what clients connect to, while targetPort must reach the actual backend listener. The corrective choice is “Run kubectl -n ledger patch service invoice-svc --type=merge -p '{"spec":{"ports":[{"port":80,"targetPort":8080}]}}' for the lab's single-port Service”.

D:

The offered action targets: Port-forwarding creates a client-side tunnel to a selected backend and does not change the Service type or network exposure. The case facts point instead to: The Service port is what clients connect to, while targetPort must reach the actual backend listener. Implement “Run kubectl -n ledger patch service invoice-svc --type=merge -p '{"spec":{"ports":[{"port":80,"targetPort":8080}]}}' for the lab's single-port Service” to address that specific condition.

Question 530

At Northstar finance, in an isolated training cluster during a scheduled maintenance rehearsal: Service invoice-svc in ledger uses the wrong targetPort; the application container is listening on 8080 and Service port must remain 80. Work only within the stated target and verify before declaring success. Which Kubernetes behavior best explains the required change or diagnosis?

  1. An Ingress resource declares HTTP host/path routing but requires an actual installed Ingress controller.
  2. The Service port is what clients connect to, while targetPort must reach the actual backend listener.
  3. Gateway API HTTPRoutes express matching and backend behavior while Gateway resources own compatible listeners.
  4. CoreDNS behavior is configured separately from Service definitions, and incorrect DNS plugins or cluster domain can break discovery cluster-wide.

Explanation

Correct Answer

B:

The Service port is what clients connect to, while targetPort must reach the actual backend listener. This explains the stated condition. The corresponding action is: Run kubectl -n ledger patch service invoice-svc --type=merge -p '{"spec":{"ports":[{"port":80,"targetPort":8080}]}}' for the lab's single-port Service. The direct acceptance evidence is: Run kubectl -n ledger describe service invoice-svc and perform a connection test to port 80.

Incorrect Answers

A:

This principle describes a separate cause: An Ingress resource declares HTTP host/path routing but requires an actual installed Ingress controller. The reported condition is governed by: The Service port is what clients connect to, while targetPort must reach the actual backend listener. The two mechanisms should not be conflated.

C:

The offered statement is true for this other mechanism: Gateway API HTTPRoutes express matching and backend behavior while Gateway resources own compatible listeners. It does not explain the facts described here, which follow from: The Service port is what clients connect to, while targetPort must reach the actual backend listener.

D:

This principle describes a separate cause: CoreDNS behavior is configured separately from Service definitions, and incorrect DNS plugins or cluster domain can break discovery cluster-wide. The reported condition is governed by: The Service port is what clients connect to, while targetPort must reach the actual backend listener. The two mechanisms should not be conflated.