Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
44882191
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 搜索 >>
未验证
提交
44882191
编写于
7月 08, 2016
作者:
J
Jimmi Dyson
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Make disk size configurable
上级
6e9e757a
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
53 addition
and
2 deletion
+53
-2
cmd/minikube/cmd/flags.go
cmd/minikube/cmd/flags.go
+40
-0
cmd/minikube/cmd/start.go
cmd/minikube/cmd/start.go
+7
-0
docs/minikube_start.md
docs/minikube_start.md
+1
-0
pkg/minikube/cluster/cluster.go
pkg/minikube/cluster/cluster.go
+2
-0
pkg/minikube/cluster/cluster_darwin.go
pkg/minikube/cluster/cluster_darwin.go
+1
-1
pkg/minikube/cluster/cluster_linux.go
pkg/minikube/cluster/cluster_linux.go
+1
-1
pkg/minikube/constants/constants.go
pkg/minikube/constants/constants.go
+1
-0
未找到文件。
cmd/minikube/cmd/flags.go
0 → 100644
浏览文件 @
44882191
/*
Copyright 2016 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
cmd
import
"github.com/docker/go-units"
// unitValue represents an int64 flag specified with units as a string.
type
unitValue
int64
func
newUnitValue
(
v
int64
)
*
unitValue
{
return
(
*
unitValue
)(
&
v
)
}
func
(
u
*
unitValue
)
Set
(
s
string
)
error
{
v
,
err
:=
units
.
FromHumanSize
(
s
)
*
u
=
unitValue
(
v
)
return
err
}
func
(
u
*
unitValue
)
Type
()
string
{
return
"unit"
}
func
(
u
*
unitValue
)
String
()
string
{
return
units
.
HumanSize
(
float64
(
*
u
))
}
cmd/minikube/cmd/start.go
浏览文件 @
44882191
...
...
@@ -22,6 +22,7 @@ import (
"strconv"
"strings"
"github.com/docker/go-units"
"github.com/docker/machine/libmachine"
"github.com/docker/machine/libmachine/host"
"github.com/golang/glog"
...
...
@@ -37,6 +38,7 @@ var (
minikubeISO
string
memory
int
cpus
int
disk
=
newUnitValue
(
20
*
units
.
GB
)
vmDriver
string
)
...
...
@@ -58,9 +60,12 @@ func runStart(cmd *cobra.Command, args []string) {
MinikubeISO
:
minikubeISO
,
Memory
:
memory
,
CPUs
:
cpus
,
DiskSize
:
int
(
*
disk
/
units
.
MB
),
VMDriver
:
vmDriver
,
}
fmt
.
Println
(
config
.
DiskSize
)
var
host
*
host
.
Host
start
:=
func
()
(
err
error
)
{
host
,
err
=
cluster
.
StartHost
(
api
,
config
)
...
...
@@ -154,5 +159,7 @@ func init() {
startCmd
.
Flags
()
.
StringVarP
(
&
vmDriver
,
"vm-driver"
,
""
,
constants
.
DefaultVMDriver
,
fmt
.
Sprintf
(
"VM driver is one of: %v"
,
constants
.
SupportedVMDrivers
))
startCmd
.
Flags
()
.
IntVarP
(
&
memory
,
"memory"
,
""
,
constants
.
DefaultMemory
,
"Amount of RAM allocated to the minikube VM"
)
startCmd
.
Flags
()
.
IntVarP
(
&
cpus
,
"cpus"
,
""
,
constants
.
DefaultCPUS
,
"Number of CPUs allocated to the minikube VM"
)
diskFlag
:=
startCmd
.
Flags
()
.
VarPF
(
disk
,
"disk-size"
,
""
,
"Disk size allocated to the minikube VM (format: <number>[<unit>], where unit = b, k, m or g)"
)
diskFlag
.
DefValue
=
constants
.
DefaultDiskSize
RootCmd
.
AddCommand
(
startCmd
)
}
docs/minikube_start.md
浏览文件 @
44882191
...
...
@@ -16,6 +16,7 @@ minikube start
```
--cpus=1: Number of CPUs allocated to the minikube VM
--disk-size=20g: Disk size allocated to the minikube VM (format: <number>[<unit>], where unit = b, k, m or g)
--iso-url="https://storage.googleapis.com/minikube/minikube-0.5.iso": Location of the minikube iso
--memory=1024: Amount of RAM allocated to the minikube VM
--vm-driver="virtualbox": VM driver is one of: [virtualbox vmwarefusion kvm xhyve]
...
...
pkg/minikube/cluster/cluster.go
浏览文件 @
44882191
...
...
@@ -161,6 +161,7 @@ type MachineConfig struct {
MinikubeISO
string
Memory
int
CPUs
int
DiskSize
int
VMDriver
string
}
...
...
@@ -277,6 +278,7 @@ func createHost(api libmachine.API, config MachineConfig) (*host.Host, error) {
d
.
Boot2DockerURL
=
config
.
MinikubeISO
d
.
Memory
=
config
.
Memory
d
.
CPU
=
config
.
CPUs
d
.
DiskSize
=
int
(
config
.
DiskSize
)
driver
=
d
case
"vmwarefusion"
:
driver
=
createVMwareFusionHost
(
config
)
...
...
pkg/minikube/cluster/cluster_darwin.go
浏览文件 @
44882191
...
...
@@ -61,6 +61,6 @@ func createXhyveHost(config MachineConfig) *xhyveDriver {
CPU
:
config
.
CPUs
,
Boot2DockerURL
:
config
.
MinikubeISO
,
BootCmd
:
"loglevel=3 user=docker console=ttyS0 console=tty0 noembed nomodeset norestore waitusb=10 base host=boot2docker"
,
DiskSize
:
20000
,
DiskSize
:
int64
(
config
.
DiskSize
)
,
}
}
pkg/minikube/cluster/cluster_linux.go
浏览文件 @
44882191
...
...
@@ -50,7 +50,7 @@ func createKVMHost(config MachineConfig) *kvmDriver {
Network
:
"default"
,
PrivateNetwork
:
"docker-machines"
,
Boot2DockerURL
:
config
.
MinikubeISO
,
DiskSize
:
20000
,
DiskSize
:
config
.
DiskSize
,
DiskPath
:
filepath
.
Join
(
constants
.
Minipath
,
"machines"
,
constants
.
MachineName
,
fmt
.
Sprintf
(
"%s.img"
,
constants
.
MachineName
)),
ISO
:
filepath
.
Join
(
constants
.
Minipath
,
"machines"
,
constants
.
MachineName
,
"boot2docker.iso"
),
CacheMode
:
"default"
,
...
...
pkg/minikube/constants/constants.go
浏览文件 @
44882191
...
...
@@ -61,6 +61,7 @@ const (
DefaultIsoUrl
=
"https://storage.googleapis.com/minikube/minikube-0.5.iso"
DefaultMemory
=
1024
DefaultCPUS
=
1
DefaultDiskSize
=
"20g"
DefaultVMDriver
=
"virtualbox"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录