Kubernetes for Beginners: Deploying Your First Application Quiz

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.

  1. Understanding Kubernetes Clusters

    What is the primary function of the master node in a Kubernetes cluster?

    1. Storing container images
    2. Managing the cluster and its state
    3. Running user applications
    4. Exposing services to the internet

    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.

  2. Kubernetes Pods Basics

    Which statement best describes a pod in Kubernetes?

    1. A user interface dashboard for cluster monitoring
    2. A command used to deploy services
    3. A type of persistent storage volume for containers
    4. The smallest deployable unit containing one or more containers

    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.

  3. Verifying Your Kubernetes Installation

    After setting up Kubernetes locally, which kubectl command shows if your cluster node is running?

    1. kubectl create deployment
    2. kubectl get nodes
    3. kubectl start cluster
    4. kubectl describe services

    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.

  4. Deploying an Application with YAML

    Which Kubernetes object manages declarative updates and scaling for application pods?

    1. Deployment
    2. Service
    3. Volume
    4. ConfigMap

    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.

  5. Exposing Your Application

    What is the main purpose of creating a Service of type LoadBalancer for a pod?

    1. To encrypt traffic inside the cluster
    2. To monitor pod resource usage
    3. To allow external network traffic to reach your application
    4. To update environment variables for pods

    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.