Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
b3404a70
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,发现更多精彩内容 >>
提交
b3404a70
编写于
1月 24, 2020
作者:
M
Medya Gh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
patch node refactor for kic
上级
13ca283b
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
25 addition
and
13 deletion
+25
-13
pkg/drivers/kic/oci/oci.go
pkg/drivers/kic/oci/oci.go
+1
-1
pkg/minikube/bootstrapper/kubeadm/kubeadm.go
pkg/minikube/bootstrapper/kubeadm/kubeadm.go
+17
-6
pkg/minikube/registry/drvs/docker/docker.go
pkg/minikube/registry/drvs/docker/docker.go
+7
-6
未找到文件。
pkg/drivers/kic/oci/oci.go
浏览文件 @
b3404a70
...
@@ -400,7 +400,7 @@ func HostPortBinding(ociBinary string, ociID string, contPort int) (int, error)
...
@@ -400,7 +400,7 @@ func HostPortBinding(ociBinary string, ociID string, contPort int) (int, error)
cmd
:=
exec
.
Command
(
ociBinary
,
"inspect"
,
"-f"
,
fmt
.
Sprintf
(
"'{{(index (index .NetworkSettings.Ports
\"
%d/tcp
\"
) 0).HostPort}}'"
,
contPort
),
ociID
)
cmd
:=
exec
.
Command
(
ociBinary
,
"inspect"
,
"-f"
,
fmt
.
Sprintf
(
"'{{(index (index .NetworkSettings.Ports
\"
%d/tcp
\"
) 0).HostPort}}'"
,
contPort
),
ociID
)
out
,
err
:=
cmd
.
CombinedOutput
()
out
,
err
:=
cmd
.
CombinedOutput
()
if
err
!=
nil
{
if
err
!=
nil
{
return
0
,
errors
.
Wrapf
(
err
,
"getting host-bind port %
q for container ID %q"
,
contPort
,
ociID
)
return
0
,
errors
.
Wrapf
(
err
,
"getting host-bind port %
d for container ID %q, output %s"
,
contPort
,
ociID
,
out
)
}
}
o
:=
strings
.
Trim
(
string
(
out
),
"
\n
"
)
o
:=
strings
.
Trim
(
string
(
out
),
"
\n
"
)
o
=
strings
.
Trim
(
o
,
"'"
)
o
=
strings
.
Trim
(
o
,
"'"
)
...
...
pkg/minikube/bootstrapper/kubeadm/kubeadm.go
浏览文件 @
b3404a70
...
@@ -39,6 +39,7 @@ import (
...
@@ -39,6 +39,7 @@ import (
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes"
kconst
"k8s.io/kubernetes/cmd/kubeadm/app/constants"
kconst
"k8s.io/kubernetes/cmd/kubeadm/app/constants"
"k8s.io/minikube/pkg/drivers/kic"
"k8s.io/minikube/pkg/drivers/kic"
"k8s.io/minikube/pkg/drivers/kic/oci"
"k8s.io/minikube/pkg/kapi"
"k8s.io/minikube/pkg/kapi"
"k8s.io/minikube/pkg/minikube/assets"
"k8s.io/minikube/pkg/minikube/assets"
"k8s.io/minikube/pkg/minikube/bootstrapper"
"k8s.io/minikube/pkg/minikube/bootstrapper"
...
@@ -249,7 +250,7 @@ func (k *Bootstrapper) StartCluster(cfg config.MachineConfig) error {
...
@@ -249,7 +250,7 @@ func (k *Bootstrapper) StartCluster(cfg config.MachineConfig) error {
if
!
driver
.
IsKIC
(
cfg
.
VMDriver
)
{
// TODO: skip for both after verifications https://github.com/kubernetes/minikube/issues/6239
if
!
driver
.
IsKIC
(
cfg
.
VMDriver
)
{
// TODO: skip for both after verifications https://github.com/kubernetes/minikube/issues/6239
glog
.
Infof
(
"Configuring cluster permissions ..."
)
glog
.
Infof
(
"Configuring cluster permissions ..."
)
elevate
:=
func
()
error
{
elevate
:=
func
()
error
{
client
,
err
:=
k
.
client
(
cp
)
client
,
err
:=
k
.
client
(
cp
.
IP
,
cp
.
Port
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
...
@@ -269,7 +270,7 @@ func (k *Bootstrapper) StartCluster(cfg config.MachineConfig) error {
...
@@ -269,7 +270,7 @@ func (k *Bootstrapper) StartCluster(cfg config.MachineConfig) error {
}
}
// client sets and returns a Kubernetes client to use to speak to a kubeadm launched apiserver
// client sets and returns a Kubernetes client to use to speak to a kubeadm launched apiserver
func
(
k
*
Bootstrapper
)
client
(
n
config
.
Node
)
(
*
kubernetes
.
Clientset
,
error
)
{
func
(
k
*
Bootstrapper
)
client
(
ip
string
,
port
int
)
(
*
kubernetes
.
Clientset
,
error
)
{
if
k
.
k8sClient
!=
nil
{
if
k
.
k8sClient
!=
nil
{
return
k
.
k8sClient
,
nil
return
k
.
k8sClient
,
nil
}
}
...
@@ -279,7 +280,7 @@ func (k *Bootstrapper) client(n config.Node) (*kubernetes.Clientset, error) {
...
@@ -279,7 +280,7 @@ func (k *Bootstrapper) client(n config.Node) (*kubernetes.Clientset, error) {
return
nil
,
errors
.
Wrap
(
err
,
"client config"
)
return
nil
,
errors
.
Wrap
(
err
,
"client config"
)
}
}
endpoint
:=
fmt
.
Sprintf
(
"https://%s"
,
net
.
JoinHostPort
(
n
.
IP
,
strconv
.
Itoa
(
n
.
P
ort
)))
endpoint
:=
fmt
.
Sprintf
(
"https://%s"
,
net
.
JoinHostPort
(
ip
,
strconv
.
Itoa
(
p
ort
)))
if
cc
.
Host
!=
endpoint
{
if
cc
.
Host
!=
endpoint
{
glog
.
Errorf
(
"Overriding stale ClientConfig host %s with %s"
,
cc
.
Host
,
endpoint
)
glog
.
Errorf
(
"Overriding stale ClientConfig host %s with %s"
,
cc
.
Host
,
endpoint
)
cc
.
Host
=
endpoint
cc
.
Host
=
endpoint
...
@@ -302,11 +303,21 @@ func (k *Bootstrapper) WaitForCluster(cfg config.MachineConfig, timeout time.Dur
...
@@ -302,11 +303,21 @@ func (k *Bootstrapper) WaitForCluster(cfg config.MachineConfig, timeout time.Dur
if
err
:=
kverify
.
APIServerProcess
(
k
.
c
,
start
,
timeout
);
err
!=
nil
{
if
err
:=
kverify
.
APIServerProcess
(
k
.
c
,
start
,
timeout
);
err
!=
nil
{
return
err
return
err
}
}
if
err
:=
kverify
.
APIServerIsRunning
(
start
,
cp
.
IP
,
cp
.
Port
,
timeout
);
err
!=
nil
{
ip
:=
cp
.
IP
port
:=
cp
.
Port
if
driver
.
IsKIC
(
cfg
.
VMDriver
)
{
ip
=
kic
.
DefaultBindIPV4
port
,
err
=
oci
.
HostPortBinding
(
cfg
.
VMDriver
,
cfg
.
Name
,
port
)
if
err
!=
nil
{
return
errors
.
Wrapf
(
err
,
"get host-bind port %d for container %s"
,
port
,
cfg
.
Name
)
}
}
if
err
:=
kverify
.
APIServerIsRunning
(
start
,
ip
,
port
,
timeout
);
err
!=
nil
{
return
err
return
err
}
}
c
,
err
:=
k
.
client
(
cp
)
c
,
err
:=
k
.
client
(
ip
,
port
)
if
err
!=
nil
{
if
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"get k8s client"
)
return
errors
.
Wrap
(
err
,
"get k8s client"
)
}
}
...
@@ -361,7 +372,7 @@ func (k *Bootstrapper) restartCluster(cfg config.MachineConfig) error {
...
@@ -361,7 +372,7 @@ func (k *Bootstrapper) restartCluster(cfg config.MachineConfig) error {
}
}
for
_
,
n
:=
range
cfg
.
Nodes
{
for
_
,
n
:=
range
cfg
.
Nodes
{
client
,
err
:=
k
.
client
(
n
)
client
,
err
:=
k
.
client
(
n
.
IP
,
n
.
Port
)
if
err
!=
nil
{
if
err
!=
nil
{
return
errors
.
Wrap
(
err
,
"getting k8s client"
)
return
errors
.
Wrap
(
err
,
"getting k8s client"
)
}
}
...
...
pkg/minikube/registry/drvs/docker/docker.go
浏览文件 @
b3404a70
...
@@ -43,12 +43,13 @@ func init() {
...
@@ -43,12 +43,13 @@ func init() {
func
configure
(
mc
config
.
MachineConfig
)
interface
{}
{
func
configure
(
mc
config
.
MachineConfig
)
interface
{}
{
return
kic
.
NewDriver
(
kic
.
Config
{
return
kic
.
NewDriver
(
kic
.
Config
{
MachineName
:
mc
.
Name
,
MachineName
:
mc
.
Name
,
StorePath
:
localpath
.
MiniPath
(),
StorePath
:
localpath
.
MiniPath
(),
ImageDigest
:
kic
.
BaseImage
,
ImageDigest
:
kic
.
BaseImage
,
CPU
:
mc
.
CPUs
,
CPU
:
mc
.
CPUs
,
Memory
:
mc
.
Memory
,
Memory
:
mc
.
Memory
,
OCIBinary
:
oci
.
Docker
,
OCIBinary
:
oci
.
Docker
,
APIServerPort
:
mc
.
Nodes
[
0
]
.
Port
,
})
})
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录