-
Notifications
You must be signed in to change notification settings - Fork 979
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 NodeAffinity #695
Conversation
✔️ Deploy Preview for karpenter-docs-prod canceled. 🔨 Explore the source changes: 05cb0d2 🔍 Inspect the deploy log: https://app.netlify.com/sites/karpenter-docs-prod/deploys/614e1785f26f4200084eab85 |
e398cb4
to
02d3fdf
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.
Looking good so far... reviewed about 17/29 so far
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.
Looks good o'erall. A few minor comments.
} | ||
if slices[0] == nil { | ||
return IntersectStringSlice(slices[1:]...) | ||
} |
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 not also check here for slices[0]
to be an empty slice, and then just short-circuit everything else and return an empty slice, since it's like multiplying by zero?
02d3fdf
to
ed7ff93
Compare
28ab8de
to
ca8ffd9
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.
Looking good, I'm a little over half way through reviewing. But will have to look at the rest a bit later.
// either unconstrained (nil), or a valid WellKnownLabel. Provisioner | ||
// defaulting logic will currently default to [on-demand] if unspecifed. | ||
capacityType := v1alpha1.CapacityTypeSpot | ||
if capacityTypes != nil && !functional.ContainsString(capacityTypes, v1alpha1.CapacityTypeSpot) { |
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.
interesting, I guess the ICE Cache could key on capacity-type too in order to support a native fallback to OD if we can't get spot capacity?
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 totally.
ca8ffd9
to
81e210a
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.
A few small comments, but looks great!
if pod.Spec.Affinity.PodAffinity != nil { | ||
errs = multierr.Append(errs, fmt.Errorf("pod affinity is not supported")) | ||
} | ||
if pod.Spec.Affinity.PodAntiAffinity != nil { |
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 to fail hard like this? Systems like kops will deploy default components like coredns with PodAntiAffinity, so this effectively makes them a lot more difficult to get working. I can see the other side of it where you don't want users relying on PodAntiAffinity if it will not work too and don't want them to have notice a log message necessarily. I'm not sure what the right thing to do here is, wdut?
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.
Until we respect the constraints, we basically have to not schedule the pods. I can imagine eventually trying to implement pod affinity, but minimally it will be incremental effort over this. FWIW, the current behavior is to not provision if constraints are not supported.
81e210a
to
ce2d7cd
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
05cb0d2
ce2d7cd
to
05cb0d2
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
1. Issue, if available:
#482
2. Description of changes:
3. Does this change impact docs?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.