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
179e5d70
Commit
179e5d70
authored
May 31, 2018
by
Hemant Kumar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename online resizine feature gate
parent
9fee771b
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
31 additions
and
31 deletions
+31
-31
kube_features.go
pkg/features/kube_features.go
+24
-24
actual_state_of_world.go
pkg/kubelet/volumemanager/cache/actual_state_of_world.go
+1
-1
desired_state_of_world_populator.go
...lumemanager/populator/desired_state_of_world_populator.go
+2
-2
desired_state_of_world_populator_test.go
...anager/populator/desired_state_of_world_populator_test.go
+2
-2
reconciler.go
pkg/kubelet/volumemanager/reconciler/reconciler.go
+1
-1
reconciler_test.go
pkg/kubelet/volumemanager/reconciler/reconciler_test.go
+1
-1
No files found.
pkg/features/kube_features.go
View file @
179e5d70
...
@@ -102,7 +102,7 @@ const (
...
@@ -102,7 +102,7 @@ const (
// owner: @mlmhl
// owner: @mlmhl
// alpha: v1.11
// alpha: v1.11
// Ability to expand persistent volumes' file system without unmounting volumes.
// Ability to expand persistent volumes' file system without unmounting volumes.
Expand
PersistentVolumesFSWithoutUnmounting
utilfeature
.
Feature
=
"ExpandPersistentVolumesFSWithoutUnmounting
"
Expand
InUsePersistentVolumes
utilfeature
.
Feature
=
"ExpandInUsePersistentVolumes
"
// owner: @verb
// owner: @verb
// alpha: v1.10
// alpha: v1.10
...
@@ -333,29 +333,29 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
...
@@ -333,29 +333,29 @@ var defaultKubernetesFeatureGates = map[utilfeature.Feature]utilfeature.FeatureS
MountPropagation
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
MountPropagation
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
QOSReserved
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
QOSReserved
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
ExpandPersistentVolumes
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
ExpandPersistentVolumes
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
Expand
PersistentVolumesFSWithoutUnmounting
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
Expand
InUsePersistentVolumes
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
CPUManager
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
CPUManager
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
ServiceNodeExclusion
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
ServiceNodeExclusion
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
MountContainers
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
MountContainers
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
VolumeScheduling
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
VolumeScheduling
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
CSIPersistentVolume
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
CSIPersistentVolume
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
CustomPodDNS
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
CustomPodDNS
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
BlockVolume
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
BlockVolume
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
StorageObjectInUseProtection
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
},
StorageObjectInUseProtection
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
},
ResourceLimitsPriorityFunction
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
ResourceLimitsPriorityFunction
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
SupportIPVSProxyMode
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
},
SupportIPVSProxyMode
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
},
SupportPodPidsLimit
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
SupportPodPidsLimit
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
HyperVContainer
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
HyperVContainer
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
ScheduleDaemonSetPods
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
ScheduleDaemonSetPods
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
TokenRequest
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
TokenRequest
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
TokenRequestProjection
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
TokenRequestProjection
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
CRIContainerLogRotation
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
CRIContainerLogRotation
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
GCERegionalPersistentDisk
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
GCERegionalPersistentDisk
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
Beta
},
RunAsGroup
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
RunAsGroup
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
VolumeSubpath
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
},
VolumeSubpath
:
{
Default
:
true
,
PreRelease
:
utilfeature
.
GA
},
BalanceAttachedNodeVolumes
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
BalanceAttachedNodeVolumes
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
DynamicProvisioningScheduling
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
DynamicProvisioningScheduling
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
VolumeSubpathEnvExpansion
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
VolumeSubpathEnvExpansion
:
{
Default
:
false
,
PreRelease
:
utilfeature
.
Alpha
},
// inherited features from generic apiserver, relisted here to get a conflict if it is changed
// inherited features from generic apiserver, relisted here to get a conflict if it is changed
// unintentionally on either side:
// unintentionally on either side:
...
...
pkg/kubelet/volumemanager/cache/actual_state_of_world.go
View file @
179e5d70
...
@@ -630,7 +630,7 @@ func (asw *actualStateOfWorld) PodExistsInVolume(
...
@@ -630,7 +630,7 @@ func (asw *actualStateOfWorld) PodExistsInVolume(
return
true
,
volumeObj
.
devicePath
,
newRemountRequiredError
(
volumeObj
.
volumeName
,
podObj
.
podName
)
return
true
,
volumeObj
.
devicePath
,
newRemountRequiredError
(
volumeObj
.
volumeName
,
podObj
.
podName
)
}
}
if
podObj
.
fsResizeRequired
&&
if
podObj
.
fsResizeRequired
&&
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
Expand
PersistentVolumesFSWithoutUnmounting
)
{
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
Expand
InUsePersistentVolumes
)
{
return
true
,
volumeObj
.
devicePath
,
newFsResizeRequiredError
(
volumeObj
.
volumeName
,
podObj
.
podName
)
return
true
,
volumeObj
.
devicePath
,
newFsResizeRequiredError
(
volumeObj
.
volumeName
,
podObj
.
podName
)
}
}
}
}
...
...
pkg/kubelet/volumemanager/populator/desired_state_of_world_populator.go
View file @
179e5d70
...
@@ -185,7 +185,7 @@ func (dswp *desiredStateOfWorldPopulator) isPodTerminated(pod *v1.Pod) bool {
...
@@ -185,7 +185,7 @@ func (dswp *desiredStateOfWorldPopulator) isPodTerminated(pod *v1.Pod) bool {
func
(
dswp
*
desiredStateOfWorldPopulator
)
findAndAddNewPods
()
{
func
(
dswp
*
desiredStateOfWorldPopulator
)
findAndAddNewPods
()
{
// Map unique pod name to outer volume name to MountedVolume.
// Map unique pod name to outer volume name to MountedVolume.
mountedVolumesForPod
:=
make
(
map
[
volumetypes
.
UniquePodName
]
map
[
string
]
cache
.
MountedVolume
)
mountedVolumesForPod
:=
make
(
map
[
volumetypes
.
UniquePodName
]
map
[
string
]
cache
.
MountedVolume
)
if
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
Expand
PersistentVolumesFSWithoutUnmounting
)
{
if
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
Expand
InUsePersistentVolumes
)
{
for
_
,
mountedVolume
:=
range
dswp
.
actualStateOfWorld
.
GetMountedVolumes
()
{
for
_
,
mountedVolume
:=
range
dswp
.
actualStateOfWorld
.
GetMountedVolumes
()
{
mountedVolumes
,
exist
:=
mountedVolumesForPod
[
mountedVolume
.
PodName
]
mountedVolumes
,
exist
:=
mountedVolumesForPod
[
mountedVolume
.
PodName
]
if
!
exist
{
if
!
exist
{
...
@@ -323,7 +323,7 @@ func (dswp *desiredStateOfWorldPopulator) processPodVolumes(
...
@@ -323,7 +323,7 @@ func (dswp *desiredStateOfWorldPopulator) processPodVolumes(
volumeSpec
.
Name
(),
volumeSpec
.
Name
(),
uniquePodName
)
uniquePodName
)
if
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
Expand
PersistentVolumesFSWithoutUnmounting
)
{
if
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
Expand
InUsePersistentVolumes
)
{
dswp
.
checkVolumeFSResize
(
pod
,
podVolume
,
pvc
,
volumeSpec
,
dswp
.
checkVolumeFSResize
(
pod
,
podVolume
,
pvc
,
volumeSpec
,
uniquePodName
,
mountedVolumesForPod
,
processedVolumesForFSResize
)
uniquePodName
,
mountedVolumesForPod
,
processedVolumesForFSResize
)
}
}
...
...
pkg/kubelet/volumemanager/populator/desired_state_of_world_populator_test.go
View file @
179e5d70
...
@@ -562,9 +562,9 @@ func volumeCapacity(size int) v1.ResourceList {
...
@@ -562,9 +562,9 @@ func volumeCapacity(size int) v1.ResourceList {
}
}
func
setExpandOnlinePersistentVolumesFeatureGate
(
value
string
,
t
*
testing
.
T
)
{
func
setExpandOnlinePersistentVolumesFeatureGate
(
value
string
,
t
*
testing
.
T
)
{
err
:=
utilfeature
.
DefaultFeatureGate
.
Set
(
fmt
.
Sprintf
(
"%s=%s"
,
features
.
Expand
PersistentVolumesFSWithoutUnmounting
,
value
))
err
:=
utilfeature
.
DefaultFeatureGate
.
Set
(
fmt
.
Sprintf
(
"%s=%s"
,
features
.
Expand
InUsePersistentVolumes
,
value
))
if
err
!=
nil
{
if
err
!=
nil
{
t
.
Fatalf
(
"Set Expand
PersistentVolumesFSWithoutUnmounting
feature gate to %s failed: %v"
,
value
,
err
)
t
.
Fatalf
(
"Set Expand
InUsePersistentVolumes
feature gate to %s failed: %v"
,
value
,
err
)
}
}
}
}
...
...
pkg/kubelet/volumemanager/reconciler/reconciler.go
View file @
179e5d70
...
@@ -255,7 +255,7 @@ func (rc *reconciler) reconcile() {
...
@@ -255,7 +255,7 @@ func (rc *reconciler) reconcile() {
}
}
}
}
}
else
if
cache
.
IsFSResizeRequiredError
(
err
)
&&
}
else
if
cache
.
IsFSResizeRequiredError
(
err
)
&&
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
Expand
PersistentVolumesFSWithoutUnmounting
)
{
utilfeature
.
DefaultFeatureGate
.
Enabled
(
features
.
Expand
InUsePersistentVolumes
)
{
glog
.
V
(
4
)
.
Infof
(
volumeToMount
.
GenerateMsgDetailed
(
"Starting operationExecutor.ExpandVolumeFSWithoutUnmounting"
,
""
))
glog
.
V
(
4
)
.
Infof
(
volumeToMount
.
GenerateMsgDetailed
(
"Starting operationExecutor.ExpandVolumeFSWithoutUnmounting"
,
""
))
err
:=
rc
.
operationExecutor
.
ExpandVolumeFSWithoutUnmounting
(
err
:=
rc
.
operationExecutor
.
ExpandVolumeFSWithoutUnmounting
(
volumeToMount
.
VolumeToMount
,
volumeToMount
.
VolumeToMount
,
...
...
pkg/kubelet/volumemanager/reconciler/reconciler_test.go
View file @
179e5d70
...
@@ -973,7 +973,7 @@ func Test_GenerateUnmapDeviceFunc_Plugin_Not_Found(t *testing.T) {
...
@@ -973,7 +973,7 @@ func Test_GenerateUnmapDeviceFunc_Plugin_Not_Found(t *testing.T) {
// Mark volume as fsResizeRequired in ASW.
// Mark volume as fsResizeRequired in ASW.
// Verifies volume's fsResizeRequired flag is cleared later.
// Verifies volume's fsResizeRequired flag is cleared later.
func
Test_Run_Positive_VolumeFSResizeControllerAttachEnabled
(
t
*
testing
.
T
)
{
func
Test_Run_Positive_VolumeFSResizeControllerAttachEnabled
(
t
*
testing
.
T
)
{
utilfeature
.
DefaultFeatureGate
.
Set
(
fmt
.
Sprintf
(
"%s=true"
,
features
.
Expand
PersistentVolumesFSWithoutUnmounting
))
utilfeature
.
DefaultFeatureGate
.
Set
(
fmt
.
Sprintf
(
"%s=true"
,
features
.
Expand
InUsePersistentVolumes
))
pv
:=
&
v1
.
PersistentVolume
{
pv
:=
&
v1
.
PersistentVolume
{
ObjectMeta
:
metav1
.
ObjectMeta
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"pv"
,
Name
:
"pv"
,
...
...
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