<p>I've looked over the documentation and browsed the source, but I can't seem to figure out how to do this. Is there any way to send query string parameters along with the path when implementing a Kubernetes liveness probe?</p>

<p>The string I am sending, which looks something like this:</p>

<pre><code>/api/v1?q=...
</code></pre>

<p>becomes URL-encoded and hits the server as:</p>

<pre><code>/api/v1%3fq=...
</code></pre>

<p>As I have no such route on this particular API, I get a 404, and Kube reaps the pods after the allotted timeout.</p>

<p>Is there any way to define query string parameters to liveness probes and/or trick the URI encoder to allow query string parameters?</p>

<p>EDIT: This should now be fixed in Kubernetes 1.3. Thanks to Rudi C for pointing that out.</p>

<p>Liveness probes in Kubernetes v1.2 don't support passing query parameters.</p>

<p><a href="https://github.com/deis/controller/issues/774" rel="nofollow">This Issue</a> in the Deis Controller repo has a good explanation. The gist is that the LivenessProbe.HttpGet.Path is treated as a true URL path (which needs the "?" to be escaped as "%3f").</p>

<p>I've opened a <a href="https://github.com/kubernetes/kubernetes/issues/29470" rel="nofollow">feature request Issue</a> against Kubernetes to discuss adding query parameter(s).</p>

<p>As a workaround, you could use an exec livenessProbe that included the query parameters (as long as your container includes something like wget or curl):</p>

<pre><code>livenessProbe:
  exec:
    command:
    - wget
    - /api/v1?q=...
</code></pre>
