How To Enable Debug Log for Kube-APIserver on an Existing Cluster

Problem

How to enable debug logs on an existing Cluster.

Environment

  • Platform9 Managed Kubernetes (PMK) - All Versions

Procedure

The default Kube-APIserver container debug value is 2. This can be modified using the steps outlined on the master node part of the cluster.

The 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 retrieved from the default template "/opt/pf9/pf9-kube/conf/masterconfig/base/centos/master.yaml") to some other location on the node.
Master.yaml file Backup
Copy
  1. Check default value for the Kube-APIserver container on k8s-master-<master-IP> pod. Using "kubectl describe pod k8s-master-<Matser-IP>" command. Here, by default the value is 2
Describe output for k8s-master-<master-ip>
Copy

3. Now edit debug level for Kube-APIserver container in "/etc/pf9/kube.d/pod- manifests/master.yaml" file. Pod will get recreated as soon as you save the edited file.

Master.yaml
Copy
  1. Now, verify the change on Kube-API server container on k8s-master-<master-IP> pod using Kubectl describe command.
Describe command
Copy
  1. Once you are done with the troubleshooting, please revert the debug level to 2 as higher debug level will capture many logs and utilise the pod resources.
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard