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.

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.

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.

  1. Backup the original master.yaml file (PMK's default configuration file) to some other location on the node.
Centos
Copy
Ubuntu
Copy
  1. Stop the PMK Stack.

Running this command will drain all pods/containers running on the node.

PMK v5.0, K8s v1.18 and Higher
Copy
  1. 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.
Bash
Copy

Post modification, the kube-controller-manager container section of master.yaml file should look as shown below.

Example master.yaml
Copy
  1. Start the PMK Stack.
PMK v5.0, K8s v1.18 and Higher
Copy
PMK v4.5, K8s v1.17 and Lower
Copy

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

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard