<p>I am trying to setup horizontal pod autoscaling using custom-metrics. For <a href="https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-custom-metrics" rel="nofollow noreferrer">support of custom metrics</a> in kuberenetes 1.8.1, I need to <a href="https://kubernetes.io/docs/tasks/access-kubernetes-api/configure-aggregation-layer/" rel="nofollow noreferrer">enable the aggregation layer</a> by setting the following flags in kube-apiserver:</p>

<pre><code>--requestheader-client-ca-file=&lt;path to aggregator CA cert&gt;
--requestheader-allowed-names=aggregator
--requestheader-extra-headers-prefix=X-Remote-Extra-
--requestheader-group-headers=X-Remote-Group
--requestheader-username-headers=X-Remote-User
--proxy-client-cert-file=&lt;path to aggregator proxy cert&gt;
--proxy-client-key-file=&lt;path to aggregator proxy key&gt;
</code></pre>

<p>The kubernetes documentation does not contains any information for how to set these flags in api-server and controller manager. I am using azure kubernetes service (AKS).</p>

<p>Not sure but I think one of the possible way to set these flags could be by editing the yaml of kube-apiserver-xxx pod but when I run:</p>

<pre><code>kubectl get po -n kube-system
</code></pre>

<p>I get no pod for kube-apiserver neither for kube controller manager.</p>

<p>What is the possible way to set these flags in aks?</p>

<p>I also deployed prometheus adapter for custom metrics but the pod logs showed me the following error:</p>

<pre><code>panic: cluster doesn't provide requestheader-client-ca-file
</code></pre>

<p>You can see the exact requirements in configuration section in this <a href="https://github.com/kubeless/kubeless/tree/master/manifests/autoscaling" rel="nofollow noreferrer">link</a>.</p>

<pre><code>kubectl version
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.3", GitCommit:"f0efb3cb883751c5ffdbe6d515f3cb4fbe7b7acd", GitTreeState:"clean", BuildDate:"2017-11-08T18:39:33Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.1", GitCommit:"f38e43b221d08850172a9a4ea785a86a3ffa3b3a", GitTreeState:"clean", BuildDate:"2017-10-11T23:16:41Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
</code></pre>

<p>Support for the aggregation layer has been added a couple weeks ago, so no configuration should be necessary for a new cluster. Please see details here: <a href="https://github.com/Azure/AKS/issues/54" rel="nofollow noreferrer">https://github.com/Azure/AKS/issues/54</a></p>
