<p>I'd like to use kubectl with only jsonpath to obtain the current cluster address. I've tried the following, and many permutations of it, but this doesn't seem to work.</p>

<pre><code>kubectl config view -o jsonpath='{.clusters[?($.current-context)].cluster.server}'
</code></pre>

<p>Is this possible using only jsonpath?</p>

<p>You can use the <code>--minify</code> flag:</p>

<blockquote>
  <p>--minify=false: Remove all information not used by current-context from the output</p>
</blockquote>

<p>And then filter the <code>server</code> field from the current context output:</p>

<pre><code>kubectl config view --minify -o jsonpath='{.clusters[].cluster.server}'
</code></pre>
