<p>I'm trying to get kube-apiserver prometheus metrics with <code>kubectl</code> command. </p>

<p>I can get it from <code>kubectl proxy</code> [<strong>which proxy the api in localhost:8001(by default)</strong>]. then go to <code>http://localhost:8001/metrics</code></p>

<p>I want to get this metrics directly through <code>kubectl</code> command, without proxying.</p>

<p>My kubernetes version</p>

<pre><code>Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.0", GitCommit:"91e7b4fd31fcd3d5f436da26c980becec37ceefe", GitTreeState:"clean", BuildDate:"2018-06-27T20:17:28Z", GoVersion:"go1.10.2", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"13+", GitVersion:"v1.13.7-gke.24", GitCommit:"2ce02ef1754a457ba464ab87dba9090d90cf0468", GitTreeState:"clean", BuildDate:"2019-08-12T22:05:28Z", GoVersion:"go1.11.5b4", Compiler:"gc", Platform:"linux/amd64"}
</code></pre>

Abu Hanifa
<p>Got the answer </p>

<pre><code>$ kubectl get --raw /metrics
</code></pre>

<p>This command directly communicate with kube apiserver and get the prometheus metrics of kube apiserver.</p>
