Bird
0
0

Which of the following is the correct YAML snippet to create a ServiceAccount named my-service-account?

easy📝 Configuration Q12 of 15
Kubernetes - RBAC and Security
Which of the following is the correct YAML snippet to create a ServiceAccount named my-service-account?
AapiVersion: apps/v1 kind: Deployment metadata: name: my-service-account
BapiVersion: v1 kind: Pod metadata: name: my-service-account
CapiVersion: v1 kind: ServiceAccount metadata: name: my-service-account
DapiVersion: v1 kind: Namespace metadata: name: my-service-account
Step-by-Step Solution
Solution:
  1. Step 1: Identify the correct kind for ServiceAccount

    The kind must be ServiceAccount to create a service account resource.
  2. Step 2: Check the apiVersion and metadata

    ServiceAccount uses apiVersion: v1 and metadata with the name field.
  3. Final Answer:

    apiVersion: v1 kind: ServiceAccount metadata: name: my-service-account -> Option C
  4. Quick Check:

    ServiceAccount YAML uses kind: ServiceAccount [OK]
Quick Trick: ServiceAccount YAML always uses kind: ServiceAccount [OK]
Common Mistakes:
  • Using wrong kind like Pod or Deployment
  • Wrong apiVersion for ServiceAccount
  • Confusing Namespace with ServiceAccount

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes