From 2eedf4932e122a391428ddf9c938e5f79361c8e9 Mon Sep 17 00:00:00 2001 From: Khue Doan Date: Sun, 18 Jul 2021 18:06:30 +0700 Subject: [PATCH] Pivot to new cluster --- bootstrap/bootstrap.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/bootstrap/bootstrap.sh b/bootstrap/bootstrap.sh index 3e9e29e2..faa88bbc 100644 --- a/bootstrap/bootstrap.sh +++ b/bootstrap/bootstrap.sh @@ -35,4 +35,18 @@ export KUBERNETES_VERSION=v1.20.1 export CONTROL_PLANE_PORT=6443 export CONTROL_PLANE_ENDPOINT=192.168.1.24 clusterctl config cluster management-plane -i sidero > management-plane.yaml -kubectl delete -f management-plane.yaml + +kubectl apply -f management-plane.yaml + +kubectl get talosconfig \ + -l cluster.x-k8s.io/cluster-name=management-plane \ + -o yaml -o jsonpath='{.items[0].status.talosConfig}' > management-plane-talosconfig.yaml + +clusterctl init \ + --kubeconfig-context=admin@management-plane + -i sidero -b talos -c talos + +clusterctl move \ + --kubeconfig-context=admin@talos-default \ + --to-kubeconfig=$HOME/.kube/config \ + --to-kubeconfig-context=admin@management-plane