-
Notifications
You must be signed in to change notification settings - Fork 3
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
Implement nodeSelector + taint support #40
base: main
Are you sure you want to change the base?
Implement nodeSelector + taint support #40
Conversation
} | ||
|
||
// RunnerConfig defines the configuration of runner image | ||
type RunnerConfig struct { |
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 think it a long time, that this should be the way to go; moving all configuration for runners in a separate struct. But I think it should be introduced as a new api version for this Kind (e.g v1alpha2) and provide a convertor from v1alpha1 to v1alpha2; otherwise it breaks backwards compatibility and existing SleepCycles from previous versions. If you try to run it on a cluster where existing SleepCycles exist, it will break:
A small example here: https://suedbroecker.net/2022/03/24/add-a-new-api-version-to-an-existing-operator/ (although the way it describes the changes that need to take place on the controller are a bit debatable and need more thorough analysis)
P.S: the project is not yet upgraded to kubebuilder v4 (still on v3; issue #29 which I am actively working on), so if the latest version of kubebuilder is installed on the development environment any attempt to add a new api will fail.
@@ -63,9 +66,122 @@ type SleepCycleSpec struct { | |||
// +kubebuilder:validation:ExclusiveMaximum=false | |||
FailedJobsHistoryLimit int32 `json:"failedJobsHistoryLimit,omitempty"` | |||
|
|||
Runner RunnerConfig `json:"runner,omitempty"` |
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 *RunnerConfig?
return &v1.ResourceRequirements{ | ||
Limits: v1.ResourceList{ | ||
"cpu": resource.MustParse("10m"), | ||
"memory": resource.MustParse("128mb"), |
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.
That is not parsing, lines 132 and 136 need to change to 128Mi
Implements #34
ResourceRequirements
Tolerations
NodeSelector
PodMetadata
PriorityClassName
runAsUser