Reputation: 5386
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:
Upvotes: 6
Views: 1974
Reputation: 6372
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.
Upvotes: 0
Reputation: 2288
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.
Upvotes: 3
Reputation: 13459
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
Upvotes: 0
Reputation: 386
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.
Upvotes: 1