Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Sealos
Commits
4d54805c
Commit
4d54805c
authored
6 years ago
by
fanux
Browse files
Options
Download
Email Patches
Plain Diff
sleep 30
parent
96fe90a7
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
install/sealos.go
+2
-2
install/sealos.go
install/utils.go
+2
-0
install/utils.go
with
4 additions
and
2 deletions
+4
-2
install/sealos.go
+
2
-
2
View file @
4d54805c
...
...
@@ -48,13 +48,13 @@ func (s *SealosInstaller) InstallMaster0() {
cmd
=
`mkdir -p ~/.kube && cp /etc/kubernetes/admin.conf ~/.kube/config`
output
=
Cmd
(
s
.
Masters
[
0
],
cmd
)
cmd
=
`kubectl apply -f net/calico.yaml`
cmd
=
`kubectl apply -f net/calico.yaml
|| true
`
output
=
Cmd
(
s
.
Masters
[
0
],
cmd
)
}
//JoinMasters is
func
(
s
*
SealosInstaller
)
JoinMasters
()
{
time
.
Sleep
(
3
*
time
.
Second
)
time
.
Sleep
(
3
0
*
time
.
Second
)
cmd
:=
fmt
.
Sprintf
(
"kubeadm join %s:6443 --token %s --discovery-token-ca-cert-hash %s --experimental-control-plane --certificate-key %s"
,
s
.
Masters
[
0
],
s
.
JoinToken
,
s
.
TokenCaCertHash
,
s
.
CertificateKey
)
for
_
,
master
:=
range
s
.
Masters
[
1
:
]
{
...
...
This diff is collapsed.
Click to expand it.
install/utils.go
+
2
-
0
View file @
4d54805c
...
...
@@ -19,6 +19,7 @@ func Cmd(host string, cmd string) []byte {
session
,
err
:=
Connect
(
User
,
Passwd
,
host
)
if
err
!=
nil
{
fmt
.
Println
(
" Error create ssh session failed"
,
err
)
panic
(
1
)
return
[]
byte
{}
}
defer
session
.
Close
()
...
...
@@ -29,6 +30,7 @@ func Cmd(host string, cmd string) []byte {
fmt
.
Printf
(
"%s
\n\n
"
,
b
)
if
err
!=
nil
{
fmt
.
Println
(
" Error exec command failed"
,
err
)
panic
(
1
)
return
[]
byte
{}
}
return
b
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help