Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
35aec77f
M
minikube
项目概览
Chu Peng 楚鹏
/
minikube
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
minikube
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
35aec77f
编写于
3月 20, 2020
作者:
S
Sharif Elgamal
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
code comments
上级
4c00ae01
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
10 addition
and
12 deletion
+10
-12
cmd/minikube/cmd/node_add.go
cmd/minikube/cmd/node_add.go
+1
-3
cmd/minikube/cmd/ssh.go
cmd/minikube/cmd/ssh.go
+1
-2
cmd/minikube/cmd/start.go
cmd/minikube/cmd/start.go
+2
-2
pkg/minikube/bootstrapper/kubeadm/kubeadm.go
pkg/minikube/bootstrapper/kubeadm/kubeadm.go
+0
-5
pkg/minikube/node/node.go
pkg/minikube/node/node.go
+6
-0
未找到文件。
cmd/minikube/cmd/node_add.go
浏览文件 @
35aec77f
...
@@ -17,8 +17,6 @@ limitations under the License.
...
@@ -17,8 +17,6 @@ limitations under the License.
package
cmd
package
cmd
import
(
import
(
"fmt"
"github.com/spf13/cobra"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/pflag"
"github.com/spf13/viper"
"github.com/spf13/viper"
...
@@ -48,7 +46,7 @@ var nodeAddCmd = &cobra.Command{
...
@@ -48,7 +46,7 @@ var nodeAddCmd = &cobra.Command{
out
.
ErrT
(
out
.
FailureType
,
"none driver does not support multi-node clusters"
)
out
.
ErrT
(
out
.
FailureType
,
"none driver does not support multi-node clusters"
)
}
}
name
:=
fmt
.
Sprintf
(
"m%02d"
,
len
(
cc
.
Nodes
)
+
1
)
name
:=
node
.
Name
(
len
(
cc
.
Nodes
)
+
1
)
out
.
T
(
out
.
Happy
,
"Adding node {{.name}} to cluster {{.cluster}}"
,
out
.
V
{
"name"
:
name
,
"cluster"
:
profile
})
out
.
T
(
out
.
Happy
,
"Adding node {{.name}} to cluster {{.cluster}}"
,
out
.
V
{
"name"
:
name
,
"cluster"
:
profile
})
...
...
cmd/minikube/cmd/ssh.go
浏览文件 @
35aec77f
...
@@ -60,8 +60,7 @@ var sshCmd = &cobra.Command{
...
@@ -60,8 +60,7 @@ var sshCmd = &cobra.Command{
}
else
{
}
else
{
n
,
_
,
err
=
node
.
Retrieve
(
cc
,
nodeName
)
n
,
_
,
err
=
node
.
Retrieve
(
cc
,
nodeName
)
if
err
!=
nil
{
if
err
!=
nil
{
out
.
FailureT
(
"Node {{.nodeName}} does not exist."
,
out
.
V
{
"nodeName"
:
nodeName
})
exit
.
WithCodeT
(
exit
.
Unavailable
,
"Node {{.nodeName}} does not exist."
,
out
.
V
{
"nodeName"
:
nodeName
})
exit
.
WithError
(
""
,
err
)
}
}
}
}
host
,
err
:=
machine
.
LoadHost
(
api
,
driver
.
MachineName
(
*
cc
,
*
n
))
host
,
err
:=
machine
.
LoadHost
(
api
,
driver
.
MachineName
(
*
cc
,
*
n
))
...
...
cmd/minikube/cmd/start.go
浏览文件 @
35aec77f
...
@@ -356,10 +356,10 @@ func runStart(cmd *cobra.Command, args []string) {
...
@@ -356,10 +356,10 @@ func runStart(cmd *cobra.Command, args []string) {
}
}
if
numNodes
>
1
{
if
numNodes
>
1
{
if
driver
.
BareMetal
(
driverName
)
{
if
driver
.
BareMetal
(
driverName
)
{
out
.
T
(
out
.
Meh
,
"The none driver is not compatible with multi-node clusters."
)
exit
.
WithCodeT
(
exit
.
Config
,
"The none driver is not compatible with multi-node clusters."
)
}
else
{
}
else
{
for
i
:=
1
;
i
<
numNodes
;
i
++
{
for
i
:=
1
;
i
<
numNodes
;
i
++
{
nodeName
:=
fmt
.
Sprintf
(
"m%02d"
,
i
+
1
)
nodeName
:=
node
.
Name
(
i
+
1
)
n
:=
config
.
Node
{
n
:=
config
.
Node
{
Name
:
nodeName
,
Name
:
nodeName
,
Worker
:
true
,
Worker
:
true
,
...
...
pkg/minikube/bootstrapper/kubeadm/kubeadm.go
浏览文件 @
35aec77f
...
@@ -419,13 +419,8 @@ func (k *Bootstrapper) GenerateToken(cc config.ClusterConfig) (string, error) {
...
@@ -419,13 +419,8 @@ func (k *Bootstrapper) GenerateToken(cc config.ClusterConfig) (string, error) {
return
""
,
errors
.
Wrap
(
err
,
"generating bootstrap token"
)
return
""
,
errors
.
Wrap
(
err
,
"generating bootstrap token"
)
}
}
/*cp, err := config.PrimaryControlPlane(&cc)
if err != nil {
return "", errors.Wrap(err, "getting primary control plane")
}*/
joinCmd
:=
r
.
Stdout
.
String
()
joinCmd
:=
r
.
Stdout
.
String
()
joinCmd
=
strings
.
Replace
(
joinCmd
,
"kubeadm"
,
bsutil
.
InvokeKubeadm
(
cc
.
KubernetesConfig
.
KubernetesVersion
),
1
)
joinCmd
=
strings
.
Replace
(
joinCmd
,
"kubeadm"
,
bsutil
.
InvokeKubeadm
(
cc
.
KubernetesConfig
.
KubernetesVersion
),
1
)
//joinCmd = strings.ReplaceAll(joinCmd, "localhost", cp.IP)
joinCmd
=
fmt
.
Sprintf
(
"%s --ignore-preflight-errors=all"
,
strings
.
TrimSpace
(
joinCmd
))
joinCmd
=
fmt
.
Sprintf
(
"%s --ignore-preflight-errors=all"
,
strings
.
TrimSpace
(
joinCmd
))
return
joinCmd
,
nil
return
joinCmd
,
nil
...
...
pkg/minikube/node/node.go
浏览文件 @
35aec77f
...
@@ -18,6 +18,7 @@ package node
...
@@ -18,6 +18,7 @@ package node
import
(
import
(
"errors"
"errors"
"fmt"
"github.com/spf13/viper"
"github.com/spf13/viper"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/config"
...
@@ -91,3 +92,8 @@ func Save(cfg *config.ClusterConfig, node *config.Node) error {
...
@@ -91,3 +92,8 @@ func Save(cfg *config.ClusterConfig, node *config.Node) error {
}
}
return
config
.
SaveProfile
(
viper
.
GetString
(
config
.
ProfileName
),
cfg
)
return
config
.
SaveProfile
(
viper
.
GetString
(
config
.
ProfileName
),
cfg
)
}
}
// Name returns the appropriate name for the node given the current number of nodes
func
Name
(
index
int
)
string
{
return
fmt
.
Sprintf
(
"m%02d"
,
index
)
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录