kubernetes – Is there an actual difference between the `request-timeout` flag vs the timeout flag for kubectl sub-commands
I believe the -timeout
flag is for the operation itself. For example if you issue it with kubectl delete
it will wait upto timeout
amount of time before considering the object ‘deleted’.
Whereas the --request-timeout
is the timeout on the HTTP request itself, that can be set to account for slower API requests.
The relationship between them can be characterised as:
timeout = request_timeout + time_of_operation
So, if a request timeout of 1s is set, and we set 2s as timeout, we are allowing up to 1s for the API server to perform the operation. Afterwards, the kubectl binary will return success
.
The default values for both are, of course 0s (no timeout) and that is why your kubectl
binary can get “stuck” if either the API server doesn’t respond, or the operation itself gets stuck (object takes too long to delete).
Read more here: Source link