Uploaded image for project: 'OpenShift Windows Containers'
  1. OpenShift Windows Containers
  2. WINC-1635

Implement Log Rotation for Kubelet service using kube-log-runner

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • None
    • None
    • None
    • None
    • WINC - Sprint 284

      User Story
      As a Windows cluster administrator, I want kubelet logs to be automatically rotated using kube-log-runner so that disk space is not exhausted by unbounded log growth.

      Description

      Implement log rotation for the kubelet service running on Windows nodes managed by WMCO using kube-log-runner.

      Currently, kubelet logs can grow indefinitely, potentially consuming all available disk space and impacting node stability.
      Since Windows services don't have a mechanism for redirecting output of a process, kube-log-runner provides the necessary functionality to capture kubelet output and manage log rotation. The kube-log-runner is a Go-based binary that can run commands and redirect stdout/stderr with built-in log rotation capabilities.

      https://github.com/kubernetes/component-base/tree/master/logs/kube-log-runner

      Required
      Wrap kubelet execution with kube-log-runner on Windows nodes
      Configure appropriate log rotation parameters:
      Set -log-file to specify kubelet log file path
      Set -log-file-size to trigger rotation at appropriate size threshold (e.g., 100M)
      Set -log-file-age to automatically clean up old rotated logs (e.g., 168h for 7 days)
      Set -flush-interval to ensure logs are written to disk in near real-time on Windows
      Ensure kube-log-runner is configured during node bootstrapping
      Verify that rotated logs follow the naming convention: <original-file-name>-<timestamp><file-extension>

      Nice to have
      Make log rotation parameters (size, age, flush interval) configurable via env var, or ConfigMap
      E2E tests verify log rotation is working correctly
      Add metrics/alerts for log file sizes
      explore using the --also-stdout flag for integration with log collection systems

      Acceptance Criteria
      Kubelet service is wrapped with kube-log-runner execution
      Kubelet logs are rotated when they reach the specified size threshold
      Rotated logs follow the backup file naming convention with timestamps
      Old rotated logs are automatically deleted based on retention policy
      Log rotation configuration is applied during node creation
      Existing nodes can be upgraded with log rotation configuration

      Document log rotation behavior in operator documentation

              jvaldes@redhat.com Jose V
              jvaldes@redhat.com Jose V
              None
              None
              None
              None
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: