Docker & Kubernetes Test 1

    Question 1DOCKER- Purpose of Docker

    What is the primary purpose of Docker in modern development?

    Question 2KUBERNETES- Purpose of Kubernetes

    What is the primary purpose of Kubernetes in modern applications?

    Question 3KUBERNETES- Cluster Networking Basics

    In Kubernetes, what is the main principle of cluster networking?

    Question 4KUBERNETES- Purpose of ConfigMaps

    What is the primary purpose of a ConfigMap in Kubernetes?

    Question 5KUBERNETES- Horizontal Scaling Basics

    What does Horizontal Pod Autoscaler (HPA) do in Kubernetes?

    Question 6DOCKER- Difference Between Image and Container

    Which statement correctly distinguishes Docker images from containers?

    Question 7KUBERNETES- Key Components

    Which component is responsible for maintaining cluster state and managing workloads?

    Question 8KUBERNETES- Service Types

    Which Kubernetes Service type exposes an application externally with a cloud provider’s load balancer?

    Question 9KUBERNETES- Purpose of Secrets

    What is the primary purpose of a Kubernetes Secret?

    Question 10KUBERNETES- Vertical Scaling

    What is the difference between vertical and horizontal scaling in Kubernetes?

    Question 11DOCKER- Code Snippet (Dockerfile Basics)

    What is the purpose of this Dockerfile snippet?

    FROM openjdk:17 COPY target/app.jar app.jar ENTRYPOINT ["java", "-jar", "app.jar"]

    Question 12KUBERNETES- Code Snippet (Pod YAML)

    What does this YAML manifest define?

    apiVersion: v1 kind: Pod metadata: name: myapp-pod spec: containers: - name: myapp image: myapp:latest

    Question 13KUBERNETES- Code Snippet (NodePort Service)

    What does this YAML define?

    apiVersion: v1 kind: Service metadata: name: myapp-service spec: type: NodePort selector: app: myapp ports: - port: 80 targetPort: 8080 nodePort: 30007

    Question 14KUBERNETES- Code Snippet (ConfigMap YAML)

    What does this YAML define?

    apiVersion: v1 kind: ConfigMap metadata: name: app-config data: APP_MODE: "production" LOG_LEVEL: "info"

    Question 15KUBERNETES- Code Snippet (HPA YAML)

    What does this YAML configure?

    apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: myapp-hpa spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: myapp minReplicas: 2 maxReplicas: 10 metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 70

    Question 16DOCKER- Build and Run Commands

    What is the correct sequence to build and run a Docker image named `myapp`?

    Question 17KUBERNETES- Deployments

    What is the main purpose of a Deployment in Kubernetes?

    Question 18KUBERNETES- DNS Service Discovery

    How do pods discover other services in Kubernetes?

    Question 19KUBERNETES- Using ConfigMap in Pod

    How can a pod consume a ConfigMap?

    Question 20KUBERNETES- Resource Requests & Limits

    Why are requests and limits important in pod resource definitions?