-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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
[scheduling] Moved pod affinity and anti-affinity from annotations to api fields #25319 #39478
[scheduling] Moved pod affinity and anti-affinity from annotations to api fields #25319 #39478
Conversation
4b6844a
to
f48d135
Compare
f48d135
to
60bcadb
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.
We should really try to eliminate the forced additions.
}] | ||
}, | ||
Spec: api.PodSpec{ | ||
Containers: []api.Container{{Name: "ctr", Image: "image", ImagePullPolicy: "IfNotPresent"}}, |
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.
So I'm guessing this section is a copy<>paste of validPodSpec? b/c it's repeated.
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. Created a function to get around the copying of validPodSpec
}, | ||
}, | ||
Namespaces: []string{"ns"}, | ||
TopologyKey: "", |
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.
Does this need to be here if unused?
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.
Original test has an empty value for topologyKey. I would think it shouldn't matter if it is there and empty vs not there at all. I will test and if there's no difference just remove it
}, | ||
}, | ||
Namespaces: []string{"ns"}, | ||
TopologyKey: "", |
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.
same comment re: empty string
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.
What empty string?
}, | ||
}, | ||
Namespaces: []string{"ns"}, | ||
TopologyKey: "", |
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.
same comment re: empty strings.
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.
Same reply. Original had it so I kept it. I will test with it removed and if same results will push update with it removed
@@ -37,12 +37,15 @@ func TestBalancedResourceAllocation(t *testing.T) { | |||
} | |||
machine1Spec := v1.PodSpec{ | |||
NodeName: "machine1", | |||
Affinity: &v1.Affinity{}, |
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 this not omit_if_empty? It seems like we're filling in blanks in a lot of locations.
We don't do that with other fields.
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 omit_empty. Issue is in the scheduler and has been addressed.
be81fc6
to
6e49aba
Compare
@k8s-bot bazel test this |
@k8s-bot unit test this |
1 similar comment
@k8s-bot unit test this |
}, | ||
/* |
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.
What's with the comment blob?
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.
missed cleanup. Removed
}, | ||
}, | ||
}, | ||
/* |
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.
same
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.
missed cleanup. Removed
}, | ||
}, | ||
ObjectMeta: v1.ObjectMeta{Labels: podLabel}, | ||
/* |
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.
same.
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.
Missed cleanup. Removed
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.
still there and in a couple of other places.
@rrati only comments now are to remove the commented legacy blobs and get the tests fixed, then lgtm. thx for the cleanup work, it looks a lot cleaner! |
6e49aba
to
5b3f019
Compare
5b3f019
to
d20daf7
Compare
4cc39c6
to
089e057
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.
2 main themes..
- Still more comment blocks.
- Empty namespace args.
}, | ||
}, | ||
}, | ||
Namespaces: []string{""}, |
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.
Similar comment around name-spacing. Why do we need to provide it if it's empty? nil = default namespace right.
}] | ||
}}`, | ||
TopologyKey: metav1.LabelHostname, | ||
Namespaces: []string{""}, |
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.
same comment
}, | ||
}, | ||
}, | ||
Namespaces: []string{}, |
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.
same comment.
"preferredDuringSchedulingIgnoredDuringExecution": [ | ||
{ | ||
"weight": 8, | ||
/* |
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.
remove comment block
}, | ||
}, | ||
} | ||
/* |
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.
remove comment block
}, | ||
}, | ||
}, | ||
/* |
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.
remove comment block.
}, | ||
}, | ||
}, | ||
/* |
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.
remove comment block.
}, | ||
}, | ||
}, | ||
/* |
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.
same.
}, | ||
}, | ||
}, | ||
/* |
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.
same.
"operator": "In", | ||
"values":["S2"] | ||
}, | ||
/* |
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.
same.
089e057
to
974ac92
Compare
Jenkins Bazel Build failed for commit 974ac92dfb3f6fe273644772d6dab60b9feed267. Full PR test history. The magic incantation to run this job again is 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. I understand the commands that are listed here. |
@k8s-bot bazel test this |
needs rebase and re-test run (likely from me) :-/ /lgtm |
974ac92
to
6a3ad93
Compare
Automatic merge from submit-queue (batch tested with PRs 39803, 39698, 39537, 39478) |
Converted pod affinity and anti-affinity from annotations to api fields
Related: #25319
Related: #34508
Release note:
Pod affinity and anti-affinity has moved from annotations to api fields in the pod spec. Pod affinity or anti-affinity that is defined in the annotations will be ignored.