-
Notifications
You must be signed in to change notification settings - Fork 24
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
balloons: allow assigning containers to balloons by runtime-evaluated expressions. #260
balloons: allow assigning containers to balloons by runtime-evaluated expressions. #260
Conversation
02f490f
to
b940530
Compare
caec3d1
to
1703d85
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.
Great stuff! Just few comments.
1703d85
to
36aff44
Compare
36aff44
to
1f1a98f
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.
Spotted one typo in the doc. Otherwise LGTM.
And I'm ashamed of my previous key[0]
panic comment: the short-circuiting ||
took care of the problem. Brightness of the moment when thinking "here could be a potential problem" seems to be blinding.
30cd686
to
cccfe59
Compare
e7c6a2a
to
2e1bf8d
Compare
I got fooled by your comment for a moment, too. So there is not need to be... 🙈 |
2e1bf8d
to
78085b1
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.
0477c87
to
9e01c9e
Compare
Implement assigning containers to balloon instances by container match expression defined in balloon definitions. Match expressions are evaluated for containers which are not explicitly assigned to any balloon by an annotation, before namespace-based assignments. If an expression in a balloon definition matches a container, that container is assigned to a balloon instance of that definition. For instance, given this balloon definition among the configuration ... balloonTypes: - name: specialBalloon matchExpressions: - key: pod/labels/app.kubernetes.io/component operator: Equals values: [ "SpecialComponent" ] ... any container not explicitly annotated to some other balloon will get assigned to instances of specialBalloon, if the pod of the container has the label app.kubernetes.io/component=SpecialComponent Similarly, given this balloon definition among the configuration ... balloonTypes: - name: podBalloon matchExpressions: - key: pod/name operator: In values: [ "pod1", "pod2", "pod3" ] ... all containers of pods named pod1, pod2, and pod3 will be assigned to instances of podBalloon. Signed-off-by: Krisztian Litkey <[email protected]>
Implement custom validation for balloons. The custom validator validates all container match expressions found in any of the balloon definitions. Signed-off-by: Krisztian Litkey <[email protected]>
Signed-off-by: Krisztian Litkey <[email protected]>
Signed-off-by: Krisztian Litkey <[email protected]>
9e01c9e
to
3b9fbf9
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
LGTM 👍 |
Notes:
Implement assigning containers to balloon instances by container match expression defined in balloon definitions. Match expressions are evaluated for containers which are not explicitly assigned to any balloon by an annotation, before namespace-based assignments. If an expression in a balloon definition matches a container, that container is assigned to a balloon instance of that definition.
For instance, given this balloon definition among the configuration
any container not explicitly annotated to some other balloon will get assigned to instances of specialBalloon, if the pod of the container has the label
app.kubernetes.io/component=SpecialComponent
Similarly, given this balloon definition among the configuration
all containers of pods named pod1, pod2, and pod3 will be assigned to instances of podBalloon.