Knowledge Check: Kubernetes Concepts Flashcards
What is the recommended Kubernetes resource for running applications?
Deployment
What are some reasons you would prefer to use Deployments rather than “naked” Pods
- Deployments are compatible with Horizontal Pod Autoscalers
- Deployments can reschedule pods that fail
- Deployments support rolling updates and rollbacks
What is a “naked” pod?
Pods that are not managed by a higher-level resource, such as a Deployment
Which two kubectl commands that are useful for collecting information about any type of resource that is active in a Kubernetes cluster?
Describe
Get
True or False: Deployments are compatible with Horizontal Pod Autoscalers
True
Explanation
Deployments can be autoscaled using Horizontal Pod Autoscalers, reschedule pods that fail, and perform rolling updates and rollbacks. Naked pods (pods without any higher-level resource managing them) cannot do any of those.
True or False: Deployments are unable to reschedule pods that fail?
False. Deployments can reschedule failed pods
True or False: Deployments support rolling updates and rollbacks
True.
True or False: A Volume’s lifetime is connected to the lifetime of a pod
True.
A Volume’s lifetime is the same as the lifetime of the pod that encloses it
True or False: A PersistentVolume’s lifetime is connected to the lifetime of a pod
False.
PersistentVolumes have a lifetime independent of any pod allowing the data on a PersistentVolume to be reused by other pods.
True or False: Volumes can be shared by multiple containers in a pod, while PersistentVolumes cannot be shared by containers
False
Both Volumes and PersistentVolumes can be accessed by all of the containers in the pod enclosing them.
True or False: PersistentVolumes are claimed by defining the pod spec in the deployment?
False
PersistentVolumes must be claimed by pods using PersistentVolumeClaims.
How are PersistentVolumes created?
Through PersistentVolumeClaims
How is a volume created?
Include a volume in a Pod spec
You have written a manifest file for a service in Kubernetes. You did not include the type field in the service’s specification. What is the type of the service that will be created?
ClusterIP
Explanation
If you don’t specify a type for a service, it will use the default value of ClusterIp. ClusterIp services are accessible only within the cluster. Other types of services can be used to access a service from outside the cluster (NodePort and LoadBalancer) or access services outside the cluster (ExternalName).
/course/introduction-to-kubernetes/multi-container-pods-and-service-discovery/
You need to utilize a PersistentVolume for application storage in a Kubernetes cluster. What field of a PersistentVolume can you use to control the number of nodes that can mount the PersistentVolume for reading and writing?
accessMode
A PersistentVolumes accessMode field controls how many nodes can mount it for reading and writing. The supported values are ReadWriteOnce, ReadOnlyMany, and ReadWriteMany.