Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
789610bb
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,体验更适合开发者的 AI 搜索 >>
提交
789610bb
编写于
12月 11, 2020
作者:
T
Thomas Stromberg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Log warning if br_netfilter cannot be enabled rather than fatally exiting
上级
4cd3c7bd
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
19 deletion
+20
-19
pkg/minikube/cruntime/crio.go
pkg/minikube/cruntime/crio.go
+20
-0
pkg/minikube/cruntime/cruntime.go
pkg/minikube/cruntime/cruntime.go
+0
-19
未找到文件。
pkg/minikube/cruntime/crio.go
浏览文件 @
789610bb
...
@@ -109,6 +109,26 @@ func (r *CRIO) Active() bool {
...
@@ -109,6 +109,26 @@ func (r *CRIO) Active() bool {
return
r
.
Init
.
Active
(
"crio"
)
return
r
.
Init
.
Active
(
"crio"
)
}
}
// enableIPForwarding configures IP forwarding, which is handled normally by Docker
// Context: https://github.com/kubernetes/kubeadm/issues/1062
func
enableIPForwarding
(
cr
CommandRunner
)
error
{
// The bridge-netfilter module enables iptables rules to work on Linux bridges
// NOTE: br_netfilter isn't available in WSL2, but forwarding works fine there anyways
c
:=
exec
.
Command
(
"sudo"
,
"sysctl"
,
"net.bridge.bridge-nf-call-iptables"
)
if
rr
,
err
:=
cr
.
RunCmd
(
c
);
err
!=
nil
{
klog
.
Infof
(
"couldn't verify netfilter by %q which might be okay. error: %v"
,
rr
.
Command
(),
err
)
c
=
exec
.
Command
(
"sudo"
,
"modprobe"
,
"br_netfilter"
)
if
_
,
err
:=
cr
.
RunCmd
(
c
);
err
!=
nil
{
klog
.
Warningf
(
"%q failed, which may be ok: %v"
,
rr
.
Command
(),
err
)
}
}
c
=
exec
.
Command
(
"sudo"
,
"sh"
,
"-c"
,
"echo 1 > /proc/sys/net/ipv4/ip_forward"
)
if
_
,
err
:=
cr
.
RunCmd
(
c
);
err
!=
nil
{
return
errors
.
Wrapf
(
err
,
"ip_forward"
)
}
return
nil
}
// Enable idempotently enables CRIO on a host
// Enable idempotently enables CRIO on a host
func
(
r
*
CRIO
)
Enable
(
disOthers
,
_
bool
)
error
{
func
(
r
*
CRIO
)
Enable
(
disOthers
,
_
bool
)
error
{
if
disOthers
{
if
disOthers
{
...
...
pkg/minikube/cruntime/cruntime.go
浏览文件 @
789610bb
...
@@ -22,7 +22,6 @@ import (
...
@@ -22,7 +22,6 @@ import (
"os/exec"
"os/exec"
"github.com/blang/semver"
"github.com/blang/semver"
"github.com/pkg/errors"
"k8s.io/klog/v2"
"k8s.io/klog/v2"
"k8s.io/minikube/pkg/minikube/assets"
"k8s.io/minikube/pkg/minikube/assets"
"k8s.io/minikube/pkg/minikube/command"
"k8s.io/minikube/pkg/minikube/command"
...
@@ -210,21 +209,3 @@ func disableOthers(me Manager, cr CommandRunner) error {
...
@@ -210,21 +209,3 @@ func disableOthers(me Manager, cr CommandRunner) error {
}
}
return
nil
return
nil
}
}
// enableIPForwarding configures IP forwarding, which is handled normally by Docker
// Context: https://github.com/kubernetes/kubeadm/issues/1062
func
enableIPForwarding
(
cr
CommandRunner
)
error
{
c
:=
exec
.
Command
(
"sudo"
,
"sysctl"
,
"net.bridge.bridge-nf-call-iptables"
)
if
rr
,
err
:=
cr
.
RunCmd
(
c
);
err
!=
nil
{
klog
.
Infof
(
"couldn't verify netfilter by %q which might be okay. error: %v"
,
rr
.
Command
(),
err
)
c
=
exec
.
Command
(
"sudo"
,
"modprobe"
,
"br_netfilter"
)
if
_
,
err
:=
cr
.
RunCmd
(
c
);
err
!=
nil
{
return
errors
.
Wrapf
(
err
,
"br_netfilter"
)
}
}
c
=
exec
.
Command
(
"sudo"
,
"sh"
,
"-c"
,
"echo 1 > /proc/sys/net/ipv4/ip_forward"
)
if
_
,
err
:=
cr
.
RunCmd
(
c
);
err
!=
nil
{
return
errors
.
Wrapf
(
err
,
"ip_forward"
)
}
return
nil
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录