Skip to content

Kubernetes Introduction Quiz

This quiz tests your understanding of Kubernetes basic concepts, architecture, and features.

Multiple Choice Questions

  1. What does the name Kubernetes mean in Greek?
    • A) Captain
    • B) Helmsman or Pilot
    • C) Container
    • D) Administrator
Show Answer

Answer: B) Helmsman or Pilot

Explanation: Kubernetes means 'helmsman' or 'pilot' in Greek, symbolizing its role in guiding containerized applications.

  1. Which of the following is NOT a Kubernetes control plane component?
    • A) kube-apiserver
    • B) etcd
    • C) kubelet
    • D) kube-scheduler
Show Answer

Answer: C) kubelet

Explanation: kubelet is an agent that runs on each node and is not a control plane component.

  1. What is the smallest deployable unit in Kubernetes?
    • A) Container
    • B) Pod
    • C) Deployment
    • D) Service
Show Answer

Answer: B) Pod

Explanation: A Pod is the smallest deployable unit in Kubernetes.

  1. Which of the following is NOT a Kubernetes Service type?
    • A) ClusterIP
    • B) NodePort
    • C) LoadBalancer
    • D) ExternalProxy
Show Answer

Answer: D) ExternalProxy

Explanation: Service types include ClusterIP, NodePort, LoadBalancer, and ExternalName.

  1. Which resource manages the number of Pod replicas?
    • A) Service
    • B) ConfigMap
    • C) ReplicaSet
    • D) Namespace
Show Answer

Answer: C) ReplicaSet

Explanation: ReplicaSet ensures that a specified number of Pod replicas are always running.

  1. Which workload resource is designed for stateful applications?
    • A) Deployment
    • B) StatefulSet
    • C) DaemonSet
    • D) Job
Show Answer

Answer: B) StatefulSet

Explanation: StatefulSet provides unique identifiers and persistent storage for stateful applications.

  1. Which resource ensures a Pod runs on all nodes?
    • A) Deployment
    • B) StatefulSet
    • C) DaemonSet
    • D) CronJob
Show Answer

Answer: C) DaemonSet

Explanation: DaemonSet ensures a copy of a Pod runs on all (or specific) nodes.

  1. Which resource runs tasks periodically according to a schedule?
    • A) Job
    • B) CronJob
    • C) Deployment
    • D) ReplicaSet
Show Answer

Answer: B) CronJob

Explanation: CronJob runs Jobs periodically according to a specified schedule.

  1. What provides resource isolation within a cluster?
    • A) Label
    • B) Annotation
    • C) Namespace
    • D) ConfigMap
Show Answer

Answer: C) Namespace

Explanation: Namespace provides a way to isolate resource groups within a single cluster.

  1. Which is NOT a key difference between EKS and self-managed Kubernetes?
    • A) Control plane management
    • B) Core Kubernetes API
    • C) High availability configuration
    • D) Security patch application
Show Answer

Answer: B) Core Kubernetes API

Explanation: Both use the same standard Kubernetes API.

Short Answer Questions

  1. What key-value store stores all cluster data?
Show Answer

Answer: etcd

  1. What component selects a node for newly created Pods?
Show Answer

Answer: kube-scheduler

  1. What temporary volume type is deleted when the Pod is deleted?
Show Answer

Answer: emptyDir

  1. What object stores configuration data in key-value format?
Show Answer

Answer: ConfigMap

  1. What object stores sensitive information like passwords?
Show Answer

Answer: Secret

Practical Questions

  1. Write a Deployment YAML for nginx with 3 replicas.
Show Answer
yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.21
        ports:
        - containerPort: 80
  1. Write a LoadBalancer Service YAML.
Show Answer
yaml
apiVersion: v1
kind: Service
metadata:
  name: nginx-service
spec:
  type: LoadBalancer
  ports:
  - port: 80
    targetPort: 80
  selector:
    app: nginx
  1. Write a ConfigMap YAML with DATABASE_URL and LOG_LEVEL.
Show Answer
yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: app-config
data:
  DATABASE_URL: "mysql://localhost:3306/db"
  LOG_LEVEL: "INFO"

Advanced Questions

  1. Write RBAC Role/RoleBinding to grant pod read access.
Show Answer
yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  namespace: development
  name: pod-reader
rules:
- apiGroups: [""]
  resources: ["pods", "pods/log"]
  verbs: ["get", "watch", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: read-pods
  namespace: development
subjects:
- kind: User
  name: jane
roleRef:
  kind: Role
  name: pod-reader
  apiGroup: rbac.authorization.k8s.io
  1. Write a NetworkPolicy allowing only backend-to-database traffic on port 3306.
Show Answer
yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: db-network-policy
spec:
  podSelector:
    matchLabels:
      role: database
  policyTypes:
  - Ingress
  ingress:
  - from:
    - podSelector:
        matchLabels:
          role: backend
    ports:
    - protocol: TCP
      port: 3306

Return to Study Materials | Next Quiz: Cluster Architecture