-
Notifications
You must be signed in to change notification settings - Fork 828
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
modify the local-up-karmada.sh to optimize the creation of clusters #1552
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 |
Signed-off-by: charlie <qianglin98@qq.com>
1a9507f
to
281844e
Compare
# hack/local-up-karmada.sh
.,.
Waiting for the host clusters to be ready...
Waiting for kubeconfig file /root/.kube/karmada.config and clusters karmada-host to be ready...
error: cannot rename the context "kind-karmada-host", the context "karmada-host" already exists in /root/.kube/karmada.config When I run By the way, the |
I also met this (I just remove the following line:393), I find when wait the cluster ready, it will rename the context name Lines 385 to 393 in e85d376
so it can't do it again if the cluster context has been renamed |
I think it will be more logical that renaming the cluster context in |
Yes. agree. But how? |
How about this ? diff --git a/hack/util.sh b/hack/util.sh
index 46349bea..cbbdd163 100755
--- a/hack/util.sh
+++ b/hack/util.sh
@@ -355,7 +355,7 @@ function util::create_cluster() {
mkdir -p ${log_path}
rm -rf "${log_path}/${cluster_name}.log"
- nohup kind delete cluster --name="${cluster_name}" --kubeconfig="${kubeconfig}" >> "${log_path}"/"${cluster_name}".log 2>&1 && kind create cluster --name "${cluster_name}" --kubeconfig="${kubeconfig}" --image="${kind_image}" --config="${cluster_config}" >> "${log_path}"/"${cluster_name}".log 2>&1 &
+ nohup kind delete cluster --name="${cluster_name}" --kubeconfig="${kubeconfig}" >> "${log_path}"/"${cluster_name}".log 2>&1 && kind create cluster --name "${cluster_name}" --kubeconfig="${kubeconfig}" --image="${kind_image}" --config="${cluster_config}" >> "${log_path}"/"${cluster_name}".log 2>&1 && kubectl config rename-context "kind-${context_name}" "${context_name}" --kubeconfig="${kubeconfig}" &
echo "Creating cluster ${cluster_name}"
}
|
Does this work? Have you tested it? I guess it might not work, as after cluster is created, the control plan of that cluster might not ready. Maybe you need specify a |
/close |
@RainbowMango: Closed this PR. In response to this:
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/test-infra repository. |
What type of PR is this?
/kind bug
What this PR does / why we need it:
Fixed a bug in a extreme case that the cluster kubeconfig created earlier will be overwritten by the cluster created later
Which issue(s) this PR fixes:
Fixes #1545
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
NONE