Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
049611bc
Unverified
Commit
049611bc
authored
May 06, 2019
by
Kubernetes Prow Robot
Committed by
GitHub
May 06, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #77311 from jingxu97/automated-cherry-pick-of-#76977-upstream-release-1.14
Update the dynamic volume limit in GCE PD
parents
31c8497d
b01e2a38
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
19 deletions
+5
-19
gce_pd.go
pkg/volume/gcepd/gce_pd.go
+5
-19
No files found.
pkg/volume/gcepd/gce_pd.go
View file @
049611bc
...
...
@@ -64,11 +64,7 @@ const (
// persistent disks that can be attached to an instance. Please refer to gcloud doc
// https://cloud.google.com/compute/docs/disks/#increased_persistent_disk_limits
const
(
OneCPU
=
1
EightCPUs
=
8
VolumeLimit16
=
16
VolumeLimit32
=
32
VolumeLimit64
=
64
VolumeLimit128
=
128
)
...
...
@@ -152,22 +148,12 @@ func (plugin *gcePersistentDiskPlugin) GetVolumeLimits() (map[string]int64, erro
klog
.
Errorf
(
"Failed to get instance type from GCE cloud provider"
)
return
volumeLimits
,
nil
}
if
strings
.
HasPrefix
(
instanceType
,
"n1-"
)
{
splits
:=
strings
.
Split
(
instanceType
,
"-"
)
if
len
(
splits
)
<
3
{
return
volumeLimits
,
nil
}
last
:=
splits
[
2
]
if
num
,
err
:=
strconv
.
Atoi
(
last
);
err
==
nil
{
if
num
==
OneCPU
{
volumeLimits
[
util
.
GCEVolumeLimitKey
]
=
VolumeLimit32
}
else
if
num
<
EightCPUs
{
volumeLimits
[
util
.
GCEVolumeLimitKey
]
=
VolumeLimit64
}
else
{
volumeLimits
[
util
.
GCEVolumeLimitKey
]
=
VolumeLimit128
}
}
if
strings
.
HasPrefix
(
instanceType
,
"n1-"
)
||
strings
.
HasPrefix
(
instanceType
,
"custom-"
)
{
volumeLimits
[
util
.
GCEVolumeLimitKey
]
=
VolumeLimit128
}
else
{
volumeLimits
[
util
.
GCEVolumeLimitKey
]
=
VolumeLimit16
}
return
volumeLimits
,
nil
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment