diff --git a/cluster/Guideline-For-Add-Node-To-FreeleapsK8sCluster.md b/cluster/Guideline-For-Add-Node-To-FreeleapsK8sCluster.md new file mode 100644 index 00000000..39250d4e --- /dev/null +++ b/cluster/Guideline-For-Add-Node-To-FreeleapsK8sCluster.md @@ -0,0 +1,55 @@ + +# 1. 在Azure上创建VM +一些关键配置按照下面图中设置,其他配置按照默认值即可 +![img_1.png](asserts/img_1.png) +![img.png](asserts/img.png) +![img_2.png](asserts/img_12.png) +![img_4.png](asserts/img_4.png) + +# 2. 登录新VM + +在Azure上成功添加新VM后,新VM会有一个Private Ip + +![img_5.png](asserts/img_5.png) + +基于Freeleaps堡垒机登录新VM + +1. 登录Freeleaps堡垒机 +```commandline +ssh -o StrictHostKeyChecking=no -l xxxx@mathmast.com jumper.mathmast.com # 需要找jet添加堡垒机登录权限并且询问ssh密码 + +``` +![img_6.png](asserts/img_6.png) + +2. 在Freeleaps堡垒机上登录新VM + +```commandline +ssh freeleaps@10.10.1.4 # 密码是你添加VM时设置的密码 +``` +![img_7.png](asserts/img_7.png) + +# 3. 为新VM加域 +> 加域是为了确保可以通过 xxx@mathmast.com账号登录新VM + +加域流程参考:https://learn.microsoft.com/zh-cn/entra/identity/domain-services/join-ubuntu-linux-vm + +不太确认的配置值,可以登录一个已经配置好的机器,参考上面的配置 + +关键配置值参考如下 + +![img_8.png](asserts/img_8.png) + +下面这一步需要为找好wwwadmin@MATHMAST.COM设置密码,密码就用Freeleaps@2021 +![img_9.png](asserts/img_9.png) + +```commandline +# 使用域账号登录新节点 +sudo ssh -l wwwadmin@mathmast.com 10.10.1.4 +``` +![img_11.png](asserts/img_11.png) + +至此,新VM可以通过域账号登录了 + +# 4. 将新机器添加为K8s节点 +> 需要在堡垒机jumper.mathmast.com上执行 +参考:[README.md](ansible/README.md) \ No newline at end of file diff --git a/cluster/ansible/README.md b/cluster/ansible/README.md index 529410a5..e78f05e4 100644 --- a/cluster/ansible/README.md +++ b/cluster/ansible/README.md @@ -49,7 +49,9 @@ Using `sysctl -p` to make kernel params effect. ## How to use ? ### Cluster Scaling +> First execute `init-cluster.sh` to initialize the environment and execute `source venv/bin/activate` to activate the virtual environment +> Ansible version needs to be between 2.16.4 and 2.17.0 If you want to scale nodes in cluster, you can execute script `upgrade-cluster.sh` after environment initialized. #### Tips - ANONYMOUS AUTH ENABLING BEFORE SCALE diff --git a/cluster/ansible/manifests/inventory.ini b/cluster/ansible/manifests/inventory.ini index c5100a3b..dba3f77f 100644 --- a/cluster/ansible/manifests/inventory.ini +++ b/cluster/ansible/manifests/inventory.ini @@ -25,5 +25,6 @@ prod-usw2-k8s-freeleaps-worker-nodes-03 ansible_host=10.10.0.10 ansible_user=www prod-usw2-k8s-freeleaps-worker-nodes-04 ansible_host=10.10.0.11 ansible_user=wwwadmin@mathmast.com host_name=prod-usw2-k8s-freeleaps-worker-nodes-04 prod-usw2-k8s-freeleaps-worker-nodes-05 ansible_host=10.10.0.12 ansible_user=wwwadmin@mathmast.com host_name=prod-usw2-k8s-freeleaps-worker-nodes-05 prod-usw2-k8s-freeleaps-worker-nodes-06 ansible_host=10.10.0.13 ansible_user=wwwadmin@mathmast.com host_name=prod-usw2-k8s-freeleaps-worker-nodes-06 +prod-usw2-k8s-freeleaps-worker-nodes-07 ansible_host=10.10.0.5 ansible_user=wwwadmin@mathmast.com host_name=prod-usw2-k8s-freeleaps-worker-nodes-07 ; Belows are the CI/CD dedicated nodes for the cluster prod-usw2-k8s-freeleaps-worker-05 ansible_host=10.10.0.14 ansible_user=wwwadmin@mathmast.com host_name=prod-usw2-k8s-freeleaps-worker-05 \ No newline at end of file diff --git a/cluster/asserts/img.png b/cluster/asserts/img.png new file mode 100644 index 00000000..64a56ed8 Binary files /dev/null and b/cluster/asserts/img.png differ diff --git a/cluster/asserts/img_1.png b/cluster/asserts/img_1.png new file mode 100644 index 00000000..d7e988bb Binary files /dev/null and b/cluster/asserts/img_1.png differ diff --git a/cluster/asserts/img_10.png b/cluster/asserts/img_10.png new file mode 100644 index 00000000..5452e883 Binary files /dev/null and b/cluster/asserts/img_10.png differ diff --git a/cluster/asserts/img_11.png b/cluster/asserts/img_11.png new file mode 100644 index 00000000..d87abb4f Binary files /dev/null and b/cluster/asserts/img_11.png differ diff --git a/cluster/asserts/img_12.png b/cluster/asserts/img_12.png new file mode 100644 index 00000000..fe0c84db Binary files /dev/null and b/cluster/asserts/img_12.png differ diff --git a/cluster/asserts/img_2.png b/cluster/asserts/img_2.png new file mode 100644 index 00000000..5bea25e7 Binary files /dev/null and b/cluster/asserts/img_2.png differ diff --git a/cluster/asserts/img_3.png b/cluster/asserts/img_3.png new file mode 100644 index 00000000..27cad47a Binary files /dev/null and b/cluster/asserts/img_3.png differ diff --git a/cluster/asserts/img_4.png b/cluster/asserts/img_4.png new file mode 100644 index 00000000..789bc579 Binary files /dev/null and b/cluster/asserts/img_4.png differ diff --git a/cluster/asserts/img_5.png b/cluster/asserts/img_5.png new file mode 100644 index 00000000..72638b53 Binary files /dev/null and b/cluster/asserts/img_5.png differ diff --git a/cluster/asserts/img_6.png b/cluster/asserts/img_6.png new file mode 100644 index 00000000..c5c3da0f Binary files /dev/null and b/cluster/asserts/img_6.png differ diff --git a/cluster/asserts/img_7.png b/cluster/asserts/img_7.png new file mode 100644 index 00000000..97c39fd4 Binary files /dev/null and b/cluster/asserts/img_7.png differ diff --git a/cluster/asserts/img_8.png b/cluster/asserts/img_8.png new file mode 100644 index 00000000..76b6938d Binary files /dev/null and b/cluster/asserts/img_8.png differ diff --git a/cluster/asserts/img_9.png b/cluster/asserts/img_9.png new file mode 100644 index 00000000..72a0cc3e Binary files /dev/null and b/cluster/asserts/img_9.png differ