Skip to main content
Glama
verify.sh1.07 kB
#!/usr/bin/env bash TIMEOUT="120s" # Wait for the deployment rollout to complete and become "Available" if kubectl wait --for=condition=Available deployment/app -n debug --timeout=$TIMEOUT; then # Get the restart count *only* from the new, running pod. restarts=$(kubectl get pods -n debug -l app=nginx --field-selector=status.phase=Running -o jsonpath='{.items[0].status.containerStatuses[0].restartCount}') # Wait additional 5 seconds to ensure stability sleep 5 # Check if restart count hasn't increased new_restarts=$(kubectl get pods -n debug -l app=nginx --field-selector=status.phase=Running -o jsonpath='{.items[0].status.containerStatuses[0].restartCount}') if [[ "$restarts" == "$new_restarts" ]]; then echo "Pod is stable. Verification successful." exit 0 else echo "Verification failed: Pod restarted unexpectedly." exit 1 fi fi # If we get here, the deployment never became available echo "Verification failed: Deployment 'app' did not become Available in $TIMEOUT." exit 1

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/containers/kubernetes-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server