Workloads running inside Tanzu Kubernetes Grid (TKG) guest clusters generate high volumes of container log output. Administrators need to modify the default Kubelet log rotation thresholds to prevent local node disk pressure or to extend log retention periods before standard log rotation occurs.
By default, the platform sets the following Kubelet configurations:
VMware Cloud Foundation (VCF)
vSphere Kubernetes Service (VKS)
The mechanism available to modify these parameters is strictly bound to the underlying ClusterClass API schema layer deployed within your vSphere environment.
In older lifecycle branches (prior to version builtin-generic-v3.5.0), Kubelet arguments are hardcoded to the platform system defaults and are not exposed as declarative variables in the runtime API topology. Customization in these versions requires localized, node-level configuration injection.
Modern lifecycle branches (builtin-generic-v3.5.0 and later) expose native osConfiguration variable hooks, allowing administrators to manage log thresholds declaratively across the cluster topology manifest.
Select the configuration option below that matches the active ClusterClass version running in your environment.
Starting with version builtin-generic-v3.5.0 (introduced alongside modernized vSphere Kubernetes Service frameworks), you can manage these arguments directly within your cluster deployment manifest without interacting with individual cluster nodes.
apiVersion: cluster.x-k8s.io/v1beta1kind: Clustermetadata: name: your-workload-cluster namespace: your-vsphere-namespacespec: topology: class: builtin-generic-v3.5.0 # Must be v3.5.0 or later version: v1.32.9+vmware.2-fips-vsc0.1.15 variables: - name: osConfiguration value: kubelet: arguments: containerLogMaxSize: 50Mi # Configurable up to 50Mi containerLogMaxFiles: 10 # Configurable up to 10
kubectl apply -f cluster.yaml
The cluster controller plane will automatically initiate a safe, rolling lifecycle update across your node pools to apply the adjustments.
For legacy clusters that cannot immediately be rebased to a newer topology version, the parameters are not exposed through API variables. The arguments must be applied directly to the configuration layout on each virtual machine node.
⚠️ Important: Manual runtime configuration overrides executed directly on a node are transient. They do not persist through cluster scaling, node deletion, or automated upgrade actions. Use this method as an interim workaround until you can migrate to a supported ClusterClass level.
Execute these steps on every Control Plane and Worker node within the target cluster:
sudo vi /var/lib/kubelet/config.yaml
containerLogMaxSize: 50Mi
containerLogMaxFiles: 10
sudo systemctl restart kubelet
sudo systemctl status kubelet
For comprehensive syntax matrices and complete lists of adjustable runtime variables across modernized cluster templates, please refer to our official developer reference documentation:
🔗 Broadcom Documentation — ClusterClass Variables for Customizing a Cluster