Readiness probes are critical in container orchestration to ensure that containers are ready to handle traffic before they are included in service load balancing. If a container fails readiness probes due to insufficient thresholds, adjusting these parameters can help. This guide explains how to modify readiness probe settings to accommodate containers with longer startup times.
- initialDelaySeconds: Delay before the first probe is initiated after the container starts.
- periodSeconds: Interval between successive probes.
- timeoutSeconds: Maximum duration a probe can take before it is considered failed.
- failureThreshold: Number of consecutive failures allowed before the container is marked as unready.
To give the container more time to become available, the following settings can be adjusted:
<span>readinessProbe:</span><br/><span> failureThreshold: 5 # Allows more failures before marking the container as unready</span><br/><span> httpGet:</span><br/><span> path: /</span><br/><span> port: metrics</span><br/><span> scheme: HTTP</span><br/><span> initialDelaySeconds: 30 # Provides 30 seconds before the first readiness probe</span><br/><span> periodSeconds: 10 # Reduces the frequency of checks to every 10 seconds</span><br/><span> successThreshold: 1 # Default, the number of successes needed to mark the container as ready</span><br/><span> timeoutSeconds: 20 # Increases the time allowed for the probe to complete</span>
|
To apply these changes to your deployment, follow these steps:
Access the Deployment's Edit Mode:
kubectl -n sisense edit deployment <deployment_name>
- Replace <deployment_name> with the name of your specific deployment.
- Navigate to the readinessProbe Section: Scroll through the deployment configuration until you find the readinessProbe section. Adjust the parameters as needed, based on the recommended configuration above.
- Save Changes and Exit Edit Mode: After making the necessary adjustments, save the file and exit the edit mode. The deployment will automatically restart, applying the new readiness probe configuration.
Proper configuration of readiness probes ensures that only containers ready to handle traffic are included in service routing. Adjusting initialDelaySeconds, periodSeconds, timeoutSeconds, and failureThreshold helps to manage containers with longer startup times effectively. By following the implementation steps, you can easily modify the probe settings and enhance the stability and reliability of your deployments.