This issue is meant to help track the overall work done to add ComponentConfig types into controller-runtime and kubebuilder.
This continues the original #518 to track all of the necessary steps.
ComponentConfig proposal*rest.Config using configv1alpha1.ClientConnectionConfiguration - https://github.com/kubernetes/component-base/blob/master/config/v1alpha1/types.go#L69kubebuilder implementationv1beta1 and api conversion and internal type to replace Options{}This list will be updated with issues as they progress toward GA API graduation (or removal).
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale
/lifecycle frozen
/milestone v0.7.x
@christopherhein Let me know if this should fall into 0.7, or we can wait for later as well
/priority important-longterm
What is the v0.7 timeframe?
I'm working on updating the PR this week and will likely have something Friday or early next week… at least for #891
1-2 months, probably, it all depends when 1.19 is release and when the current planned breaking changes will merge
Perfect, let's aim for that milestone since as we've discussed this will also have breaking changes. Thanks!
@vincepri I think we need to remove this tracking issue from the v0.7 milestone. For now, we should just have #891 give this is tracking the entire feature through alpha -> beta -> ga we'll want the api to bake a bit.
@DirectXMan12 @vincepri looking into at the next phases of this…
I'd originally documented moving to use configv1alpha1.ClientConnectionConfiguration - https://github.com/kubernetes/component-base/blob/master/config/v1alpha1/types.go#L69 as a standard type that we could configure rest.Config with. Looking into how this is implemented in manager.New() it takes in the *rest.Config, Options{} as parameters meaning if we included the fields from configv1alpha1.ClientConnectionConfiguration and supported nil values for rest.Config without erroring (https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/manager/manager.go#L306-L308) we could configure the *rest.Config with the values from the file as long as those same fields were defined on the Options struct…
For reference:
type ClientConnectionConfiguration struct {
// kubeconfig is the path to a KubeConfig file.
Kubeconfig string `json:"kubeconfig"`
// acceptContentTypes defines the Accept header sent by clients when connecting to a server, overriding the
// default value of 'application/json'. This field will control all connections to the server used by a particular
// client.
AcceptContentTypes string `json:"acceptContentTypes"`
// contentType is the content type used when sending data to the server from this client.
ContentType string `json:"contentType"`
// qps controls the number of queries per second allowed for this connection.
QPS float32 `json:"qps"`
// burst allows extra queries to accumulate when a client is exceeding its rate.
Burst int32 `json:"burst"`
}
The ux would end up being something like:
mgr, err := ctrl.NewManager(nil, ctrl.Options{Scheme: scheme}.AndFromOrDie(cfg.File()))
// handle error
Expecting that Options an/or the ComponentConfig type set the same defaults we have defined in https://github.com/kubernetes-sigs/controller-runtime/blob/master/pkg/client/config/config.go#L85-L88
What do you think? Do you think this is/would be useful?