-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
adding kubernetes core rate limiter handlers #3472
adding kubernetes core rate limiter handlers #3472
Conversation
/approve |
8983524
to
adf3ae1
Compare
cmd/kops/status_discovery.go
Outdated
func (s *cloudDiscoveryStatusStore) GetApiIngressStatus(cluster *kops.Cluster) ([]kops.ApiIngressStatus, error) { | ||
glog.V(10).Infof("getting api ingress status") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have https://github.com/kubernetes/kops/blob/master/upup/pkg/fi/cloudup/awsup/request_logger.go, and kubernetes has https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/providers/aws/log_handler.go . Can we use those instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is debugging :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can remove
@@ -75,8 +75,12 @@ func findAutoscalingGroup(cloud awsup.AWSCloud, name string) (*autoscaling.Group | |||
} else { | |||
glog.Warningf("Got ASG with unexpected name %q", aws.StringValue(g.AutoScalingGroupName)) | |||
} | |||
|
|||
glog.V(10).Infof("paged asg: %s", aws.StringValue(g.AutoScalingGroupName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this? It's V(10), but still a load of information...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debugging ... I will cleanup
} | ||
|
||
glog.V(10).Infof("finished finding autoscaling groups") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd hope the normal logger would log these
cmd/kops/status_discovery.go
Outdated
@@ -33,7 +34,10 @@ type cloudDiscoveryStatusStore struct { | |||
|
|||
var _ kops.StatusStore = &cloudDiscoveryStatusStore{} | |||
|
|||
// TODO - is this dead code?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not
@@ -40,6 +42,7 @@ import ( | |||
"k8s.io/kops/upup/pkg/fi" | |||
"k8s.io/kubernetes/federation/pkg/dnsprovider" | |||
dnsproviderroute53 "k8s.io/kubernetes/federation/pkg/dnsprovider/providers/aws/route53" | |||
k8s_aws "k8s.io/kubernetes/pkg/cloudprovider/providers/aws" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just copy it in, not add another k/k dependency
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually on seconds thoughts it is such a beast it's probably better not to copy it until we have to...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM ... yes beast
Can we dial down the logging (even though it's V(10), it should be handled by the log handler)? Then looks good. |
Go vet is telling me that copying the mutex is bad. Any ideas? Can we not copy the pointer to aws cloud implantation? |
To work around the mutex copy - put the mutex & map into its own |
59393c6
to
4397e1d
Compare
@justinsb not sure how we want to test this :P We want to roll with it as is? Backed out logging. PTAL |
// TODO Should we improve LoggingRetryer instead of what k8s core is using? | ||
// TODO According to the aws api docs we will still be using the default retryer | ||
// TODO and then we will have the k8s handlers that are acting as global retriers. | ||
// TODO My thought is keep what we have and add the global handlers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Can we demote this from a TODO to an explanation of what we're doing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing, as it does not really make sense. I need to limit the paging, not worry about that
// We do this to protect the AWS account from becoming overloaded and effectively locked. | ||
// We also log when we hit request limits. | ||
// Note that this delays the current goroutine; this is bad behaviour and will | ||
// likely cause k8s to become slow or unresponsive for cloud operations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: s/k8s/kops
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
caught another from copy pasta programing
LGTM - can you demote the TODO to just an explanation of what we're doing. Please self-apply LGTM though! |
4397e1d
to
6dc953c
Compare
/lgtm per @justinsb |
@chrislovecnm: you cannot LGTM your own PR. In response to this:
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-bot please hold my water bottle |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chrislovecnm The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. |
This PR is re-using the handlers from the k8s core project, to create a global rate limiting.
This work starts work on #3471