Certified Kubernetes Administrator (CKA) Practice Test

1 / 400

What is the primary purpose of the `k expose` command in Kubernetes?

To delete a deployment

To create a service for exposing a deployment

The primary purpose of the `k expose` command in Kubernetes is to create a service that exposes a deployment. This command simplifies the process of making a deployment's pods accessible, typically by creating either a ClusterIP or a NodePort service.

When using `k expose`, you provide the specific resource (such as a deployment) that you want to expose, along with parameters to configure the service, such as the target port and service type. By doing so, Kubernetes automatically generates the service and establishes the necessary networking configurations to allow external access to the application running in the pods, which is essential for enabling communication both within the cluster and from outside sources.

Other options do not align with the purpose of the `k expose` command. For instance, deleting a deployment, scaling a deployment, and updating resource labels involve different commands tailored for those specific tasks. The `k delete` command is used for removing resources, the `k scale` command adjusts the number of pod replicas, and `k label` or `kubectl patch` are used for changing resource labels. Each of these commands serves its unique function, clearly distinguishing them from the role of `k expose`.

Get further explanation with Examzify DeepDiveBeta

To scale a deployment

To update resource labels

Next Question
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy