Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Aggregation Layer #3152

Closed
david92rl opened this issue Aug 7, 2017 · 6 comments
Closed

Support Aggregation Layer #3152

david92rl opened this issue Aug 7, 2017 · 6 comments

Comments

@david92rl
Copy link

david92rl commented Aug 7, 2017

In order to take advantage of the new Horizontal Pod Autoscaling based on Custom Metrics we have to cover some requisites.

The main one is Configure Aggregation Layer. Basically set some flags on the API Server:

--requestheader-client-ca-file=<path to aggregator CA cert>
--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=<path to aggregator proxy cert>
--proxy-client-key-file=<path to aggregator proxy key>

I'm not sure if those flags must be in the KubeAPIServerConfig section or Kops has to take care of it without user interaction via cluster.spec

My question is: Is there any way to make it work with the current release (1.7.0)?

@kumudt
Copy link

kumudt commented Aug 10, 2017

Facing the same issue. I couldn't find these flags in the Kops documentation.

@kumudt
Copy link

kumudt commented Aug 10, 2017

--horizontal-pod-autoscaler-use-rest-clients has to be added on kube-controller-manager
and
--requestheader-client-ca-file on kube-apiserver
has to be supported as well.

@chrislovecnm
Copy link
Contributor

chrislovecnm commented Aug 11, 2017

#3165 will support some of this

But we will need to get

--requestheader-client-ca-file=<path to aggregator CA cert>
--requestheader-allowed-names=aggregator
--requestheader-extra-headers-prefix=X-Remote-Extra-
--requestheader-group-headers=X-Remote-Group
--requestheader-username-headers=X-Remote-User

Added to the KubeAPIServerConfig as well.

@aponomarenko
Copy link

Hi,

Is it possible to pass the option --requestheader-client-ca-file (or any other custom option) to the apiserver currently by editing the cluster config file?

Thank you.

justinsb added a commit to justinsb/kops that referenced this issue Oct 22, 2017
Create the keypairs, which are supposed to be signed by a different CA.

Set the `--requestheader-...` flags on apiserver.

Fix kubernetes#3152
Fix kubernetes#2691
k8s-github-robot pushed a commit that referenced this issue Oct 24, 2017
Automatic merge from submit-queue.

Initial aggregation work

Create the keypairs, which are supposed to be signed by a different CA.
    
Set the `--requestheader-...` flags on apiserver.
    
Fix #3152
Fix #2691
k8s-github-robot pushed a commit that referenced this issue Nov 28, 2017
Automatic merge from submit-queue.

Map horizontal-pod-autoscaler-use-rest-clients flag

Maps `--horizontal-pod-autoscaler-use-rest-clients` flag which is required for [Horizontal Pod Autoscaling][1]. See Kubernetes code in [kubernetes/kubernetes/blob/v1.7.11/cmd/kube-controller-manager/app/autoscaling.go#L36-L39][2].

Seems this is the missing piece for fulfilment of HPA pre-requisites, which are:

* ✅ Enable the [Aggregation Layer][4] via the following kube-apiserver flags
   * ✅ `--requestheader-client-ca-file=<path to aggregator CA cert>` (see #3679)
   * ✅ `--requestheader-allowed-names=aggregator` (see #3679)
   * ✅ `--requestheader-extra-headers-prefix=X-Remote-Extra-` (see #3679)
   * ✅ `--requestheader-group-headers=X-Remote-Group` (see #3679)
   * ✅ `--requestheader-username-headers=X-Remote-User` (see #3679)
   * ✅ `--proxy-client-cert-file=<path to aggregator proxy cert>` (see #3165)
   * ✅ `--proxy-client-key-file=<path to aggregator proxy key>` (see #3165)
* ❓ [Horizontal Pod Scaling][3] ... set the appropriate flags for `kube-controller-manager`:
  * ❎  `--horizontal-pod-autoscaler-use-rest-clients` should be `true`.
  * ✅ `--kubeconfig <path-to-kubeconfig>` (already set)

**Relevant Documentation:**

* https://v1-7.docs.kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
* https://v1-7.docs.kubernetes.io/docs/tasks/access-kubernetes-api/configure-aggregation-layer/

**Relevant Issues & PRs:**

* #3679
* #3152
* #2691
* #2652
* #3165

[1]: https://v1-7.docs.kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
[2]: https://github.com/kubernetes/kubernetes/blob/v1.7.11/cmd/kube-controller-manager/app/autoscaling.go#L36-L39
[3]: https://v1-7.docs.kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/
[4]: https://v1-7.docs.kubernetes.io/docs/tasks/access-kubernetes-api/configure-aggregation-layer/
@bensussman
Copy link

@justinsb This issue is exactly what i'm running into trying to get HPA to work on my cluster. I'm using kops 1.11 so the fix from #3679 should have long since merged. I applied this manifest https://raw.githubusercontent.com/kubernetes/kops/master/addons/metrics-server/v1.8.x.yaml as recommended here: https://github.com/kubernetes/kops/blob/master/addons/metrics-server/README.md but the metrics service is reporting:

unable to fetch metrics from Kubelet ip-*.us-west-2.compute.internal (ip-*.us-west-2.compute.internal): Get https://ip-*us-west-2.compute.internal:10250/stats/summary/: x509: certificate signed by unknown authority]

I suspect it's because the value of --requestheader-client-ca-file=<path to aggregator CA cert> is not set correctly as recommended here: https://github.com/kubernetes/kops/blob/master/docs/horizontal_pod_autoscaling.md but I would expect that kops has a CA with a path for this? What should we set this to in order to get working? Is there any documentation I can follow that explains how to correctly "enable the aggregation layer" as required for HPA described here: https://github.com/kubernetes/kops/blob/master/docs/horizontal_pod_autoscaling.md ?

@bensussman
Copy link

Actually, I think #6201 might be the fix for my issue, but there seems to be some controversy about whether or not it works with kops v1.11 (which is what i have installed, the current version available from brew). I will follow along over there cc @itskingori

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants