0
0
Kubernetesdevops~5 mins

Service accounts in Kubernetes - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a Service Account in Kubernetes?
A Service Account in Kubernetes is a special type of account used by applications running in pods to interact with the Kubernetes API securely without using a user's credentials.
Click to reveal answer
beginner
How does a Service Account differ from a regular user account in Kubernetes?
Service Accounts are meant for processes running inside pods, while user accounts are for humans. Service Accounts are managed by Kubernetes and provide tokens automatically to pods.
Click to reveal answer
beginner
What is the default Service Account in a Kubernetes namespace?
Every Kubernetes namespace has a default Service Account named 'default'. Pods that do not specify a Service Account use this one automatically.
Click to reveal answer
intermediate
How do you assign a specific Service Account to a pod?
You specify the Service Account name in the pod's YAML file under the 'serviceAccountName' field in the pod spec.
Click to reveal answer
intermediate
Why is it important to use Service Accounts instead of user credentials inside pods?
Using Service Accounts limits access to only what the pod needs, improving security by avoiding sharing user credentials and enabling fine-grained permissions.
Click to reveal answer
What does a Kubernetes Service Account provide to a pod?
AA user login for the pod
BAn API token to access the Kubernetes API
CA network IP address
DA storage volume
Which field in a pod spec sets the Service Account to use?
ApodAccount
BaccountName
CuserAccount
DserviceAccountName
What is the name of the default Service Account in every Kubernetes namespace?
Asystem
Badmin
Cdefault
Dkube-service
Why should you avoid using user credentials inside pods?
AThey can give too much access and are less secure
BThey are slower to authenticate
CPods cannot use user credentials
DUser credentials expire too quickly
How does Kubernetes provide the Service Account token to a pod?
AMounted as a secret volume inside the pod
BSent via environment variables
CPrinted in pod logs
DManually copied by the user
Explain what a Kubernetes Service Account is and why it is used.
Think about how pods talk to Kubernetes safely.
You got /4 concepts.
    Describe how to assign a specific Service Account to a pod and why you might want to do this.
    Consider controlling what a pod can do.
    You got /4 concepts.