The below screenshot shows the kubernetes document to enable API server flags, but no clear instructions were given on where to change these API server flags. I'm using kubernetes on digital ocean cloud. I can not use hpa.
kubernetes version is:
Asked
Active
Viewed 1,312 times
3

AATHITH RAJENDRAN
- 4,689
- 8
- 34
- 58
3 Answers
2
This depends on how your api-server is running. If it's as a service on the master node, @kishorebjv may have your answer, but if the api-server runs as a pod in kubernetes you should only have to add the flags to the args
for that deployment/daemonset.

switchboard.op
- 1,878
- 7
- 26
1
you can create a apiserver.conf file in master node & mount it in /etc/kubernetes/ directory of apiserver container. This will help you to customize your API server. here is the sample code for this.

kishorebjv
- 376
- 3
- 11
0
I believe you need to get working HPA in your kubernetes cluster. I have written a step by step answer for that, how can you achieve it:
How to Enable KubeAPI server for HPA Autoscaling Metrics
Please have a look. Hope this helps

Prafull Ladha
- 12,341
- 2
- 37
- 58
-
i followed your answer and I installed metrics server. after I created my hpa the TARGETS stuck in
/50%. What am I missing? @prafull – AATHITH RAJENDRAN Dec 12 '18 at 04:53 -
Result for kubectl get events: Warning FailedGetResourceMetric HorizontalPodAutoscaler unable to get metrics for resource cpu: unable to fetch metrics from resource metrics API: the server is currently unable to handle the request (get pods.metrics.k8s.io) Warning FailedComputeMetricsReplicas HorizontalPodAutoscaler failed to get cpu utilization: unable to get metrics for resource cpu: unable to fetch metrics from resource metrics API: the server is currently unable to handle the request (get pods.metrics.k8s.io) – AATHITH RAJENDRAN Dec 12 '18 at 04:55
-
Did you `kubectl apply -f` all the files in `metrics-server/deploy/1.8+` folder. If yes this should have worked. – Prafull Ladha Dec 12 '18 at 05:44
-
i did everything exactly as you mentioned, but not working. metric server pod status is "CrashLoopsBackOff" @prafull – AATHITH RAJENDRAN Dec 12 '18 at 06:32
-
I have updated my original answer, Kindly try that and let me know if you face any issue? – Prafull Ladha Dec 12 '18 at 08:35
-
hey @prafull I added authentication-token-webhook: true horizontal-pod-autoscaler-use-rest-clients: true in `/var/lib/kubelet/config.yaml` still i'm unable to get it work. Here is what im getting for `kubectl get apiservices` v1beta1.metrics.k8s.io kube-system/metrics-server False (MissingEndpoints) – AATHITH RAJENDRAN Dec 12 '18 at 12:17
-
Did you followed replaced the `metrics-server-deployment` file from the yaml file I have provided in the answer? If yes `metrics-server` pod is in running state? – Prafull Ladha Dec 12 '18 at 12:19
-
`horizontal-pod-autoscaler-use-rest-clients: true` should not be there, that flag is not of kubelet. Please remove that flag from kubelet conf and restart the kubelet – Prafull Ladha Dec 12 '18 at 12:20
-
yes i followed `metrics-server-deployment` given by you. `metrics-server` is not in running state, it's in CrashLoopBackOff state @prafull – AATHITH RAJENDRAN Dec 12 '18 at 12:29
-
I have removed that flag `horizontal-pod-autoscaler-use-rest-clients: true` and restarted the kubelet – AATHITH RAJENDRAN Dec 12 '18 at 12:30
-
Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/185141/discussion-between-prafull-ladha-and-aathith-rajendran). – Prafull Ladha Dec 12 '18 at 12:31
-
one more doubt @prafull!! `systemctl status kubelet` showing `Dec 12 12:31:01 kube-master kubelet[8529]: E1212 12:31:01.885511 8529 azure_dd.go:147] failed to get azure cloud in GetVolumeLimits, plugin.host: kube-master`. I'm not using azure, I'm using Digital ocean cloud. why this error is showing? – AATHITH RAJENDRAN Dec 12 '18 at 12:34
-
I am not familiar with digitial ocean kubernetes cluster. I am not sure what that means. – Prafull Ladha Dec 12 '18 at 12:37