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

kubectl invoked from incorrect location during bootstrap #349

Closed
anmazzotti opened this issue Jun 11, 2024 · 2 comments
Closed

kubectl invoked from incorrect location during bootstrap #349

anmazzotti opened this issue Jun 11, 2024 · 2 comments
Labels
kind/bug Something isn't working needs-priority Indicates an issue or PR needs a priority assigning to it needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@anmazzotti
Copy link
Contributor

What happened:

One command in the cloud-init bootstrap is as follows:

kubectl create secret tls cluster-etcd -o yaml --dry-run=client -n kube-system --cert=/var/lib/rancher/rke2/server/tls/etcd/server-ca.crt --key=/var/lib/rancher/rke2/server/tls/etcd/server-ca.key --kubeconfig /etc/rancher/rke2/rke2.yaml | kubectl apply -f- --kubeconfig /etc/rancher/rke2/rke2.yaml

The problem with this in the first place is that it relies on kubectl, making it a dependency in order to bootstrap.
I wonder if there is a better way to add this secret.

The other problem is that kubectl is not in PATH. This is not supported by RKE2 and it's going to fail on any RKE2 installation.
As the documentation suggests, /var/lib/rancher/rke2/bin/kubectl should be used.

However it's unclear to me if these CLI tools are going to stay or are just there for debugging/testing purposes. Using /var/lib/rancher/rke2/bin/ may stop working unexpectedly because of that.

Also be aware that this bug is currently silently failing due to #221

What did you expect to happen:

How to reproduce it:

Anything else you would like to add:
[Miscellaneous information that will assist in solving the issue.]

Environment:

  • rke provider version: v0.3.0
  • OS (e.g. from /etc/os-release):
@anmazzotti anmazzotti added kind/bug Something isn't working needs-priority Indicates an issue or PR needs a priority assigning to it needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jun 11, 2024
@anmazzotti
Copy link
Contributor Author

Relevant to this issue, is that the /var/lib/rancher/rke2 may not be hardcoded, because it can be set by the user.

I don't know if the data-dir can already be configured on the RKE2 provider, but it may be in the future.
Relevant issue: rancher/rancher#45326

@Danil-Grigorev
Copy link
Contributor

@anmazzotti I believe this was fixed in #404, I’ll close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working needs-priority Indicates an issue or PR needs a priority assigning to it needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Development

No branches or pull requests

2 participants