Skip to content

Commit

Permalink
sleep 30
Browse files Browse the repository at this point in the history
  • Loading branch information
fanux committed Apr 11, 2019
1 parent 96fe90a commit 4d54805
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions install/sealos.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(30 * 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:] {
Expand Down
2 changes: 2 additions & 0 deletions install/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand Down

0 comments on commit 4d54805

Please sign in to comment.