-
Notifications
You must be signed in to change notification settings - Fork 733
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
Config API for Kubeflow Trainer controller manager #2428
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,50 @@ | ||||||
// Copyright 2024 The Kubeflow Authors | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we have dedicate directory for Config APIs and place it in |
||||||
// | ||||||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||||||
// you may not use this file except in compliance with the License. | ||||||
// You may obtain a copy of the License at | ||||||
// | ||||||
// http://www.apache.org/licenses/LICENSE-2.0 | ||||||
// | ||||||
// Unless required by applicable law or agreed to in writing, software | ||||||
// distributed under the License is distributed on an "AS IS" BASIS, | ||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||||
// See the License for the specific language governing permissions and | ||||||
// limitations under the License. | ||||||
|
||||||
// +k8s:defaulter-gen=TypeMeta | ||||||
// +k8s:openapi-gen=true | ||||||
// +k8s:deepcopy-gen=package | ||||||
|
||||||
// Package v2alpha1 is the v2alpha1 version of the API. | ||||||
// +groupName=trainer.kubeflow.org | ||||||
|
||||||
package v1alpha1 | ||||||
|
||||||
import ( | ||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||||||
) | ||||||
|
||||||
// TrainerControllerConfig represents the configuration for the training operator. | ||||||
type TrainerControllerConfig struct { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's call it type Configuration struct
Suggested change
|
||||||
metav1.TypeMeta `json:",inline"` | ||||||
|
||||||
ControllerManager *ControllerManager `json:"controllerManager,omitempty"` | ||||||
CertGeneration *CertGeneration `json:"certGeneration,omitempty"` | ||||||
} | ||||||
Comment on lines
+31
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You might need to fix Go formatting here. |
||||||
|
||||||
// ControllerManager holds configuration related to the controller manager. | ||||||
type ControllerManager struct { | ||||||
MetricsBindAddress string `json:"metricsBindAddress,omitempty"` | ||||||
HealthProbeBindAddress string `json:"healthProbeBindAddress,omitempty"` | ||||||
LeaderElect bool `json:"leaderElect,omitempty"` | ||||||
MetricsSecure bool `json:"metricsSecure,omitempty"` | ||||||
EnableHTTP2 bool `json:"enableHttp2,omitempty"` | ||||||
} | ||||||
Comment on lines
+37
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We might want to split these values, similar to Kueue: https://github.com/kubernetes-sigs/kueue/blob/main/apis/config/v1beta1/configuration_types.go#L110-L125. |
||||||
|
||||||
// CertGeneration holds configuration related to webhook server certificate generation. | ||||||
type CertGeneration struct { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we also have flag to enable/disable Cert Generator ? |
||||||
WebhookServerPort int `json:"webhookServerPort,omitempty"` | ||||||
WebhookServiceName string `json:"webhookServiceName,omitempty"` | ||||||
WebhookSecretName string `json:"webhookSecretName,omitempty"` | ||||||
Comment on lines
+47
to
+49
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We might need to explain what does each value mean and add the Defaults values: |
||||||
} |
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, you should read this config from the file, similar to this: https://github.com/kubernetes-sigs/jobset/blob/main/main.go#L84C18-L87
We might also want to have the default config which enables the internal Cert Generator:
https://github.com/kubernetes-sigs/jobset/blob/main/config/components/manager/controller_manager_config.yaml#L2-L3