Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Implement Loki curator #85

Merged
merged 1 commit into from
Feb 9, 2021
Merged

Conversation

Kristian-ZH
Copy link
Contributor

@Kristian-ZH Kristian-ZH commented Jan 25, 2021

How to categorize this PR?

/kind enhancement
/area logging
/priority normal

What this PR does / why we need it:
Add new Loki curator which will ensure that Loki's inodes and Storage limits are not reached.
The curator is entirely configured from a configuration file whose path is provided via curator's config flag.

Which issue(s) this PR fixes:
#72

Special notes for your reviewer:
@vlvasilev

Release note:

Loki curator will ensure that Loki's Inods and Storage limits are not reached

@gardener-robot gardener-robot added area/logging Logging related kind/enhancement Enhancement, improvement, extension priority/normal needs/review Needs review size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py) needs/second-opinion Needs second review by someone else labels Jan 25, 2021
@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 25, 2021
@gardener-robot-ci-1 gardener-robot-ci-1 added needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jan 25, 2021
Copy link
Member

@vpnachev vpnachev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some comments as first round of reviews.

Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
cmd/loki-curator/app/loki_curator.go Outdated Show resolved Hide resolved
cmd/loki-curator/app/loki_curator.go Outdated Show resolved Hide resolved
pkg/loki-curator/config/config.go Outdated Show resolved Hide resolved
pkg/loki-curator/config/config.go Outdated Show resolved Hide resolved
pkg/loki-curator/config/config_test.go Outdated Show resolved Hide resolved
pkg/loki-curator/disk-curator.go Outdated Show resolved Hide resolved
pkg/loki-curator/disk-curator.go Outdated Show resolved Hide resolved
@Kristian-ZH
Copy link
Contributor Author

Thanks for the comments, will address them today

@gardener-robot-ci-1 gardener-robot-ci-1 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 28, 2021
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 28, 2021
Dockerfile Outdated Show resolved Hide resolved
VERSION Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
cmd/loki-curator/main.go Outdated Show resolved Hide resolved
@gardener-robot gardener-robot added the needs/changes Needs (more) changes label Jan 28, 2021
Copy link
Member

@vpnachev vpnachev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not push build artifacts to the repository, I mean the file build/curator

pkg/loki-curator/config/config.go Outdated Show resolved Hide resolved
pkg/loki-curator/disk-curator.go Outdated Show resolved Hide resolved
pkg/loki-curator/curator.go Outdated Show resolved Hide resolved
pkg/loki-curator/inode-curator.go Outdated Show resolved Hide resolved
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 29, 2021
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 29, 2021
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 29, 2021
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jan 29, 2021
Copy link
Member

@vpnachev vpnachev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor nits.

Makefile Outdated Show resolved Hide resolved
pkg/loki/curator/config/config.go Outdated Show resolved Hide resolved
pkg/loki/curator/config/config_suite_test.go Outdated Show resolved Hide resolved
pkg/loki/curator/config/config.go Outdated Show resolved Hide resolved
pkg/loki/curator/curator.go Outdated Show resolved Hide resolved
pkg/loki/curator/disk.go Outdated Show resolved Hide resolved
pkg/loki/curator/utils/utils.go Outdated Show resolved Hide resolved
pkg/loki/curator/utils/utils.go Outdated Show resolved Hide resolved
pkg/loki/curator/utils/utils_suite_test.go Outdated Show resolved Hide resolved
pkg/loki/curator/utils/utils_test.go Outdated Show resolved Hide resolved
Copy link
Member

@vpnachev vpnachev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, update also the .gitignore file together with this PR and remove the binary build/curator.
You can see good examples how to do it gardener-attic/gardenctl#488 and gardener-attic/gardenctl#491.

@Kristian-ZH
Copy link
Contributor Author

/ping @vpnachev

@gardener-robot
Copy link

@vpnachev

Message

/ping @vpnachev

.gitignore Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
cmd/loki-curator/app/loki_curator.go Outdated Show resolved Hide resolved
cmd/loki-curator/app/loki_curator.go Outdated Show resolved Hide resolved
cmd/loki-curator/main.go Outdated Show resolved Hide resolved
cmd/loki-curator/main.go Outdated Show resolved Hide resolved
Comment on lines +37 to +39
MinFreePercentages int `yaml:"MinFreePercentages,omitempty"`
TargetFreePercentages int `yaml:"TargetFreePercentages,omitempty"`
PageSizeForDeletionPercentages int `yaml:"PageSizeForDeletionPercentages,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, how is omitempty working with int?
It is better to use *int which allow to properly differ between unset value nil and zero value 0.

On the other side, I see these values are required, thus you can make them mandatory and keep them as int.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

omitempty for int will check if the given field is not in its default state (e.g. 0 for int).

pkg/loki/curator/config/config.go Outdated Show resolved Hide resolved
pkg/loki/curator/config/config.go Outdated Show resolved Hide resolved
pkg/loki/curator/disk.go Outdated Show resolved Hide resolved
@vpnachev
Copy link
Member

vpnachev commented Feb 8, 2021

/author-action

@gardener-robot gardener-robot added the status/author-action Issue requires issue author action label Feb 8, 2021
@gardener-robot
Copy link

@Kristian-ZH The pull request was assigned to you under author-action. Please unassign yourself when you are done. Thank you.

@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Feb 9, 2021
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Feb 9, 2021
@Kristian-ZH Kristian-ZH removed the status/author-action Issue requires issue author action label Feb 9, 2021
Copy link
Member

@vpnachev vpnachev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/changes Needs (more) changes needs/review Needs review needs/second-opinion Needs second review by someone else labels Feb 9, 2021
@gardener-robot gardener-robot added needs/second-opinion Needs second review by someone else and removed reviewed/lgtm Has approval for merging labels Feb 9, 2021
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Feb 9, 2021
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Feb 9, 2021
Copy link
Collaborator

@vlvasilev vlvasilev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@gardener-robot gardener-robot added reviewed/lgtm Has approval for merging and removed needs/second-opinion Needs second review by someone else labels Feb 9, 2021
@Kristian-ZH Kristian-ZH merged commit fa26d3d into gardener:master Feb 9, 2021
@@ -1,13 +1,23 @@
############# builder #############
FROM golang:1.14.2 AS builder
FROM golang:1.15.7 AS builder
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is some other places where golang image is also used, e.g.

image: 'golang:1.14.2'

@gardener-robot gardener-robot added priority/3 Priority (lower number equals higher priority) and removed priority/3 Priority (lower number equals higher priority) labels Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/logging Logging related kind/enhancement Enhancement, improvement, extension needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) reviewed/lgtm Has approval for merging size/xl Size of pull request is huge (see gardener-robot robot/bots/size.py)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants