-
Notifications
You must be signed in to change notification settings - Fork 131
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
Implemented Linear Controller and added unit test. #5
Conversation
this is net simpler, which is good. I forget why Girish wanted the ladder mode. Do we need to keep it? |
I don't think he gave out the reason. But I think it does not harm to keep it. |
Dead code is a liability - keeping it around means we support it and debug https://dougseven.com/2014/04/17/knightmare-a-devops-cautionary-tale/ On Wed, Oct 19, 2016 at 5:46 PM, Zihong Zheng notifications@github.com
|
Your concern totally makes sense, but I vote for keeping the
|
I would agree with keeping ladder as it is a way out for people to implement their own arbitrary scaling function |
OK. On Thu, Oct 20, 2016 at 3:24 PM, Bowei Du notifications@github.com wrote:
|
Max int `json:"max"` | ||
} | ||
|
||
func (c *LinearController) SyncConfig(configMap k8sclient.ConfigMap) error { |
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 seems to be duplicated from ladder controller. Can we move this to a common base struct or move the version change logic out.
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.
Moved out the version change logic.
} | ||
|
||
// parseParams Parse the params from JSON string | ||
func parseParams(data []byte) (params *linearParams, err error) { |
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.
you don't reference params
or err
, probably should leave them anonymous
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.
Fixed.
numResources int | ||
expReplicas int | ||
}{ | ||
{testController, 0, 2}, |
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.
Why is testController the same for all the testcases? can we remove this field from the struct?
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.
Removed.
} | ||
} | ||
|
||
func TestControllerScaler(t *testing.T) { |
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.
no testing of max between linear on nodes and linear on pods
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.
Added one more test.
582390b
to
f6e1447
Compare
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.
some doc nits
} | ||
``` | ||
|
||
The idea of linear control mode is simple: how many cores or nodes could be taking care by one replica? |
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 think you should put the equation and then give the example
replicas = max( cores * 1/coresPerReplica , nodes * 1/nodesPerReplica )
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.
Yeah, an equation will explain the idea more clearly. Added.
@@ -77,7 +77,7 @@ spec: | |||
app: autoscaler | |||
spec: | |||
containers: | |||
- image: gcr.io/google_containers/cluster-proportional-autoscaler-amd64:0.7.2 | |||
- image: gcr.io/google_containers/cluster-proportional-autoscaler-amd64:0.8.2 |
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.
why is the patch number still .2? I would think this will be 0.8.0
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.
Fixed.
app: autoscaler | ||
spec: | ||
containers: | ||
- image: gcr.io/google_containers/cluster-proportional-autoscaler-amd64:0.8.2 |
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.
fix it here as well
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.
Fixed.
f6e1447
to
7f3d5c0
Compare
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.
LGTM
Thanks! Self merging. |
coredns: Add customlabels to configmap
The autoscaler are now supporting one more control pattern:
linear mode
. An example for the ConfigMap params as below:Because serious performance evaluation of
kube-dns
might not be finished soon, I would like to use this simple pattern for the DNS horizontal scaling for now (will tune the specific params). Details for this new pattern are updated in README.@bowei @thockin @bprashanth
cc @matchstick