You can use timeout to set a timeout for a command:
timeout 5s curl -s https://api.internal
timeout 3s dig myservice.cluster.local
timeout 30s npm install You can use timeout to set a timeout for a command:
timeout 5s curl -s https://api.internal
timeout 3s dig myservice.cluster.local
timeout 30s npm install