Kubernetes Introduction Quiz
This quiz tests your understanding of Kubernetes basic concepts, architecture, and features.
Multiple Choice Questions
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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
- What key-value store stores all cluster data?
Show Answer
Answer: etcd
- What component selects a node for newly created Pods?
Show Answer
Answer: kube-scheduler
- What temporary volume type is deleted when the Pod is deleted?
Show Answer
Answer: emptyDir
- What object stores configuration data in key-value format?
Show Answer
Answer: ConfigMap
- What object stores sensitive information like passwords?
Show Answer
Answer: Secret
Practical Questions
- Write a Deployment YAML for nginx with 3 replicas.
Show Answer
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- Write a LoadBalancer Service YAML.
Show Answer
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: 80
selector:
app: nginx- Write a ConfigMap YAML with DATABASE_URL and LOG_LEVEL.
Show Answer
apiVersion: v1
kind: ConfigMap
metadata:
name: app-config
data:
DATABASE_URL: "mysql://localhost:3306/db"
LOG_LEVEL: "INFO"Advanced Questions
- Write RBAC Role/RoleBinding to grant pod read access.
Show Answer
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- Write a NetworkPolicy allowing only backend-to-database traffic on port 3306.
Show Answer
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