Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
0cace432
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,发现更多精彩内容 >>
未验证
提交
0cace432
编写于
2月 11, 2019
作者:
T
Thomas Strömberg
提交者:
GitHub
2月 11, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #3617 from afbjorklund/defaults
Enable CNI for alternative runtimes
上级
6e1b9d03
73dd0068
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
43 addition
and
26 deletion
+43
-26
cmd/minikube/cmd/config/validations.go
cmd/minikube/cmd/config/validations.go
+1
-1
cmd/minikube/cmd/start.go
cmd/minikube/cmd/start.go
+17
-3
deploy/addons/gvisor/README.md
deploy/addons/gvisor/README.md
+1
-2
docs/alternative_runtimes.md
docs/alternative_runtimes.md
+5
-16
docs/contributors/minikube_iso.md
docs/contributors/minikube_iso.md
+0
-2
pkg/minikube/cruntime/containerd.go
pkg/minikube/cruntime/containerd.go
+5
-0
pkg/minikube/cruntime/crio.go
pkg/minikube/cruntime/crio.go
+5
-0
pkg/minikube/cruntime/cruntime.go
pkg/minikube/cruntime/cruntime.go
+2
-0
pkg/minikube/cruntime/docker.go
pkg/minikube/cruntime/docker.go
+5
-0
test/integration/util/util.go
test/integration/util/util.go
+2
-2
未找到文件。
cmd/minikube/cmd/config/validations.go
浏览文件 @
0cace432
...
...
@@ -149,7 +149,7 @@ minikube stop
and then start minikube again with the following flags:
minikube start --container-runtime=containerd
--docker-opt containerd=/var/run/containerd/containerd.sock --network-plugin=cni
`
)
minikube start --container-runtime=containerd
--docker-opt containerd=/var/run/containerd/containerd.sock
`
)
}
return
nil
...
...
cmd/minikube/cmd/start.go
浏览文件 @
0cace432
...
...
@@ -204,6 +204,21 @@ func runStart(cmd *cobra.Command, args []string) {
cmdutil
.
MaybeReportErrorAndExit
(
err
)
}
selectedContainerRuntime
:=
viper
.
GetString
(
containerRuntime
)
selectedNetworkPlugin
:=
viper
.
GetString
(
networkPlugin
)
selectedEnableDefaultCNI
:=
viper
.
GetBool
(
enableDefaultCNI
)
// default network plugin (cni)
r
,
err
:=
cruntime
.
New
(
cruntime
.
Config
{
Type
:
selectedContainerRuntime
})
if
err
==
nil
&&
r
.
DefaultCNI
()
{
if
!
cmd
.
Flags
()
.
Changed
(
networkPlugin
)
{
selectedNetworkPlugin
=
"cni"
if
!
cmd
.
Flags
()
.
Changed
(
enableDefaultCNI
)
{
selectedEnableDefaultCNI
=
true
}
}
}
selectedKubernetesVersion
:=
viper
.
GetString
(
kubernetesVersion
)
if
strings
.
Compare
(
selectedKubernetesVersion
,
""
)
==
0
{
selectedKubernetesVersion
=
constants
.
DefaultKubernetesVersion
...
...
@@ -226,7 +241,6 @@ func runStart(cmd *cobra.Command, args []string) {
}
}
selectedContainerRuntime
:=
viper
.
GetString
(
containerRuntime
)
kubernetesConfig
:=
cfg
.
KubernetesConfig
{
KubernetesVersion
:
selectedKubernetesVersion
,
NodeIP
:
ip
,
...
...
@@ -239,11 +253,11 @@ func runStart(cmd *cobra.Command, args []string) {
FeatureGates
:
viper
.
GetString
(
featureGates
),
ContainerRuntime
:
selectedContainerRuntime
,
CRISocket
:
viper
.
GetString
(
criSocket
),
NetworkPlugin
:
viper
.
GetString
(
networkPlugin
)
,
NetworkPlugin
:
selectedNetworkPlugin
,
ServiceCIDR
:
viper
.
GetString
(
serviceCIDR
),
ExtraOptions
:
extraOptions
,
ShouldLoadCachedImages
:
shouldCacheImages
,
EnableDefaultCNI
:
viper
.
GetBool
(
enableDefaultCNI
)
,
EnableDefaultCNI
:
selectedEnableDefaultCNI
,
}
// Write profile cluster configuration to file
...
...
deploy/addons/gvisor/README.md
浏览文件 @
0cace432
...
...
@@ -7,8 +7,7 @@ When starting minikube, specify the following flags, along with any additional d
```
shell
$
minikube start
--container-runtime
=
containerd
\
--docker-opt
containerd
=
/var/run/containerd/containerd.sock
\
--network-plugin
=
cni
--enable-default-cni
--docker-opt
containerd
=
/var/run/containerd/containerd.sock
```
### Enabling gVisor
...
...
docs/alternative_runtimes.md
浏览文件 @
0cace432
...
...
@@ -3,10 +3,7 @@
To use
[
rkt
](
https://github.com/coreos/rkt
)
as the container runtime run:
```
shell
$
minikube start
\
--network-plugin
=
cni
\
--enable-default-cni
\
--container-runtime
=
rkt
$
minikube start
--container-runtime
=
rkt
```
...
...
@@ -15,19 +12,15 @@ $ minikube start \
To use
[
CRI-O
](
https://github.com/kubernetes-incubator/cri-o
)
as the container runtime, run:
```
shell
$
minikube start
\
--network-plugin
=
cni
\
--enable-default-cni
\
--container-runtime
=
cri-o
$
minikube start
--container-runtime
=
cri-o
```
Or you can use the extended version:
```
shell
$
minikube start
\
$
minikube start
--container-runtime
=
cri-o
\
--network-plugin
=
cni
\
--enable-default-cni
\
--container-runtime
=
cri-o
\
--cri-socket
=
/var/run/crio/crio.sock
\
--extra-config
=
kubelet.container-runtime
=
remote
\
--extra-config
=
kubelet.container-runtime-endpoint
=
unix:///var/run/crio/crio.sock
\
...
...
@@ -39,19 +32,15 @@ $ minikube start \
To use
[
containerd
](
https://github.com/containerd/containerd
)
as the container runtime, run:
```
shell
$
minikube start
\
--network-plugin
=
cni
\
--enable-default-cni
\
--container-runtime
=
containerd
$
minikube start
--container-runtime
=
containerd
```
Or you can use the extended version:
```
shell
$
minikube start
\
$
minikube start
--container-runtime
=
containerd
\
--network-plugin
=
cni
\
--enable-default-cni
\
--container-runtime
=
containerd
\
--cri-socket
=
/run/containerd/containerd.sock
\
--extra-config
=
kubelet.container-runtime
=
remote
\
--extra-config
=
kubelet.container-runtime-endpoint
=
unix:///run/containerd/containerd.sock
\
...
...
docs/contributors/minikube_iso.md
浏览文件 @
0cace432
...
...
@@ -39,8 +39,6 @@ The bootable ISO image will be available in `out/minikube.iso`.
```
shell
$
./out/minikube start
\
--container-runtime
=
rkt
\
--network-plugin
=
cni
\
--enable-default-cni
\
--iso-url
=
file://
$GOPATH
/src/k8s.io/minikube/out/minikube.iso
```
...
...
pkg/minikube/cruntime/containerd.go
浏览文件 @
0cace432
...
...
@@ -41,6 +41,11 @@ func (r *Containerd) SocketPath() string {
return
"/run/containerd/containerd.sock"
}
// DefaultCNI returns whether to use CNI networking by default
func
(
r
*
Containerd
)
DefaultCNI
()
bool
{
return
true
}
// Active returns if containerd is active on the host
func
(
r
*
Containerd
)
Active
()
bool
{
err
:=
r
.
Runner
.
Run
(
"systemctl is-active --quiet service containerd"
)
...
...
pkg/minikube/cruntime/crio.go
浏览文件 @
0cace432
...
...
@@ -41,6 +41,11 @@ func (r *CRIO) SocketPath() string {
return
"/var/run/crio/crio.sock"
}
// DefaultCNI returns whether to use CNI networking by default
func
(
r
*
CRIO
)
DefaultCNI
()
bool
{
return
true
}
// Available returns an error if it is not possible to use this runtime on a host
func
(
r
*
CRIO
)
Available
()
error
{
return
r
.
Runner
.
Run
(
"command -v crio"
)
...
...
pkg/minikube/cruntime/cruntime.go
浏览文件 @
0cace432
...
...
@@ -49,6 +49,8 @@ type Manager interface {
KubeletOptions
()
map
[
string
]
string
// SocketPath returns the path to the socket file for a given runtime
SocketPath
()
string
// DefaultCNI returns whether to use CNI networking by default
DefaultCNI
()
bool
// Load an image idempotently into the runtime on a host
LoadImage
(
string
)
error
...
...
pkg/minikube/cruntime/docker.go
浏览文件 @
0cace432
...
...
@@ -40,6 +40,11 @@ func (r *Docker) SocketPath() string {
return
r
.
Socket
}
// DefaultCNI returns whether to use CNI networking by default
func
(
r
*
Docker
)
DefaultCNI
()
bool
{
return
false
}
// Available returns an error if it is not possible to use this runtime on a host
func
(
r
*
Docker
)
Available
()
error
{
_
,
err
:=
exec
.
LookPath
(
"docker"
)
...
...
test/integration/util/util.go
浏览文件 @
0cace432
...
...
@@ -207,9 +207,9 @@ func (m *MinikubeRunner) Start() {
// TODO(tstromberg): Deprecate this in favor of making it possible for tests to define explicit flags.
switch
r
:=
m
.
Runtime
;
r
{
case
"containerd"
:
opts
=
"--container-runtime=containerd --
network-plugin=cni --enable-default-cni --
docker-opt containerd=/var/run/containerd/containerd.sock"
opts
=
"--container-runtime=containerd --docker-opt containerd=/var/run/containerd/containerd.sock"
case
"crio"
:
opts
=
"--container-runtime=crio
--network-plugin=cni --enable-default-cni
"
opts
=
"--container-runtime=crio"
}
m
.
RunCommand
(
fmt
.
Sprintf
(
"start %s %s %s --alsologtostderr --v=5"
,
m
.
StartArgs
,
m
.
Args
,
opts
),
true
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录