Skip to content

Shou333 patch 1 #151

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# kubernetes
Kubernetes playground

# just test for tidb serverless branches
6 changes: 3 additions & 3 deletions vagrant-provisioning/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
ENV['VAGRANT_NO_PARALLEL'] = 'yes'

VAGRANT_BOX = "generic/ubuntu2204"
VAGRANT_BOX_VERSION = "4.2.10"
VAGRANT_BOX_VERSION = "4.2.16"
CPUS_MASTER_NODE = 2
CPUS_WORKER_NODE = 1
MEMORY_MASTER_NODE = 2048
MEMORY_WORKER_NODE = 1024
MEMORY_MASTER_NODE = 4096
MEMORY_WORKER_NODE = 2048
WORKER_NODES_COUNT = 2


Expand Down
4 changes: 3 additions & 1 deletion vagrant-provisioning/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - >/
apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main" >/dev/null 2>&1

echo "[TASK 7] Install Kubernetes components (kubeadm, kubelet and kubectl)"
apt install -qq -y kubeadm=1.26.0-00 kubelet=1.26.0-00 kubectl=1.26.0-00 >/dev/null 2>&1
apt install -qq -y kubeadm=1.28.0-00 kubelet=1.28.0-00 kubectl=1.28.0-00 >/dev/null 2>&1

echo "[TASK 8] Enable ssh password authentication"
sed -i 's/^PasswordAuthentication .*/PasswordAuthentication yes/' /etc/ssh/sshd_config
Expand All @@ -66,3 +66,5 @@ cat >>/etc/hosts<<EOF
172.16.16.101 kworker1.example.com kworker1
172.16.16.102 kworker2.example.com kworker2
EOF

#eof
4 changes: 3 additions & 1 deletion vagrant-provisioning/bootstrap_kmaster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ echo "[TASK 2] Initialize Kubernetes Cluster"
kubeadm init --apiserver-advertise-address=172.16.16.100 --pod-network-cidr=192.168.0.0/16 >> /root/kubeinit.log 2>/dev/null

echo "[TASK 3] Deploy Calico network"
kubectl --kubeconfig=/etc/kubernetes/admin.conf create -f https://docs.projectcalico.org/v3.18/manifests/calico.yaml >/dev/null 2>&1
kubectl --kubeconfig=/etc/kubernetes/admin.conf create -f https://docs.projectcalico.org/v3.25/manifests/calico.yaml >/dev/null 2>&1

echo "[TASK 4] Generate and save cluster join command to /joincluster.sh"
kubeadm token create --print-join-command > /joincluster.sh 2>/dev/null

#eof
2 changes: 2 additions & 0 deletions vagrant-provisioning/bootstrap_kworker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ echo "[TASK 1] Join node to Kubernetes Cluster"
apt install -qq -y sshpass >/dev/null 2>&1
sshpass -p "kubeadmin" scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no kmaster.example.com:/joincluster.sh /joincluster.sh 2>/dev/null
bash /joincluster.sh >/dev/null 2>&1

#eof