Skip to content
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

[vc/nodepool subcmd] support --affinity for add operation #29

Closed
Tracked by #4
fuweid opened this issue Jan 9, 2024 · 0 comments · Fixed by #75
Closed
Tracked by #4

[vc/nodepool subcmd] support --affinity for add operation #29

fuweid opened this issue Jan 9, 2024 · 0 comments · Fixed by #75
Assignees
Milestone

Comments

@fuweid
Copy link
Collaborator

fuweid commented Jan 9, 2024

Background

Currently. nodepool is managed by kwok controller which is running as pod.
kperf runner sub-command might use more network resource, which could impact kwok-controller in that same node.
Ideally, we can deploy kwok-controller into dedicated nodes which have specific labels and only are used for kwok-controllers.

Plan

This feature depends on [helmcli] support YAMLValuesApplier helper function feature.

Add --affinity flag in add sub-command. This flag is string slice type. https://pkg.go.dev/github.com/urfave/cli#StringSliceFlag

Each input's format is key=value1,value2,value3,.... The value is array using , as seperator.
Based on #17, the virtualcluster/nodes helm chart is using controllerNodeSelector map value to render node affinity.

{{- if .Values.controllerNodeSelectors }}
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
{{- range $key, $values := .Values.controllerNodeSelectors }}
- key: "{{ $key }}"
operator: In
values:
{{- range $values }}
- {{ . }}
{{- end }}
{{- end }}
{{- end }}

The add sub-command should construct inputs into the following YAML value and use YAMLValuesApplier to render:

controllerNodeSelector:
  key1:
     - value1
     - value2
     - value3
  key2:
     - value1
     - value2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant