-
Notifications
You must be signed in to change notification settings - Fork 120
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 ability to enable Kubernetes feature gates and runtimeconfig in KubeVirt CI #1345
base: main
Are you sure you want to change the base?
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Thank you @Barakmor1! Looks awesome!
I think this PR is really important as it will help us test alpha/beta features a lot of time in advance which is a huge advantage in terms of development.
This is a relatively shallow review as I'm not an expert in this area.
p.s. If in the future we'll also be able to support #1264, combining these two capabilities could be absolutely great!
This PR makes sense to me. It's just surprising and unfortunate that we need that much code just to add a couple feature gates to k8s. |
@Barakmor1 Maybe there's a way to reduce code and make things a bit cleaner. apiVersion: kubelet.config.k8s.io/v1beta1
kind: KubeletConfiguration
featureGates:
- NodeSwap WDYT? [1] https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/#kubelet-conf-d |
this allow enabling\disabling feature gates by setting the `K8S_FEATURE_GATES` environment variable before running `make cluster-up`. For example: export K8S_FEATURE_GATES="FeatureGate1=true,FeatureGate2-true" You can also set runtime configuration by setting the `K8S_API_RUNTIME_CONFIG` environment variable before running `make cluster-up`. For example: export K8S_API_RUNTIME_CONFIG="RuntimeConfig=true" This will update the configuration of the kube-controller, kube-apiserver, and kubelet to include the flags. These components will restart, and this logic will wait until they are ready again. No featureGate or runtimeConfig are enabled by default Signed-off-by: bmordeha <bmordeha@redhat.com>
@iholder101 @victortoso Please have another look |
Hey, unfortunately, I couldn’t find an easy way to update Kubernetes components with feature gates and flags after the cluster is already deployed. Most of the work in the PR is about changing the configurations of the kube-apiserver, kube-controller, kube-scheduler, and kubelet, and then making sure these changes are applied correctly. The final step is to ensure the components are ready again before moving on with other kubevirt CI tasks. Using the drop-in would only change how the kubelet configuration is updated, but we’d still need to restart kubelet and verify that kubelet is ready. So, I don’t think this would simplify the code. |
Signed-off-by: bmordeha <bmordeha@redhat.com>
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.
Using the drop-in would only change how the kubelet configuration is updated, but we’d still need to restart kubelet and verify that kubelet is ready. So, I don’t think this would simplify the code.
Right, so the kubevirtci image is already created when we do something like K8S_FEATURE_GATES=DRA make cluster-up
and we would need to restart kubelet after copying the config file, on each worker node.
Still, we do have some logic that does something like that, see configure_cpu_manager introduced in 2981e7e
I'm not sure what is the best way forward. I think that, k8s FG requirements can change between k8s versions and if we want to help developers try those with kubevirtci, we should probably have to handle custom k8s configs and manage to update the cluster's components with it.
Drop-in would be great, but afaict not all k8s components have it and even kubelet support is beta. What about using kubeadm config?
Please take a look at the
Well, The way I see it, this PR adds the option to include useful flags for Kubernetes components: API server, kube-controller-manager, kube-scheduler, and kubelet. If we want to modify the way these flags are being added for components or add new ones for any of the components in the future, we can do so by updating For kubelet: For the API server: For kube-controller-manager: For kube-scheduler: I'm not certain if this is the optimal way to add the flags, but I aimed to make it easy to modify or extend in the future. |
@Barakmor1: The following tests failed, say
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What this PR does / why we need it:
There is a need to test new capabilities, such as the ImageVolume POC and DRA.
This change allows enabling/disabling Kubernetes feature gates and runtime config in the KubeVirt CI . Users can now set the
K8S_FEATURE_GATES
environment variable before runningmake cluster-up
to enable specific feature gates. For example:Users can also set runtime configuration by setting
the
K8S_API_RUNTIME_CONFIG
environment variable beforerunning
make cluster-up
.For example:
This modifies the KubeController, KubeAPI, and Kubelet configurations files, restarts the components, and waits for them to be ready with the feature gates applied.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Checklist
This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.
Release note: