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:
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.
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.
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
kubectl apply -f
all the files in metrics-server/deploy/1.8+
folder. If yes this should have worked. –
Greater /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) –
Inquiline metrics-server-deployment
file from the yaml file I have provided in the answer? If yes metrics-server
pod is in running state? –
Greater 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 –
Greater metrics-server-deployment
given by you. metrics-server
is not in running state, it's in CrashLoopBackOff state @prafull –
Inquiline horizontal-pod-autoscaler-use-rest-clients: true
and restarted the kubelet –
Inquiline 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? –
Inquiline The kube-apiserver
usually runs as a static pod. This means it is managed directly by the kubelet
on a specific node, without the API server observing it and therefore it cannot be updated using kubectl
commands.
Most of the times you can find the kube-apiserver
pod running in the kube-system
namespace.
kubectl get pods -n kube-system
The kubelet
loads its config and then starts watching the static pods manifests directory. The path where you are most likely to find the kube-apiserver.yaml
definition is /etc/kubernetes/manifests
on the K8s node. Here is a unit test for this action in the K8s source code.
Updating /etc/kubernetes/manifests/kube-apiserver.yaml
will automatically redeploy the pod with the new config, including the flags you need.
© 2022 - 2024 — McMap. All rights reserved.