Explore core concepts and best practices for deploying containerized applications using Kubernetes, from configuring clusters to integrating registries and managing deployments securely.
Which resource in Kubernetes is primarily used to manage the rollout and scaling of application instances in a production environment?
Explanation: A Deployment manages the rollout, updating, and scaling of Pods, ensuring desired state in production environments. Pods are the basic runnable units but do not handle updates or scaling. Services expose Deployments but do not manage application instances. ConfigMaps hold configuration data, not workload management.
How does Kubernetes authenticate to a private container registry in order to securely pull images for deployments?
Explanation: A Secret resource securely stores and provides registry authentication credentials to the Kubernetes cluster. Adding credentials in the Pod spec directly is insecure and not recommended. Anonymous access is not secure for private images. Service resources are used for networking, not for authentication.
Which Kubernetes object is most appropriate to expose an application for internal or external network access within a cluster?
Explanation: A Service object defines logical access to a set of Pods and enables both internal and external networking. ConfigMaps are for configuration data. Volumes provide persistent storage, not networking. 'IngressController' is not a built-in Kubernetes object name; 'Ingress' is used to manage HTTP/S routing.
What is the primary purpose of setting resource requests and limits in a Kubernetes Deployment manifest?
Explanation: Resource requests and limits specify how much CPU and memory each container can use, ensuring efficient cluster utilization and stability. Automatic updates are managed by the Deployment controller. Persistent storage is defined by Volumes. Network access rules are configured using Services or Network Policies.
Which Kubernetes feature allows you to perform rolling updates, ensuring zero downtime while upgrading an application?
Explanation: The RollingUpdate strategy in Deployments allows gradual replacement of old Pods with new versions, minimizing downtime. PodPreset injects config but does not manage updates. ReplicaSet maintains a stable set of replicas, but updates are triggered via Deployments. ConfigMapReload is not a native Kubernetes feature.