Explore key concepts and essential steps for deploying your first containerized application on Kubernetes using a local cluster setup. Build foundational skills in clusters, pods, services, deployments, and kubectl commands.
What is the primary function of the master node in a Kubernetes cluster?
Explanation: The master node is responsible for managing the Kubernetes cluster and ensuring its desired state. It handles scheduling, monitoring, and scaling. Running user applications occurs on worker nodes. Storing container images is typically managed by container registries, and exposing services is achieved through services and networking configurations, not solely the master node.
Which statement best describes a pod in Kubernetes?
Explanation: Pods are the basic deployable objects in Kubernetes, often hosting one or several tightly coupled containers. Persistent storage is handled by volumes, not pods. 'deploy services' is done using kubectl or YAML manifests, and dashboards are separate UI tools.
After setting up Kubernetes locally, which kubectl command shows if your cluster node is running?
Explanation: The 'kubectl get nodes' command displays the status and readiness of all nodes in the cluster. 'kubectl describe services' provides service details, not node information. 'kubectl start cluster' is not a standard command, and 'kubectl create deployment' is used for deploying applications.
Which Kubernetes object manages declarative updates and scaling for application pods?
Explanation: A Deployment object in Kubernetes manages scaling and declarative updates to pods, ensuring the desired replica count. Services abstract network access but do not manage scaling. ConfigMaps provide configuration data, and Volumes offer storage to pods.
What is the main purpose of creating a Service of type LoadBalancer for a pod?
Explanation: A Service of type LoadBalancer exposes an application so it can be accessed from outside the cluster. Encryption is handled by other means such as TLS. Monitoring resource usage involves tools and metrics, while environment variables are managed via ConfigMaps or pod specifications.