feat: add node

This commit is contained in:
icecheng 2025-09-12 18:14:04 +08:00
parent 193aaa1f52
commit b3134726b2
16 changed files with 58 additions and 0 deletions

View File

@ -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)

View File

@ -49,7 +49,9 @@ Using `sysctl -p` to make kernel params effect.
## How to use ? ## How to use ?
### Cluster Scaling ### 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. If you want to scale nodes in cluster, you can execute script `upgrade-cluster.sh` after environment initialized.
#### Tips - ANONYMOUS AUTH ENABLING BEFORE SCALE #### Tips - ANONYMOUS AUTH ENABLING BEFORE SCALE

View File

@ -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-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-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-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 ; 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 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

BIN
cluster/asserts/img.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

BIN
cluster/asserts/img_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 315 KiB

BIN
cluster/asserts/img_10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 KiB

BIN
cluster/asserts/img_11.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 KiB

BIN
cluster/asserts/img_12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 133 KiB

BIN
cluster/asserts/img_2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

BIN
cluster/asserts/img_3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 305 KiB

BIN
cluster/asserts/img_4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 KiB

BIN
cluster/asserts/img_5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 KiB

BIN
cluster/asserts/img_6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 KiB

BIN
cluster/asserts/img_7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 609 KiB

BIN
cluster/asserts/img_8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

BIN
cluster/asserts/img_9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB