Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

(DON'T MERGE BEFORE v0.1.x ⚠️) feat: move to k3s from k3d - colony issues purposal #9

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 20 additions & 5 deletions laptop/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -68,23 +68,38 @@ start_k3s() {
mkdir -p ~/.kube/

cp ./kubeconfig.yaml ~/.kube/config || echo "Failed to get kubeconfig"
sed -i 's/127.0.0.1/localhost/g' ~/.kube/config
jairoFernandez marked this conversation as resolved.
Show resolved Hide resolved
export KUBECONFIG=~/.kube/config
cat ~/.kube/config
jairoFernandez marked this conversation as resolved.
Show resolved Hide resolved

if [ -f ./kubeconfig.yaml ]; then
cp ./kubeconfig.yaml ~/.kube/config
else
echo "Failed to get kubeconfig: kubeconfig.yaml not found"
exit 1
fi

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

# Generating a join token and storing it in a secret
docker exec -it ctrlplane-laptop k3s token create --print-join-command >token.txt
echo "Generating join token and storing it in a secret..."
# docker exec -i ctrlplane-laptop k3s token create --print-join-command > token.txt (incompatible)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I consider to maintain this comment, just for informational purposes

docker exec -i ctrlplane-laptop cat /var/lib/rancher/k3s/server/node-token > token.txt
kubectl create secret -n kube-system generic k3s-join-token --from-file=token.txt
}

kubectl_for_vagrant_user() {
runuser -l vagrant -c "mkdir -p ~/.kube/"
runuser -l vagrant -c "k3d kubeconfig get -a > ~/.kube/config"
echo "**********************************"
runuser -l vagrant -c "mkdir -p /home/vagrant/.kube"
cp ./kubeconfig.yaml /home/vagrant/.kube/config
chown vagrant:vagrant /home/vagrant/.kube/config

chmod 600 /home/vagrant/.kube/config
echo 'export KUBECONFIG="/home/vagrant/.kube/config"' >>/home/vagrant/.bashrc
echo 'export KUBECONFIG="/home/vagrant/.kube/config"' >> /home/vagrant/.bashrc
echo "**********************************"
}

helm_install_tink_stack() {
Expand Down