Getting Started with Kubernetes | Observability: Are Your Applications Healthy?

1) Requirement

2) Liveness and Readiness Probes

Application Health Status — Introduction to the Liveness and Readiness Probes

Application Health Status — Instructions for Use

Check Methods

Check Results

  • Succeeded: Indicates that the container passed the health check and is considered normal by the liveness probe or readiness probe.
  • Failed: Indicates that the container fails to pass the health check. When the readiness probe determines that a pod is abnormal, the pod is removed from the service layer. When the liveness probe determines that a pod is abnormal, the pod is restarted or deleted.
  • Unknown: Indicates that the current mechanism is not fully executed probably because the mechanism times out or no response is returned promptly after script execution. In this case, the readiness probe or liveness probe waits for the following check mechanism, without performing any operations.

Application Health Status — Pod Probe Spec

  • The initialDelaySeconds parameter indicates the startup delay after which a check is performed. For example, it may take a long time to start a Java application as it involves JVM startup and JAR loading. Therefore, the Java application might not be checked during a period, which is predictable and is specified by setting the initialDelaySeconds parameter.
  • The periodSeconds parameter indicates the check interval, which defaults to 10 seconds.
  • The timeoutSeconds parameter indicates the time-out period of health check. The application is considered to be Failed if the health check fails within the time-out period.
  • The successThreshold parameter indicates the maximum number of health check attempts that are retried. The default value of this parameter is 1, indicating that the pod is considered healthy if a secondary health check succeeds after the first failed health check attempt.
  • The failureThreshold parameter indicates the maximum number of health check retries for determining whether a pod is Failed. The default value of this parameter is 3, indicating that the pod is considered Failed if it fails the health check three times consecutively in a healthy state.

Application Health Status — Summary of Liveness and Readiness Probes

3) Problem Diagnosis

Application Troubleshooting — State Mechanism

Application Troubleshooting — Common Application Exceptions

Pod Stays in the Pending State

Pod Stays in the Waiting State

Pod Restarts Repeatedly and Stops Responding

Pod is in the Running State but is Abnormal

Service is Abnormal

4) Remote Application Debugging

Remote Pod Debugging

Remote Service Debugging

  • Reverse Debugging: Expose the service to a remote cluster so that applications in the cluster call the service.
  • Forward Debugging: Enable a local service to call remote services.

Open Source Debugger — kubectl-debug

Summary

Original Source:

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alibaba Cloud

Alibaba Cloud

Follow me to keep abreast with the latest technology news, industry insights, and developer trends. Alibaba Cloud website:https://www.alibabacloud.com