-
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
Add per-service scheduling config support #46
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
afe96aa
to
134a526
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.
Very nice!
nodeSelector: | ||
{{- if $serviceNodeSelector }} | ||
{{- $serviceNodeSelector | toYaml | trim | nindent 2 }} | ||
{{- else if $globalNodeSelector }} |
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 was on the fence about whether this "if service, else if global" pattern was the right choice. It could mean a lot of duplication if there's a globally shared setting + service-specific settings. But I can't think of a nice way to support both situations (have the option to include global or exclude global, in addition to service-specific).
This scenario is pretty similar to the problem faced with the image tags, and I'm not very happy about the solution for that.
Your approach here means it is possible to get the right outcome for each service, and that's what's most important!
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 was on the fence about whether this "if service, else if global" pattern was the right choice. It could mean a lot of duplication if there's a globally shared setting + service-specific settings. But I can't think of a nice way to support both situations (have the option to include global or exclude global, in addition to service-specific).
This scenario is pretty similar to the problem faced with the image tags, and I'm not very happy about the solution for that.
Your approach here means it is possible to get the right outcome for each service, and that's what's most important!
Are you talking about something like
global:
nodeSelector:
zone: zone-1
frontend:
nodeSelector:
zone: zone-1
node-purpose: generic
the users have to duplicate zone: zone-1
in the per-service override, but we want to avoid the duplicatoin
Maybe we can merge global and per-service nodeSelector? so users can just do
global:
nodeSelector:
zone: zone-1
frontend:
nodeSelector:
node-purpose: generic
The rendered frontend-deployment
would have both zone=zone-1
and node-purpose: generic
in the nodeSelector
?
This could potentially be put behind a flag, such as global.mergeNodeSelector=true
? Or we can introduce a new value like global.sharedNodeSelector
, then merge it with the per-service selector.
tbh, I am not sure if this is a good idea. It's possible users accidentally enable this flag and keep scratching their head wondering what's going on.
Another approach is educating user about alias and anchor in yaml, they can technically avoid the duplication by doing
commonNodeSelectorLabels: &commonNodeSelectorLabels
zone: zone-1
global:
nodeSelector: *commonNodeSelectorLabels
frontend:
nodeSelector:
<<: *commonNodeSelectorLabels
node-purpose: generic
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.
educating user about alias and anchor in yaml
Great point! I always forget about that feature (every time I wanted to use it, there were reasons it didn't work out). That's much better than trying to build in any fancy functionality.
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.
educating user about alias and anchor in yaml
Great point! I always forget about that feature (every time I wanted to use it, there were reasons it didn't work out). That's much better than trying to build in any fancy functionality.
LOL, I am never a fan of alias and anchor anyway. Also, the fact you can't merge sequences/list/array with it also feels off to me.
This would be a great candidate for docs improvement! sourcegraph/sourcegraph#31821
This PR introduces three partial templates for
tolerations
,affinity
, andnodeSelector
.Usage
Most changes are just copying & pasting, but please help me double-check!
TODO
not blocking
values.yaml
values.yaml
? Related -> Autogen doc for helm charts sourcegraph#31016Test plan
override.yaml
Inspect the output
helm template -n sourcegraph -f override.yaml sourcegraph charts/sourcegraph/. > bundle.yaml