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
4ca27417
Commit
4ca27417
authored
Aug 29, 2017
by
NickrenREN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add pod local ephemeral storage usage e2e test cases
parent
9fadd3bd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
134 additions
and
2 deletions
+134
-2
local_storage_isolation_eviction_test.go
test/e2e_node/local_storage_isolation_eviction_test.go
+134
-2
No files found.
test/e2e_node/local_storage_isolation_eviction_test.go
View file @
4ca27417
...
@@ -36,7 +36,7 @@ type podEvictSpec struct {
...
@@ -36,7 +36,7 @@ type podEvictSpec struct {
}
}
const
(
const
(
totalEvict
=
4
totalEvict
=
7
)
)
// Eviction Policy is described here:
// Eviction Policy is described here:
...
@@ -47,6 +47,9 @@ var _ = framework.KubeDescribe("LocalStorageCapacityIsolationEviction [Slow] [Se
...
@@ -47,6 +47,9 @@ var _ = framework.KubeDescribe("LocalStorageCapacityIsolationEviction [Slow] [Se
f
:=
framework
.
NewDefaultFramework
(
"localstorage-eviction-test"
)
f
:=
framework
.
NewDefaultFramework
(
"localstorage-eviction-test"
)
emptyDirVolumeName
:=
"volume-emptydir-pod"
emptyDirVolumeName
:=
"volume-emptydir-pod"
gitRepoVolumeName
:=
"volume-gitrepo-pod"
configMapVolumeName
:=
"volume-configmap-pod"
downwardAPIVolumeName
:=
"volume-downwardapi-pod"
podTestSpecs
:=
[]
podEvictSpec
{
podTestSpecs
:=
[]
podEvictSpec
{
{
evicted
:
true
,
// This pod should be evicted because emptyDir (default storage type) usage violation
{
evicted
:
true
,
// This pod should be evicted because emptyDir (default storage type) usage violation
pod
:
v1
.
Pod
{
pod
:
v1
.
Pod
{
...
@@ -226,10 +229,139 @@ var _ = framework.KubeDescribe("LocalStorageCapacityIsolationEviction [Slow] [Se
...
@@ -226,10 +229,139 @@ var _ = framework.KubeDescribe("LocalStorageCapacityIsolationEviction [Slow] [Se
},
},
},
},
},
},
{
evicted
:
true
,
// This pod should be evicted because pod ephemeral storage usage violation
pod
:
v1
.
Pod
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"downward-api-container-hog-pod"
},
Spec
:
v1
.
PodSpec
{
RestartPolicy
:
v1
.
RestartPolicyNever
,
Containers
:
[]
v1
.
Container
{
{
Image
:
"gcr.io/google_containers/busybox:1.24"
,
Name
:
"downward-api-container-hog-pod"
,
Command
:
[]
string
{
"sh"
,
"-c"
,
"sleep 5; dd if=/dev/urandom of=target-file of=/cache/target-file bs=50000 count=1; while true; do sleep 5; done"
,
},
Resources
:
v1
.
ResourceRequirements
{
Limits
:
v1
.
ResourceList
{
v1
.
ResourceEphemeralStorage
:
*
resource
.
NewMilliQuantity
(
int64
(
40000
),
resource
.
BinarySI
),
},
},
VolumeMounts
:
[]
v1
.
VolumeMount
{
{
Name
:
downwardAPIVolumeName
,
MountPath
:
"/cache"
,
},
},
},
},
Volumes
:
[]
v1
.
Volume
{
{
Name
:
downwardAPIVolumeName
,
VolumeSource
:
v1
.
VolumeSource
{
DownwardAPI
:
&
v1
.
DownwardAPIVolumeSource
{},
},
},
},
},
},
},
{
evicted
:
true
,
// This pod should be evicted because pod ephemeral storage usage violation
pod
:
v1
.
Pod
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"configmap-container-hog-pod"
},
Spec
:
v1
.
PodSpec
{
RestartPolicy
:
v1
.
RestartPolicyNever
,
Containers
:
[]
v1
.
Container
{
{
Image
:
"gcr.io/google_containers/busybox:1.24"
,
Name
:
"configmap-container-hog-pod"
,
Command
:
[]
string
{
"sh"
,
"-c"
,
"sleep 5; dd if=/dev/urandom of=target-file of=/cache/target-file bs=50000 count=1; while true; do sleep 5; done"
,
},
Resources
:
v1
.
ResourceRequirements
{
Limits
:
v1
.
ResourceList
{
v1
.
ResourceEphemeralStorage
:
*
resource
.
NewMilliQuantity
(
int64
(
40000
),
resource
.
BinarySI
),
},
},
VolumeMounts
:
[]
v1
.
VolumeMount
{
{
Name
:
configMapVolumeName
,
MountPath
:
"/cache"
,
},
},
},
},
Volumes
:
[]
v1
.
Volume
{
{
Name
:
configMapVolumeName
,
VolumeSource
:
v1
.
VolumeSource
{
ConfigMap
:
&
v1
.
ConfigMapVolumeSource
{
LocalObjectReference
:
v1
.
LocalObjectReference
{
Name
:
"my-cfgmap"
,
},
},
},
},
},
},
},
},
{
evicted
:
true
,
// This pod should be evicted because pod ephemeral storage usage violation
pod
:
v1
.
Pod
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"gitrepo-container-hog-pod"
},
Spec
:
v1
.
PodSpec
{
RestartPolicy
:
v1
.
RestartPolicyNever
,
Containers
:
[]
v1
.
Container
{
{
Image
:
"gcr.io/google_containers/busybox:1.24"
,
Name
:
"gitrepo-container-hog-pod"
,
Command
:
[]
string
{
"sh"
,
"-c"
,
"sleep 5; dd if=/dev/urandom of=target-file of=/cache/target-file bs=50000 count=1; while true; do sleep 5; done"
,
},
Resources
:
v1
.
ResourceRequirements
{
Limits
:
v1
.
ResourceList
{
v1
.
ResourceEphemeralStorage
:
*
resource
.
NewMilliQuantity
(
int64
(
40000
),
resource
.
BinarySI
),
},
},
VolumeMounts
:
[]
v1
.
VolumeMount
{
{
Name
:
gitRepoVolumeName
,
MountPath
:
"/cache"
,
},
},
},
},
Volumes
:
[]
v1
.
Volume
{
{
Name
:
gitRepoVolumeName
,
VolumeSource
:
v1
.
VolumeSource
{
GitRepo
:
&
v1
.
GitRepoVolumeSource
{
Repository
:
"my-repo"
,
},
},
},
},
},
},
},
}
}
evictionTestTimeout
:=
10
*
time
.
Minute
evictionTestTimeout
:=
10
*
time
.
Minute
testCondition
:=
"
EmptyDir/ContainerContainer
EphemeralStorage usage limit violation"
testCondition
:=
"
PodLocalEphemeralStorage/ContainerLocal
EphemeralStorage usage limit violation"
Context
(
fmt
.
Sprintf
(
"EmptyDirEviction when we run containers that should cause %s"
,
testCondition
),
func
()
{
Context
(
fmt
.
Sprintf
(
"EmptyDirEviction when we run containers that should cause %s"
,
testCondition
),
func
()
{
tempSetCurrentKubeletConfig
(
f
,
func
(
initialConfig
*
kubeletconfig
.
KubeletConfiguration
)
{
tempSetCurrentKubeletConfig
(
f
,
func
(
initialConfig
*
kubeletconfig
.
KubeletConfiguration
)
{
initialConfig
.
FeatureGates
+=
", LocalStorageCapacityIsolation=true"
initialConfig
.
FeatureGates
+=
", LocalStorageCapacityIsolation=true"
...
...
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