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
bc6bacd3
Commit
bc6bacd3
authored
Aug 02, 2019
by
David Zhu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce GCE PD Attach Limits by 1 because Node Boot Disk counts as 1 attached disk
parent
f6278300
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
gce_pd.go
pkg/volume/gcepd/gce_pd.go
+8
-5
No files found.
pkg/volume/gcepd/gce_pd.go
View file @
bc6bacd3
...
@@ -63,9 +63,12 @@ const (
...
@@ -63,9 +63,12 @@ const (
// The constants are used to map from the machine type (number of CPUs) to the limit of
// The constants are used to map from the machine type (number of CPUs) to the limit of
// persistent disks that can be attached to an instance. Please refer to gcloud doc
// 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
// https://cloud.google.com/compute/docs/disks/#increased_persistent_disk_limits
// These constants are all the documented attach limit minus one because the
// node boot disk is considered an attachable disk so effective attach limit is
// one less.
const
(
const
(
VolumeLimit16
=
16
volumeLimitSmall
=
15
VolumeLimit
128
=
128
VolumeLimit
Big
=
127
)
)
func
getPath
(
uid
types
.
UID
,
volName
string
,
host
volume
.
VolumeHost
)
string
{
func
getPath
(
uid
types
.
UID
,
volName
string
,
host
volume
.
VolumeHost
)
string
{
...
@@ -121,7 +124,7 @@ func (plugin *gcePersistentDiskPlugin) GetAccessModes() []v1.PersistentVolumeAcc
...
@@ -121,7 +124,7 @@ func (plugin *gcePersistentDiskPlugin) GetAccessModes() []v1.PersistentVolumeAcc
func
(
plugin
*
gcePersistentDiskPlugin
)
GetVolumeLimits
()
(
map
[
string
]
int64
,
error
)
{
func
(
plugin
*
gcePersistentDiskPlugin
)
GetVolumeLimits
()
(
map
[
string
]
int64
,
error
)
{
volumeLimits
:=
map
[
string
]
int64
{
volumeLimits
:=
map
[
string
]
int64
{
util
.
GCEVolumeLimitKey
:
VolumeLimit16
,
util
.
GCEVolumeLimitKey
:
volumeLimitSmall
,
}
}
cloud
:=
plugin
.
host
.
GetCloudProvider
()
cloud
:=
plugin
.
host
.
GetCloudProvider
()
...
@@ -149,9 +152,9 @@ func (plugin *gcePersistentDiskPlugin) GetVolumeLimits() (map[string]int64, erro
...
@@ -149,9 +152,9 @@ func (plugin *gcePersistentDiskPlugin) GetVolumeLimits() (map[string]int64, erro
return
volumeLimits
,
nil
return
volumeLimits
,
nil
}
}
if
strings
.
HasPrefix
(
instanceType
,
"n1-"
)
||
strings
.
HasPrefix
(
instanceType
,
"custom-"
)
{
if
strings
.
HasPrefix
(
instanceType
,
"n1-"
)
||
strings
.
HasPrefix
(
instanceType
,
"custom-"
)
{
volumeLimits
[
util
.
GCEVolumeLimitKey
]
=
VolumeLimit
128
volumeLimits
[
util
.
GCEVolumeLimitKey
]
=
VolumeLimit
Big
}
else
{
}
else
{
volumeLimits
[
util
.
GCEVolumeLimitKey
]
=
VolumeLimit16
volumeLimits
[
util
.
GCEVolumeLimitKey
]
=
volumeLimitSmall
}
}
return
volumeLimits
,
nil
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