Skip to content

Commit e050ac1

Browse files
feat: add extra improvements to run on k3s
1 parent de4de8f commit e050ac1

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

laptop/setup.sh

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,23 +68,38 @@ start_k3s() {
6868
mkdir -p ~/.kube/
6969

7070
cp ./kubeconfig.yaml ~/.kube/config || echo "Failed to get kubeconfig"
71+
sed -i 's/127.0.0.1/localhost/g' ~/.kube/config
72+
export KUBECONFIG=~/.kube/config
73+
cat ~/.kube/config
74+
75+
if [ -f ./kubeconfig.yaml ]; then
76+
cp ./kubeconfig.yaml ~/.kube/config
77+
else
78+
echo "Failed to get kubeconfig: kubeconfig.yaml not found"
79+
exit 1
80+
fi
7181

7282
echo "Checking nodes..."
7383
until kubectl wait --for=condition=Ready nodes --all --timeout=600s; do
7484
echo "Waiting for nodes to be ready..."
7585
sleep 5
7686
done
7787

78-
# Generating a join token and storing it in a secret
79-
docker exec -it ctrlplane-laptop k3s token create --print-join-command >token.txt
88+
echo "Generating join token and storing it in a secret..."
89+
# docker exec -i ctrlplane-laptop k3s token create --print-join-command > token.txt (incompatible)
90+
docker exec -i ctrlplane-laptop cat /var/lib/rancher/k3s/server/node-token > token.txt
8091
kubectl create secret -n kube-system generic k3s-join-token --from-file=token.txt
8192
}
8293

8394
kubectl_for_vagrant_user() {
84-
runuser -l vagrant -c "mkdir -p ~/.kube/"
85-
runuser -l vagrant -c "k3d kubeconfig get -a > ~/.kube/config"
95+
echo "**********************************"
96+
runuser -l vagrant -c "mkdir -p /home/vagrant/.kube"
97+
cp ./kubeconfig.yaml /home/vagrant/.kube/config
98+
chown vagrant:vagrant /home/vagrant/.kube/config
99+
86100
chmod 600 /home/vagrant/.kube/config
87-
echo 'export KUBECONFIG="/home/vagrant/.kube/config"' >>/home/vagrant/.bashrc
101+
echo 'export KUBECONFIG="/home/vagrant/.kube/config"' >> /home/vagrant/.bashrc
102+
echo "**********************************"
88103
}
89104

90105
helm_install_tink_stack() {

virtual-datacenter/start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ main() {
4040
unblock_local_ssh
4141
create_datacenter
4242
wait_for_civo_status
43-
setup_vagrant
43+
# setup_vagrant
4444
;;
4545
"destroy datacenter")
4646
civo_destroy

0 commit comments

Comments
 (0)