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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make CPU Requests for Calico configurable instead of hard-coded #8987

Merged
merged 1 commit into from
Apr 26, 2020

Conversation

moshevayner
Copy link
Member

@moshevayner moshevayner commented Apr 26, 2020

Fixes #7930

As a side note on Canal- I've noticed that on the templates, the requests differed between k8s versions, where 1.12 had 100m configured, 1.15 had 250m and 1.16 had 90m. Looking at the history of the files, seems like originally there were all created with 250m, but updates to the 1.12 and 1.16 templates aligned them with the lower requests, while I assume 1.15 was simply overlooked by accident. So to make things simpler and more standardized for documentation - I took the liberty to set all of them to 100m which is what was intentionally set via this commit - ba76db7

I made sure to run make test and confirm everything is still passing.
Please let me know if anything seems off, or if anything further is needed.
Thanks! 馃槃

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 26, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @MoShitrit. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Apr 26, 2020
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. area/api labels Apr 26, 2020
@moshevayner moshevayner marked this pull request as draft April 26, 2020 06:27
@moshevayner
Copy link
Member Author

Trying to figure out why are the tests failing, marking as draft for now.

@hakman
Copy link
Member

hakman commented Apr 26, 2020

@MoShitrit Run make goimports and commit the result. This should fix the CI.
/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 26, 2020
@moshevayner
Copy link
Member Author

Hey @hakman,
Yeah I actually tried to run that locally but it doesn't seem to work.
It fails with an error:

cannot find module providing package golang.org/x/tools/cmd/goimports: working directory is not part of a module

In case it matters, here's the output of go version:

go version go1.14.2 darwin/amd64

Copy link
Member

@hakman hakman left a comment

Choose a reason for hiding this comment

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

This looks great. Thanks!
One change though, let's make all of these default to "100m", to avoid more questions later.

upup/models/bindata.go Outdated Show resolved Hide resolved
upup/models/bindata.go Outdated Show resolved Hide resolved
pkg/apis/kops/v1alpha2/networking.go Outdated Show resolved Hide resolved
pkg/apis/kops/v1alpha2/networking.go Outdated Show resolved Hide resolved
pkg/apis/kops/networking.go Outdated Show resolved Hide resolved
pkg/apis/kops/networking.go Outdated Show resolved Hide resolved
@hakman
Copy link
Member

hakman commented Apr 26, 2020

@MoShitrit any chance you need to set GOPATH?
https://github.com/kubernetes/kops/blob/master/docs/development/building.md

@moshevayner
Copy link
Member Author

@hakman I followed that doc yesterday when I started working on it, actually.
Here's how I'm set up:

mosheshitrit:kops mosheshitrit$ echo $GOPATH
/Users/mosheshitrit/kops
mosheshitrit:kops mosheshitrit$ pwd
/Users/mosheshitrit/kops/src/k8s.io/kops

And fwiw, here's the output of go env:

mosheshitrit:kops mosheshitrit$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/mosheshitrit/Library/Caches/go-build"
GOENV="/Users/mosheshitrit/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/mosheshitrit/kops"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/Cellar/go/1.14.2_1/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.14.2_1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/mosheshitrit/kops/src/k8s.io/kops/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/8d/3cmg2l2j2gl3qpwjv6c3ffrc0000gn/T/go-build753647993=/tmp/go-build -gno-record-gcc-switches -fno-common"

@k8s-ci-robot k8s-ci-robot added the do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. label Apr 26, 2020
@moshevayner
Copy link
Member Author

moshevayner commented Apr 26, 2020

@hakman Okay, I figured it out. Looks like the problem was with my local go version. I missed the last comment in the troubleshooting section of the building instructions, saying that kops supports versions 1.12 or 1.13 (I had 1.14 installed). After downgrading my go version to 1.13, the make goimports command ran successfully! 馃槃
Thanks for pointing me in the right direction!

@hakman
Copy link
Member

hakman commented Apr 26, 2020

Happy it all worked out. Check this also and fix the commit message that triggers it.
#8987 (comment)

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 26, 2020
@moshevayner moshevayner marked this pull request as ready for review April 26, 2020 09:09
@moshevayner
Copy link
Member Author

Happy it all worked out. Check this also and fix the commit message that triggers it.
#8987 (comment)

@hakman fixed! The tests are running now, but I ran make test locally and made sure everything is passing so I expect to see the same result here.
Marked the PR as Ready for Review again.
Please let me know if you see anything else out of order.
Thanks again for all your help!!

pkg/apis/kops/networking.go Outdated Show resolved Hide resolved
pkg/apis/kops/v1alpha2/networking.go Outdated Show resolved Hide resolved
@hakman
Copy link
Member

hakman commented Apr 26, 2020

Thanks @MoShitrit. Looks like it works nicely now.
Please address the small nits I just added and squash the commits when all tests pass. I think one commit would be better for this small change.

@hakman
Copy link
Member

hakman commented Apr 26, 2020

Also, please change the title to Make CPU Requests for Calico configurable instead of hard-coded

It should be enough to link the issue like this:
https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue

Fixes #7930 (may need to be in the description)

@moshevayner moshevayner changed the title Fix issue #7930 - make CPU Requests for Calico configurable instead of hard-coded Make CPU Requests for Calico configurable instead of hard-coded Apr 26, 2020
Update bindata.go

Apply suggestions from code review

Applying suggested changes.

Co-Authored-By: Ciprian Hacman <ciprianhacman@gmail.com>

Applying changes after running `make gofmt`

Applying changes after running `make crds`

Apply suggestions from code review

Applying suggested changes.

Co-Authored-By: Ciprian Hacman <ciprianhacman@gmail.com>

Applying changes after running `make gofmt`

Fixing broken things

Typo fixes

Apply suggestions from code review

Co-Authored-By: Ciprian Hacman <ciprianhacman@gmail.com>

Apply suggested changes and run necessary `make` steps
@rifelpet
Copy link
Member

Looks great, thanks!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 26, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: MoShitrit, rifelpet

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 26, 2020
@k8s-ci-robot k8s-ci-robot merged commit 5738ffa into kubernetes:master Apr 26, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Apr 26, 2020
@moshevayner moshevayner deleted the fix-issue-7930 branch April 26, 2020 20:31
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. area/api cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calico cpu request is insufficient on a heavily utilized node causing crashback loop
4 participants