Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
2243847f
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,发现更多精彩内容 >>
提交
2243847f
编写于
12月 18, 2019
作者:
M
Medya Gh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add kic command runner to machine
上级
c627f58f
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
28 addition
and
4 deletion
+28
-4
cmd/minikube/cmd/start.go
cmd/minikube/cmd/start.go
+12
-2
pkg/drivers/kic/kic.go
pkg/drivers/kic/kic.go
+1
-1
pkg/minikube/bootstrapper/bootstrapper.go
pkg/minikube/bootstrapper/bootstrapper.go
+3
-0
pkg/minikube/driver/driver.go
pkg/minikube/driver/driver.go
+8
-0
pkg/minikube/machine/client.go
pkg/minikube/machine/client.go
+4
-1
未找到文件。
cmd/minikube/cmd/start.go
浏览文件 @
2243847f
...
...
@@ -315,8 +315,7 @@ func runStart(cmd *cobra.Command, args []string) {
exit
.
WithError
(
"Failed to generate config"
,
err
)
}
fmt
.
Println
(
"Got here"
)
if
!
driver
.
BareMetal
(
driverName
)
{
if
!
driver
.
BareMetal
(
driverName
)
&&
!
driver
.
IsKIC
(
driverName
)
{
if
err
:=
cluster
.
CacheISO
(
config
);
err
!=
nil
{
exit
.
WithError
(
"Failed to cache ISO"
,
err
)
}
...
...
@@ -341,6 +340,7 @@ func runStart(cmd *cobra.Command, args []string) {
// exits here in case of --download-only option.
handleDownloadOnly
(
&
cacheGroup
,
k8sVersion
)
mRunner
,
preExists
,
machineAPI
,
host
:=
startMachine
(
&
config
)
fmt
.
Println
(
"After startMachine &config"
)
defer
machineAPI
.
Close
()
// configure the runtime (docker, containerd, crio)
cr
:=
configureRuntimes
(
mRunner
,
driverName
,
config
.
KubernetesConfig
)
...
...
@@ -478,12 +478,16 @@ func startMachine(config *cfg.MachineConfig) (runner command.Runner, preExists b
exit
.
WithError
(
"Failed to get machine client"
,
err
)
}
host
,
preExists
=
startHost
(
m
,
*
config
)
fmt
.
Println
(
"after startHost(m, *config)"
)
runner
,
err
=
machine
.
CommandRunner
(
host
)
if
err
!=
nil
{
exit
.
WithError
(
"Failed to get command runner"
,
err
)
}
fmt
.
Println
(
"after machine.CommandRunner(host)"
)
ip
:=
validateNetwork
(
host
,
runner
)
fmt
.
Println
(
"after validateNetwork"
)
// Bypass proxy for minikube's vm host ip
err
=
proxy
.
ExcludeIP
(
ip
)
if
err
!=
nil
{
...
...
@@ -977,6 +981,12 @@ func autoSetDriverOptions(cmd *cobra.Command, drvName string) error {
glog
.
Infof
(
"auto set container runtime to %s for kic driver."
,
hints
.
ContainerRuntime
)
}
if
!
cmd
.
Flags
()
.
Changed
(
"bootstrapper"
)
&&
hints
.
Bootstrapper
!=
""
{
viper
.
Set
(
cmdcfg
.
Bootstrapper
,
hints
.
Bootstrapper
)
glog
.
Infof
(
"auto set bootstrapper to %s for kic driver."
,
hints
.
Bootstrapper
)
}
return
nil
}
...
...
pkg/drivers/kic/kic.go
浏览文件 @
2243847f
...
...
@@ -90,7 +90,7 @@ func (d *Driver) Create() error {
_
,
err
:=
node
.
CreateNode
(
params
)
if
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"create kic
from spec
"
)
return
errors
.
Wrap
(
err
,
"create kic
node
"
)
}
return
nil
}
...
...
pkg/minikube/bootstrapper/bootstrapper.go
浏览文件 @
2243847f
...
...
@@ -51,6 +51,7 @@ type Bootstrapper interface {
const
(
// BootstrapperTypeKubeadm is the kubeadm bootstrapper type
BootstrapperTypeKubeadm
=
"kubeadm"
BootstrapperTypeKICBS
=
"kicbs"
)
// GetCachedBinaryList returns the list of binaries
...
...
@@ -68,6 +69,8 @@ func GetCachedImageList(imageRepository string, version string, bootstrapper str
switch
bootstrapper
{
case
BootstrapperTypeKubeadm
:
return
images
.
Kubeadm
(
imageRepository
,
version
)
case
BootstrapperTypeKICBS
:
return
[]
string
{
"alpine"
},
nil
// for testing purpose just caching alpine for kicbs
default
:
return
[]
string
{},
nil
}
...
...
pkg/minikube/driver/driver.go
浏览文件 @
2243847f
...
...
@@ -22,6 +22,7 @@ import (
"sort"
"github.com/golang/glog"
"k8s.io/minikube/pkg/minikube/bootstrapper"
"k8s.io/minikube/pkg/minikube/registry"
)
...
...
@@ -68,6 +69,11 @@ func Supported(name string) bool {
return
false
}
// IsKIC checks if the driver is a kubernetes in continer
func
IsKIC
(
name
string
)
bool
{
return
name
==
KicDocker
}
// BareMetal returns if this driver is unisolated
func
BareMetal
(
name
string
)
bool
{
return
name
==
None
||
name
==
Mock
...
...
@@ -78,6 +84,7 @@ type FlagHints struct {
ExtraOptions
string
CacheImages
bool
ContainerRuntime
string
Bootstrapper
string
}
// FlagDefaults returns suggested defaults based on a driver
...
...
@@ -87,6 +94,7 @@ func FlagDefaults(name string) FlagHints {
// only for kic, till other run-times are available we auto-set containerd.
if
name
==
KicDocker
{
fh
.
ContainerRuntime
=
"containerd"
fh
.
Bootstrapper
=
bootstrapper
.
BootstrapperTypeKICBS
}
return
fh
}
...
...
pkg/minikube/machine/client.go
浏览文件 @
2243847f
...
...
@@ -153,6 +153,9 @@ func CommandRunner(h *host.Host) (command.Runner, error) {
if
driver
.
BareMetal
(
h
.
Driver
.
DriverName
())
{
return
&
command
.
ExecRunner
{},
nil
}
if
h
.
Driver
.
DriverName
()
==
driver
.
KicDocker
{
return
command
.
NewKICRunner
(
h
.
Name
,
"docker"
),
nil
}
client
,
err
:=
sshutil
.
NewSSHClient
(
h
.
Driver
)
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"getting ssh client for bootstrapper"
)
...
...
@@ -204,7 +207,7 @@ func (api *LocalClient) Create(h *host.Host) error {
{
"provisioning"
,
func
()
error
{
if
driver
.
BareMetal
(
h
.
Driver
.
DriverName
())
{
if
driver
.
BareMetal
(
h
.
Driver
.
DriverName
())
||
driver
.
IsKIC
(
h
.
Driver
.
DriverName
())
{
return
nil
}
pv
:=
provision
.
NewBuildrootProvisioner
(
h
.
Driver
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录