更新默认ip
This commit is contained in:
parent
63e12178c3
commit
d88beafcf5
@ -1,6 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
apiserver="10.0.0.7"
|
||||
apiserver="10.0.0.3"
|
||||
|
||||
|
||||
sudo kubeadm init \
|
||||
|
10
README.md
10
README.md
@ -1,2 +1,12 @@
|
||||
# offline-kubernetes-install
|
||||
完全离线的情况下, 安装k8s集群
|
||||
|
||||
|
||||
默认IP, 请通过sed批量替换
|
||||
|
||||
| 机器 | ip |
|
||||
| ------------- | --------- |
|
||||
| apiserver VIP | 10.0.0.3 |
|
||||
| master1 | 10.0.0.11 |
|
||||
| master2 | 10.0.0.12 |
|
||||
| master3 | 10.0.0.13 |
|
34
keepalived/keepalived1.conf
Normal file
34
keepalived/keepalived1.conf
Normal file
@ -0,0 +1,34 @@
|
||||
global_defs {
|
||||
script_user root # 脚本执行者
|
||||
enable_script_security # 标记脚本安全
|
||||
}
|
||||
|
||||
vrrp_script check {
|
||||
script "killall -0 kube-apiserver" # 脚本路径
|
||||
interval 2 # 脚本执行间隔,单位s
|
||||
weight -20 # -254-254之间,检测失败权重减少
|
||||
}
|
||||
|
||||
vrrp_instance VI_1 { # 实例名
|
||||
state MASTER # 3个实例,1个配置MASTER,另外2个配置BACKUP
|
||||
interface ens192
|
||||
virtual_router_id 251 # ID主备需一致
|
||||
priority 100 # 默认权重,3个节点保持不一致,并且MASTER最大,priority之间的差值要小于weight
|
||||
|
||||
authentication {
|
||||
auth_type PASS # 主备验证信息,需一致
|
||||
auth_pass 123456
|
||||
}
|
||||
track_script {
|
||||
check
|
||||
}
|
||||
unicast_src_ip 10.0.0.11
|
||||
unicast_peer {
|
||||
10.0.0.12
|
||||
10.0.0.13
|
||||
}
|
||||
virtual_ipaddress {
|
||||
10.0.0.3 dev ens192
|
||||
}
|
||||
}
|
||||
|
34
keepalived/keepalived2.conf
Normal file
34
keepalived/keepalived2.conf
Normal file
@ -0,0 +1,34 @@
|
||||
global_defs {
|
||||
script_user root # 脚本执行者
|
||||
enable_script_security # 标记脚本安全
|
||||
}
|
||||
|
||||
vrrp_script check {
|
||||
script "killall -0 kube-apiserver" # 脚本路径
|
||||
interval 2 # 脚本执行间隔,单位s
|
||||
weight -20 # -254-254之间,检测失败权重减少
|
||||
}
|
||||
|
||||
vrrp_instance VI_1 { # 实例名
|
||||
state MASTER # 3个实例,1个配置MASTER,另外2个配置BACKUP
|
||||
interface ens192
|
||||
virtual_router_id 251 # ID主备需一致
|
||||
priority 99
|
||||
|
||||
authentication {
|
||||
auth_type PASS # 主备验证信息,需一致
|
||||
auth_pass 123456
|
||||
}
|
||||
track_script {
|
||||
check
|
||||
}
|
||||
unicast_src_ip 10.0.0.12
|
||||
unicast_peer {
|
||||
10.0.0.11
|
||||
10.0.0.13
|
||||
}
|
||||
virtual_ipaddress {
|
||||
10.0.0.3 dev ens192
|
||||
}
|
||||
}
|
||||
|
34
keepalived/keepalived3.conf
Normal file
34
keepalived/keepalived3.conf
Normal file
@ -0,0 +1,34 @@
|
||||
global_defs {
|
||||
script_user root # 脚本执行者
|
||||
enable_script_security # 标记脚本安全
|
||||
}
|
||||
|
||||
vrrp_script check {
|
||||
script "killall -0 kube-apiserver" # 脚本路径
|
||||
interval 2 # 脚本执行间隔,单位s
|
||||
weight -20 # -254-254之间,检测失败权重减少
|
||||
}
|
||||
|
||||
vrrp_instance VI_1 { # 实例名
|
||||
state MASTER # 3个实例,1个配置MASTER,另外2个配置BACKUP
|
||||
interface ens192
|
||||
virtual_router_id 251 # ID主备需一致
|
||||
priority 98
|
||||
|
||||
authentication {
|
||||
auth_type PASS # 主备验证信息,需一致
|
||||
auth_pass 123456
|
||||
}
|
||||
track_script {
|
||||
check
|
||||
}
|
||||
unicast_src_ip 10.0.0.13
|
||||
unicast_peer {
|
||||
10.0.0.11
|
||||
10.0.0.12
|
||||
}
|
||||
virtual_ipaddress {
|
||||
10.0.0.3 dev ens192
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user