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

feat: add container logs max size to the kubeone API #1644

Merged
merged 45 commits into from
Jan 28, 2022

Conversation

nerdeveloper
Copy link
Contributor

@nerdeveloper nerdeveloper commented Nov 23, 2021

What this PR does / why we need it:
This allow the user to set container logs maximum size on kubeone and defaults the container logs max size to 100Mi
Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1587

Special notes for your reviewer:

Does this PR introduce a user-facing change?:
YES

Ability to change container log maximum size. Currently defaults to 100Mi

@nerdeveloper nerdeveloper added this to the KubeOne 1.4 milestone Nov 23, 2021
@kubermatic-bot kubermatic-bot added dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 23, 2021
@nerdeveloper nerdeveloper self-assigned this Nov 23, 2021
@kron4eg
Copy link
Member

kron4eg commented Nov 23, 2021

/retest

pkg/state/context.go Outdated Show resolved Hide resolved
@nerdeveloper nerdeveloper changed the title feat: add flag for container logs max size feat: add container logs max size to the kubeone API Nov 24, 2021
@nerdeveloper
Copy link
Contributor Author

/retest

pkg/cmd/config.go Outdated Show resolved Hide resolved
pkg/apis/kubeone/v1beta1/types.go Outdated Show resolved Hide resolved
@kubermatic-bot kubermatic-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 25, 2021
@nerdeveloper
Copy link
Contributor Author

/retest

@@ -63,6 +63,14 @@ type KubeOneCluster struct {
AssetConfiguration AssetConfiguration `json:"assetConfiguration,omitempty"`
// RegistryConfiguration configures how Docker images are pulled from an image registry
RegistryConfiguration *RegistryConfiguration `json:"registryConfiguration,omitempty"`
// KubeletConfiguration configures the kubelet
KubeletConfiguration KubeletConfiguration `json:"kubeletConfiguration"`
Copy link
Member

Choose a reason for hiding this comment

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

please don't add this to v1beta1 API, only internal should be in place

Copy link
Contributor Author

@nerdeveloper nerdeveloper Nov 25, 2021

Choose a reason for hiding this comment

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

I removed it but for some weird reason when I try to run update-codegen. it fails. I will try again and show you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2021-11-25 at 16 23 39
this is the issue I have when I remove it from v1beta1 API.

Copy link
Member

Choose a reason for hiding this comment

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

Try adding the types to the v1beta2 API and then re-run codegen.

pkg/cmd/config.go Outdated Show resolved Hide resolved
@kubermatic-bot kubermatic-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 26, 2021
nerdeveloper and others added 2 commits January 25, 2022 23:03
Co-authored-by: Marko Mudrinić <mudrinic.mare@gmail.com>
@nerdeveloper nerdeveloper marked this pull request as draft January 26, 2022 11:30
@kubermatic-bot kubermatic-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 26, 2022
@nerdeveloper nerdeveloper marked this pull request as ready for review January 26, 2022 11:45
@kubermatic-bot kubermatic-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 26, 2022
pkg/apis/kubeone/config/config.go Show resolved Hide resolved
pkg/cmd/config.go Outdated Show resolved Hide resolved
pkg/containerruntime/docker_config.go Show resolved Hide resolved
nerdeveloper and others added 5 commits January 26, 2022 17:40
Copy link
Member

@xmudrii xmudrii left a comment

Choose a reason for hiding this comment

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

Some more comments, but we are getting closer and closer.

pkg/apis/kubeone/v1beta2/types.go Outdated Show resolved Hide resolved
pkg/apis/kubeone/config/config.go Outdated Show resolved Hide resolved
pkg/cmd/config.go Outdated Show resolved Hide resolved
pkg/containerruntime/docker_config_test.go Outdated Show resolved Hide resolved
@@ -88,7 +88,7 @@ cat <<EOF | sudo tee /etc/docker/daemon.json
"storage-driver": "overlay2",
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
"max-size": ""
Copy link
Member

Choose a reason for hiding this comment

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

Can you add the LoggingConfig to the function below?

func genCluster(opts ...genClusterOpts) kubeone.KubeOneCluster {
cls := &kubeone.KubeOneCluster{
Versions: kubeone.VersionConfig{
Kubernetes: "1.17.4",
},
SystemPackages: &kubeone.SystemPackages{
ConfigureRepositories: true,
},
Proxy: kubeone.ProxyConfig{
HTTP: "http://http.proxy",
HTTPS: "http://https.proxy",
NoProxy: ".local",
},
}
for _, fn := range opts {
fn(cls)
}
return *cls
}

nerdeveloper and others added 7 commits January 28, 2022 02:00
Co-authored-by: Marko Mudrinić <mudrinic.mare@gmail.com>
Co-authored-by: Marko Mudrinić <mudrinic.mare@gmail.com>
Co-authored-by: Marko Mudrinić <mudrinic.mare@gmail.com>
Co-authored-by: Marko Mudrinić <mudrinic.mare@gmail.com>
Signed-off-by: nerdeveloper <odirionye@gmail.com>
Signed-off-by: nerdeveloper <odirionye@gmail.com>
Signed-off-by: Artiom Diomin <kron82@gmail.com>
Copy link
Member

@kron4eg kron4eg left a comment

Choose a reason for hiding this comment

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

/approve

@kubermatic-bot kubermatic-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 28, 2022
@kubermatic-bot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 43a401d242195bb1d066a720d1fe5da997006e0b

@kubermatic-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kron4eg, nerdeveloper

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubermatic-bot kubermatic-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 28, 2022
@kubermatic-bot kubermatic-bot merged commit af7c971 into kubermatic:master Jan 28, 2022
@kubermatic-bot kubermatic-bot added this to the KubeOne 1.4 milestone Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Denotes that all commits in the pull request have the valid DCO signoff message. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow logging configuration for Kubelet
6 participants