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 reconciles the desired Pod count; it does not guarantee that every Pod is Ready when images, scheduling or applications fail.

  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.

StatefulSet storage needs PVCs/drivers and does not automatically configure database replication or backups.

  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 reconciles one Pod per eligible node, subject to scheduling and admission constraints.

  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 scopes names and resource organization; RBAC, quotas and NetworkPolicy provide additional access/resource/network controls.

  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 Kubernetes API objects and cluster state, excluding application volume contents?
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 an nginx Deployment with 3 replicas, port80, requests of CPU100m/memory128Mi and limits of CPU200m/memory256Mi.
Show Answer
yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginx
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.30.4
        ports:
        - containerPort: 80
        resources:
          requests:
            cpu: 100m
            memory: 128Mi
          limits:
            cpu: 200m
            memory: 256Mi

Add application readiness checks to this Deployment as appropriate.

  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

Requires a LoadBalancer implementation and cloud/local networking setup. A Pending external address usually needs that implementation; local learning can use port-forward.

  1. Store a credential-free DATABASE_URL and LOG_LEVEL in a ConfigMap, and place database credentials and API_KEY in a separate Secret.
Show Answer
yaml
apiVersion: v1
kind: ConfigMap
metadata:
  name: app-config
data:
  DATABASE_URL: mysql://mysql.default.svc.cluster.local:3306/db
  LOG_LEVEL: INFO
---
apiVersion: v1
kind: Secret
metadata:
  name: app-secrets
type: Opaque
stringData:
  DB_USERNAME: replace-from-protected-source
  DB_PASSWORD: replace-from-protected-source
  API_KEY: replace-from-protected-source

Secret values are illustrative placeholders. Supply real values through protected input or a secret manager, and do not commit them. stringData does not replace encryption at rest.

Advanced Questions ​

  1. Write RBAC Role/RoleBinding to grant pod read access.
Show Answer
yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: pod-reader
  namespace: development
rules:
- apiGroups:
  - ''
  resources:
  - pods
  verbs:
  - get
  - watch
  - list
- apiGroups:
  - ''
  resources:
  - pods/log
  verbs:
  - get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: read-pods
  namespace: development
subjects:
- kind: User
  name: jane
  apiGroup: rbac.authorization.k8s.io
roleRef:
  kind: Role
  name: pod-reader
  apiGroup: rbac.authorization.k8s.io

The development namespace and an externally authenticated jane identity must exist. RoleBinding does not create a user account.

  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
  namespace: production
spec:
  podSelector:
    matchLabels:
      role: database
  policyTypes:
  - Ingress
  ingress:
  - from:
    - podSelector:
        matchLabels:
          role: backend
    ports:
    - protocol: TCP
      port: 3306

Requires the production namespace and a network plugin that enforces NetworkPolicy. Allows are additive, so other policies can grant additional access. This policy does not isolate egress.


Return to Study Materials | Next Quiz: Cluster Architecture

Verification References ​