Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Align to Kubernetes structured logging #3051

Closed
9 tasks done
stefanprodan opened this issue Aug 30, 2022 · 0 comments
Closed
9 tasks done

Align to Kubernetes structured logging #3051

stefanprodan opened this issue Aug 30, 2022 · 0 comments
Assignees
Labels
umbrella-issue Umbrella issue for tracking progress of a larger effort

Comments

@stefanprodan
Copy link
Member

stefanprodan commented Aug 30, 2022

We've been delaying the upgrade to controller-runtime v0.12 due to the changes to structured logging. I think it's time to align the Flux controllers logs with Kubernetes, even if the new logging format is more verbose.

Current format (flux2 v0.33.0):

{
  "level": "info",
  "ts": "2022-08-23T09:35:20.723+0300",
  "msg": "no changes since last reconciliation",
  "logger": "controller.gitrepository",
  "reconciler group": "source.toolkit.fluxcd.io",
  "reconciler kind": "GitRepository",
  "namespace": "default",
  "name": "podinfo"
}

New format:

{
  "level": "info",
  "ts": "2022-08-23T09:35:20.723+0300",
  "msg": "no changes since last reconciliation",
  "controller": "gitrepository",
  "controllerGroup": "source.toolkit.fluxcd.io",
  "controllerKind": "GitRepository",
  "gitRepository": {
    "name": "podinfo",
    "namespace": "default"
  },
  "namespace": "default",
  "name": "podinfo",
  "reconcileID": "aef58d3d-c155-4d45-a4b0-af35cce3f978"
}

Breaking changes

These fields have been renamed:

  • logger -> controller
  • reconciler group -> controllerGroup
  • reconciler kind -> controllerKind

🗒️ Projects

Prerequisites

  • fluxcd/pkg: update all packages to controller-runtime v0.12
  • fluxcd/pkg/runtime: release new Flux runtime package based on controller-runtime v0.12

Controllers

Update fluxcd/pkg/runtime and remove our custom reconcileID in favour of the upstream one.

  • fluxcd/notification-controller (depends on prerequisites)
  • fluxcd/image-reflector-controller (depends on prerequisites)
  • fluxcd/source-controller (depends on prerequisites)
  • fluxcd/kustomize-controller (depends on fluxcd/source-controller)
  • fluxcd/helm-controller (depends on fluxcd/source-controller)
  • fluxcd/image-automation-controller (depends on fluxcd/source-controller and fluxcd/image-reflector-controller)

CLI

  • fluxcd/flux2: adapt flux logs to the new format in a backwards compatible manner ( support both reconciler kind and controllerKind)
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
umbrella-issue Umbrella issue for tracking progress of a larger effort
Projects
None yet
Development

No branches or pull requests

2 participants