Kubernetes: what are dry run request for?

11/9/2018

While reading the API concepts page of Kubernetes documentation, I got a bit confused with the given definition:

In version 1.12, if the dry run alpha feature is enabled, the modifying verbs (POST, PUT, PATCH, and DELETE) can accept requests in a dry run mode. Dry run mode helps to evaluate a request through the typical request stages (admission chain, validation, merge conflicts) up until persisting objects to storage. The response body for the request is as close as possible to a non dry run response. The system guarantees that dry run requests will not be persisted in storage or have any other side effects.

So, dry run requests are meant to have as most as possible the same behavior from the client point of view.

What is the main idea behind this concept, and what use-cases does it covers?

-- vtellier
kubernetes
rest

1 Answer

11/9/2018

Dry run is not a concept exclusive to Kubernetes. It's an expression used to indicate a rehearsal of a performance or procedure before the real one. Dry run mode gives you the possibility of issuing a command without side effects for testing an actual command that you intend to run.

Having said that, read again the following quote and it should make sense now:

Dry run mode helps to evaluate a request through the typical request stages (admission chain, validation, merge conflicts) up until persisting objects to storage. [...] The system guarantees that dry run requests will not be persisted in storage or have any other side effects.

-- cassiomolin
Source: StackOverflow