How To Modify/Add APIServer, ControllerManager & Scheduler Flags on an Existing Cluster
Problem
How To Modify/Add APIServer, ControllerManager & Scheduler Flags on an Existing Cluster?
As an example, we will be looking to modify the default pod eviction timeout "--pod-eviction-timeout" controlled by the kube-controller-manager.
Environment
Platform9 Managed Kubernetes (PMK) - All Versions
Procedure
The default pod eviction timeout value is 5 minutes. This can be modified using the steps outlined on the master node part of the cluster.
Info
The steps will remain same for any other flag that needs to be changed or added for kube-apiserver, kube-controller-manager & kube-scheduler.
Certain default flag values are already set in PMK's default configuration file. The path for the same is mentioned below.
Warning
Steps highlighted below are to be done directly on the master nodes that are part of the cluster and thus post cluster upgrade they will be wiped out.
If there is a need to persist the flag values post cluster upgrade on existing clusters, please contact Platform9 Support.
Backup the original master.yaml file (PMK's default configuration file) to some other location on the node.
Stop the PMK Stack.
Warning
Running this command will drain all pods/containers running on the node.
Add/Modify the required flag and it's corresponding value in this case "--pod-eviction-timeout=7m0s" to the file
_/opt/pf9/pf9-kube/conf/masterconfig/base/centos/master.yaml_in the_kube-controller-manager_container's command section. The file path will be different for Ubuntu OS as mentioned previously.
Post modification, the kube-controller-manager container section of master.yaml file should look as shown below.
Start the PMK Stack.
Warning
On a multi-master cluster, ensure that the changes are made to one master node at a time else ETCD will lose quorum and the cluster will be unreachable.
Additional Information
Controller Manager: Command Line Tools Reference - Kube-Controller-Manager
Last updated
