Visitar URL original
Feature: enable the structured logging for kubernetes components by default · Issue #9268 · kubernetes/minikube · GitHub
Skip to content

Feature: enable the structured logging for kubernetes components by default #9268

Open

Description

@rawkode

Kubernetes 1.19 seen a big push for ensuring the Kubernetes components produce structured logs. Each components can be passed the --logging-format flag to tweak the output format of these structured logs. Available formats at the time of this issue are text and json, with the former being the default.

I'd like to see minkube support a single flag for enabling the format to be switched to JSON

minikube --logging-format=json, which should result in --logging-format=json being sent to the Kubelet, Scheduler, APIServer, and others.

Activity

  1. added
    kind/featureCategorizes issue or PR as related to a new feature.
    priority/backlogHigher priority than priority/awaiting-more-evidence.
    on Sep 25, 2020
  2. changed the title [-]feature: make it easier to enable JSON format for structured logging[/-] [+]feature: make it easier to set logging-format across Kubernetes components[/+] on Sep 25, 2020
  3. tstromberg commented on Sep 25, 2020

    @tstromberg
    Contributor

    Seems reasonable. I wonder if it's better to special-case this for logging format, or if there are other flags that we should make it easier to apply across all components? That would point us into the direction of what kind of flag behavior we should define.

  4. priyawadhwa commented on Oct 28, 2020

    @priyawadhwa

    Just wanted to point out that this is currently possible via the --extra-config flag in case anybody wants to use the feature now.

  5. fejta-bot commented on Jan 26, 2021

    @fejta-bot

    Issues go stale after 90d of inactivity.
    Mark the issue as fresh with /remove-lifecycle stale.
    Stale issues rot after an additional 30d of inactivity and eventually close.

    If this issue is safe to close now please do so with /close.

    Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
    /lifecycle stale

  6. added
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on Jan 26, 2021
  7. medyagh commented on Feb 18, 2021

    @medyagh
    Member

    as @priyawadhwa noted I think this could be be available as extra-config , have u already tried that ?

    I would also support a Pr that makes configures kubeadm to do structured logging by default.

  8. changed the title [-]feature: make it easier to set logging-format across Kubernetes components[/-] [+]Feature: enable the structured logging for kubernetes components by default[/+] on Feb 18, 2021
  9. added
    good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Feb 18, 2021
  10. medyagh commented on Feb 18, 2021

    @medyagh
    Member

    I would accept a PR that enables structured logging for kubernetes inside minikube

  11. removed
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on Feb 18, 2021
  12. fejta-bot commented on May 19, 2021

    @fejta-bot

    Issues go stale after 90d of inactivity.
    Mark the issue as fresh with /remove-lifecycle stale.
    Stale issues rot after an additional 30d of inactivity and eventually close.

    If this issue is safe to close now please do so with /close.

    Send feedback to sig-contributor-experience at kubernetes/community.
    /lifecycle stale

  13. added
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on May 19, 2021
  14. 4 remaining items

  15. added
    lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.
    on Jun 30, 2021
  16. colinbjohnson commented on Jul 30, 2021

    @colinbjohnson

    If folks are a little less familiar with minikube, example usage of the --extra-config flag to enable json format logging for the scheduler is here:

    minikube start --extra-config scheduler.logging-format=json

    Which will return logs similar to this:

    colinjohnson@cjohnson07 vpc % kubectl logs kube-scheduler-minikube --namespace kube-system  
    I0730 02:28:45.021355       1 serving.go:347] Generated self-signed cert in-memory
    {"ts":1627612129283.1523,"msg":"Starting RequestHeaderAuthRequestController\n","v":0}
    {"ts":1627612129283.3477,"msg":"Starting client-ca::kube-system::extension-apiserver-authentication::client-ca-file\n","v":0}
    {"ts":1627612129283.4307,"msg":"Waiting for caches to sync for RequestHeaderAuthRequestController\n","v":0}
    
  17. Atharva-Shinde commented on Aug 10, 2021

    @Atharva-Shinde

    Hey @priyawadhwa @medyagh is this issue solved??? I would like to work on this if not solved.

  18. PratikBorhade302 commented on Aug 29, 2021

    @PratikBorhade302

    /remove-lifecycle rotten

  19. tstromberg commented on Aug 29, 2021

    @tstromberg
    Contributor

    @Atharva-Shinde - As far as I know, no work on this has been done.

  20. avinashupadhya99 commented on Oct 26, 2021

    @avinashupadhya99
    Contributor

    I'm gonna have a go at this :)
    Mostly gonna follow #9223
    /assign

  21. removed their assignment
    on Nov 23, 2021
  22. deepakmega commented on Dec 13, 2021

    @deepakmega

    /assign

  23. removed their assignment
    on Jan 28, 2022
  24. gdenn commented on Feb 20, 2022

    @gdenn

    /assign

    @tstromberg this would be my first contribution to kubernetes but i'd like to give it a go.

    I would take one-two days to familiarize myself with the code and come back with questions (if something is not clear).

  25. gdenn commented on Feb 27, 2022

    @gdenn

    I started minikube and specified --logging-format json through the --extra-config for all control plane components:

    minikube start --extra-config scheduler.logging-format=json --extra-config kubeadm.logging-format=json --extra-config kubelet.logging-format=json --extra-config apiserver.logging-format=json --extra-config controller-manager.logging-format=json

    The logoutput indicates that kubeadm does not support --logging-format yet:

    😄  minikube v1.25.1 on Darwin 12.1
    ✨  Using the docker driver based on existing profile
    
    ❌  Exiting due to MK_USAGE: Sorry, the kubeadm.logging-format parameter is currently not supported by --extra-config

    Starting minikube without specifying --logging-format for kubeadm through the extra-config worked:

    😄  minikube v1.25.1 on Darwin 12.1
    ✨  Using the docker driver based on existing profile
    👍  Starting control plane node minikube in cluster minikube
    🚜  Pulling base image ...
    🔄  Restarting existing docker container for "minikube" ...
    🐳  Preparing Kubernetes v1.23.1 on Docker 20.10.12 ...
        ▪ scheduler.logging-format=json
        ▪ kubelet.logging-format=json
        ▪ apiserver.logging-format=json
        ▪ controller-manager.logging-format=json
        ▪ kubelet.housekeeping-interval=5m
        ▪ Generating certificates and keys ...
        ▪ Booting up control plane ...
        ▪ Configuring RBAC rules ...
    🔎  Verifying Kubernetes components...
        ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
    🌟  Enabled addons: storage-provisioner, default-storageclass
    🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

    So i'll add the --loging-format flag to start_flags.go and propagate it to all control plane components except for kubeadm via extra-config.

  26. twdamhore commented on Feb 18, 2026

    @twdamhore

    I made #22673
    Implicitly adding --extra-config to all of the components with minikube --logging-format

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.priority/backlogHigher priority than priority/awaiting-more-evidence.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions