Skip to content

Commit

Permalink
Solve the problem when the master and node are installed separately.
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudnativer committed Jun 16, 2021
1 parent b446050 commit b60a3da
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 8 deletions.
Binary file modified kube-install
Binary file not shown.
2 changes: 2 additions & 0 deletions kube-install.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func main() {
}



//Execute opt
switch {

Expand Down Expand Up @@ -79,6 +80,7 @@ func main() {
kilib.InstallYML(currentdir, ostype)
kilib.Operation(opt, currentdir, opt)
}
fmt.Println("Please check the file "+softdir+"/loginkey.txt to get the login key. \n")
fmt.Println("=============================================================================\nKubernetes cluster installation completed! \n=============================================================================\n")

//Execute addnode command
Expand Down
2 changes: 1 addition & 1 deletion lib/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (


func ShowHelp(){
fmt.Println("kube-install version 0.6.2 (Creation Date: 5/31/2021)\n=================================================================\n\nUsage of kube-install: -opt [OPTION] COMMAND [ARGS]...\n\nOPTIONS:\n init Initialize the system environment.\n install Install kubernetes cluster.\n delnode Remove the k8s-node from the cluster.\n addnode Add k8s-node to the cluster.\n delmaster Remove the k8s-master from the cluster.\n rebuildmaster Rebuild the damaged k8s-master.\n uninstall Uninstall kubernetes cluster.\n help Display help information.\n\nCOMMANDS:\n master The IP address of k8s-master server.\n node The IP address of k8s-node server.\n sshpwd The root password used to SSH login to each server.\n ostype Specifies the distribution OS type: centos7|centos8|rhel7|rhel8|suse15.\n\n--------------------------------------------------------------\n\nEXAMPLES:\n Initialize the system environment:\n kube-install -opt init -ostype \"rhel7\" \n Install k8s cluster:\n kube-install -opt install -master \"192.168.1.11,192.168.1.12,192.168.1.13\" -node \"192.168.1.11,192.168.1.12,192.168.1.13,192.168.1.14\" -sshpwd \"cloudnativer\" -ostype \"rhel7\" \n Add k8s-node to the cluster:\n kube-install -opt addnode -node \"192.168.1.15,192.168.1.16\" -sshpwd \"cloudnativer\" -ostype \"rhel7\" \n Remove the k8s-node from the cluster:\n kube-install -opt delnode -node \"192.168.1.13,192.168.1.15\" -sshpwd \"cloudnativer\"\n Remove the k8s-master from the cluster:\n kube-install -opt delmaster -master \"192.168.1.13\" -sshpwd \"cloudnativer\"\n Rebuild the damaged k8s-master:\n kube-install -opt rebuildmaster -master \"192.168.1.13\" -sshpwd \"cloudnativer\" -ostype \"rhel7\" \n Uninstall k8s cluster:\n kube-install -opt uninstall -master \"192.168.1.11,192.168.1.12,192.168.1.13\" -node \"192.168.1.11,192.168.1.12,192.168.1.13,192.168.1.14\" -sshpwd \"cloudnativer\"\n Display help information:\n kube-install -opt help\n kube-install help\n\n=================================================================\n")
fmt.Println("kube-install version 0.6.3 (Creation Date: 6/16/2021)\n=================================================================\n\nUsage of kube-install: -opt [OPTION] COMMAND [ARGS]...\n\nOPTIONS:\n init Initialize the system environment.\n install Install kubernetes cluster.\n delnode Remove the k8s-node from the cluster.\n addnode Add k8s-node to the cluster.\n delmaster Remove the k8s-master from the cluster.\n rebuildmaster Rebuild the damaged k8s-master.\n uninstall Uninstall kubernetes cluster.\n help Display help information.\n\nCOMMANDS:\n master The IP address of k8s-master server.\n node The IP address of k8s-node server.\n sshpwd The root password used to SSH login to each server.\n ostype Specifies the distribution OS type: centos7|centos8|rhel7|rhel8|suse15.\n\n--------------------------------------------------------------\n\nEXAMPLES:\n Initialize the system environment:\n kube-install -opt init -ostype \"rhel7\" \n Install k8s cluster:\n kube-install -opt install -master \"192.168.1.11,192.168.1.12,192.168.1.13\" -node \"192.168.1.11,192.168.1.12,192.168.1.13,192.168.1.14\" -sshpwd \"cloudnativer\" -ostype \"rhel7\" \n Add k8s-node to the cluster:\n kube-install -opt addnode -node \"192.168.1.15,192.168.1.16\" -sshpwd \"cloudnativer\" -ostype \"rhel7\" \n Remove the k8s-node from the cluster:\n kube-install -opt delnode -node \"192.168.1.13,192.168.1.15\" -sshpwd \"cloudnativer\"\n Remove the k8s-master from the cluster:\n kube-install -opt delmaster -master \"192.168.1.13\" -sshpwd \"cloudnativer\"\n Rebuild the damaged k8s-master:\n kube-install -opt rebuildmaster -master \"192.168.1.13\" -sshpwd \"cloudnativer\" -ostype \"rhel7\" \n Uninstall k8s cluster:\n kube-install -opt uninstall -master \"192.168.1.11,192.168.1.12,192.168.1.13\" -node \"192.168.1.11,192.168.1.12,192.168.1.13,192.168.1.14\" -sshpwd \"cloudnativer\"\n Display help information:\n kube-install -opt help\n kube-install help\n\n=================================================================\n")
}


4 changes: 2 additions & 2 deletions sys/0x0000000000base/docker/templates/daemon.json.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"data-root": "{{k8s_install_home}}/docker/containerd",
"insecure-registries": [
"{{addons_ip3}}:55000"
"{{addons_ip3}}:5000"
]
}
overlay2
Expand All @@ -20,7 +20,7 @@ overlay2
},
"data-root": "{{k8s_install_home}}/docker/containerd",
"insecure-registries": [
"{{addons_ip3}}:55000"
"{{addons_ip3}}:5000"
]
}

Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
# If not specified, Dashboard will attempt to auto discover the API server and connect
# to it. Uncomment only if the default does not work.
# - --apiserver-host=http://my-address:port
- --apiserver-host=https://{{addons_ip3}}:{{master_vport}}
- --apiserver-host=https://{{master_vip}}:{{master_vport}}
- --kubeconfig=/etc/kubernetes/ssl/kube.kubeconfig
- --token-ttl=66666
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
imagePullPolicy: IfNotPresent
command:
- /heapster
- --source=kubernetes:https://{{addons_ip3}}:{{master_vport}}?auth=
- --source=kubernetes:https://{{master_vip}}:{{master_vport}}?auth=
resources:
requests:
cpu: 100m
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
# If not specified, Dashboard will attempt to auto discover the API server and connect
# to it. Uncomment only if the default does not work.
# - --apiserver-host=http://my-address:port
- --apiserver-host=https://{{addons_ip3}}:{{master_vport}}
- --apiserver-host=https://{{master_vip}}:{{master_vport}}
- --kubeconfig=/etc/kubernetes/ssl/kube.kubeconfig
- --token-ttl=66666
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
# If not specified, Dashboard will attempt to auto discover the API server and connect
# to it. Uncomment only if the default does not work.
# - --apiserver-host=http://my-address:port
- --apiserver-host=https://{{addons_ip3}}:{{master_vport}}
- --apiserver-host=https://{{master_vip}}:{{master_vport}}
- --kubeconfig=/etc/kubernetes/ssl/kube.kubeconfig
- --token-ttl=66666
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ spec:
# If not specified, Dashboard will attempt to auto discover the API server and connect
# to it. Uncomment only if the default does not work.
# - --apiserver-host=http://my-address:port
- --apiserver-host=https://{{addons_ip3}}:{{master_vport}}
- --apiserver-host=https://{{master_vip}}:{{master_vport}}
- --kubeconfig=/etc/kubernetes/ssl/kube.kubeconfig
- --token-ttl=66666
volumeMounts:
Expand Down

0 comments on commit b60a3da

Please sign in to comment.