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

k8s: Make it work even if kubectl is not installed on the machine #1298

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andreabolognani
Copy link

What this PR does / why we need it:

Makes it possible to bring up a cluster on a machine where kubectl is not installed.

Which issue(s) this PR fixes:

Fixes #1293

Release note:

NONE

@kubevirt-bot kubevirt-bot added the dco-signoff: yes Indicates the PR's author has DCO signed all their commits. label Oct 11, 2024
@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign phoracek for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@andreabolognani
Copy link
Author

I should note that I'm forcing the use of Docker by having

KUBEVIRT_CRI=docker
KUBEVIRTCI_RUNTIME=docker

in my environment, but the change should be logically sound regardless of runtime.

@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 8, 2024
@kubevirt-bot
Copy link
Contributor

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.

/lifecycle stale

@kubevirt-bot kubevirt-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 6, 2025
There's code in the k8s provider that takes care of pulling the
kubectl binary from the cluster and use that one for subsequent
operations; however, right before that happens, a few settings
are changed in kubeconfig, which means that it's necessary for
the host system to provide its own kubectl binary.

Invert the order of these operations, and make sure that we
always invoke the binary obtained from the cluster. This way, it
is possible to successfully bring up a cluster on a machine that
doesn't have kubectl installed.

kubevirt#1293

Signed-off-by: Andrea Bolognani <[email protected]>
@kubevirt-bot kubevirt-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 10, 2025
@andreabolognani
Copy link
Author

/remove-lifecycle stale

@kubevirt-bot kubevirt-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 10, 2025
@kubevirt-bot
Copy link
Contributor

kubevirt-bot commented Feb 10, 2025

@andreabolognani: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
check-provision-k8s-1.29 80c6f8e link true /test check-provision-k8s-1.29
check-up-kind-sriov 8428362 link true /test check-up-kind-sriov
check-provision-k8s-1.31-s390x 8428362 link false /test check-provision-k8s-1.31-s390x

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.

@kubevirt-bot kubevirt-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 11, 2025
@kubevirt-bot
Copy link
Contributor

PR needs rebase.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes Indicates the PR's author has DCO signed all their commits. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/S
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kubectl.sh,bug: possibly broken - run kubectl.sh without having kubectl installed on your machine
3 participants