Certified Kubernetes Administrator (CKA) Practice Test

1 / 400

How do you verify a service account's permissions for creating a deployment?

Use kubectl auth can-i command

Using the `kubectl auth can-i` command is the most effective way to verify a service account's permissions for creating a deployment in Kubernetes. This command allows you to check whether a specific user (in this case, a service account) has the necessary permissions to perform a certain action, such as creating a deployment in a particular namespace.

When you run this command, you specify the action (create) and the resource type (deployments), and it responds with either "yes" or "no," indicating whether the service account has the required permissions. This method provides a straightforward and automated way to validate access without needing to manually traverse role bindings or review YAML configurations.

In contrast, checking in the service account class does not provide a direct means of assessing permissions related to specific actions. Listing all roles of the service account may give you some indication of permissions but would require additional steps to understand the complete context of those roles and their bindings. Manually reviewing permissions might be comprehensive but is often tedious and error-prone, especially in complex Kubernetes environments where multiple roles and bindings exist.

Overall, the `kubectl auth can-i` command stands out for its clarity and practicality in verifying permissions related to service accounts in Kubernetes.

Get further explanation with Examzify DeepDiveBeta

Check in the service account class

List all roles of the service account

Manually review permissions

Next Question
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy