Kubernetes - Health Checks and ProbesWhich of the following YAML snippets correctly defines a readiness probe using a TCP socket in a Kubernetes pod spec?AreadinessProbe: tcpSocket: port: 3306 initialDelaySeconds: 5 periodSeconds: 10BreadinessProbe: httpGet: path: /health port: 3306 initialDelaySeconds: 5CreadinessProbe: exec: command: ["curl", "-f", "http://localhost:3306"] periodSeconds: 10DreadinessProbe: tcpSocket: path: /ready port: 3306 periodSeconds: 10Check Answer
Step-by-Step SolutionSolution:Step 1: Identify valid readiness probe typesReadiness probes can be httpGet, tcpSocket, or exec.Step 2: Check tcpSocket syntaxtcpSocket requires only a port number, no path.Step 3: Validate optionsreadinessProbe: tcpSocket: port: 3306 initialDelaySeconds: 5 periodSeconds: 10 correctly uses tcpSocket with port and timing fields.Final Answer:Option A -> Option AQuick Check:tcpSocket needs port only, no path [OK]Quick Trick: tcpSocket readiness probe requires only port, no path [OK]Common Mistakes:Adding path under tcpSocketUsing httpGet with wrong port or missing pathMisusing exec command syntax
Master "Health Checks and Probes" in Kubernetes9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Kubernetes Quizzes ConfigMaps - Why configuration separation matters - Quiz 10hard ConfigMaps - Creating ConfigMaps from files - Quiz 14medium ConfigMaps - Why configuration separation matters - Quiz 8hard ConfigMaps - Immutable ConfigMaps - Quiz 11easy Health Checks and Probes - Probe failure and container restart behavior - Quiz 11easy Networking - Container Network Interface (CNI) - Quiz 8hard Persistent Storage - PersistentVolumeClaim (PVC) definition - Quiz 12easy Persistent Storage - StatefulSets for stateful applications - Quiz 14medium Secrets - Creating Secrets - Quiz 1easy Secrets - Secrets are not encrypted by default - Quiz 3easy