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
dac7b3e2
Commit
dac7b3e2
authored
Apr 03, 2017
by
Marcin Wielgus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move autoscaling e2e tests to a separate directory
parent
70684584
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
89 additions
and
18 deletions
+89
-18
BUILD
test/e2e/BUILD
+1
-3
BUILD
test/e2e/autoscaling/BUILD
+53
-0
OWNERS
test/e2e/autoscaling/OWNERS
+8
-0
cluster_size_autoscaling.go
test/e2e/autoscaling/cluster_size_autoscaling.go
+22
-12
dns_autoscaling.go
test/e2e/autoscaling/dns_autoscaling.go
+3
-2
horizontal_pod_autoscaling.go
test/e2e/autoscaling/horizontal_pod_autoscaling.go
+1
-1
e2e_test.go
test/e2e/e2e_test.go
+1
-0
No files found.
test/e2e/BUILD
View file @
dac7b3e2
...
@@ -14,7 +14,6 @@ go_library(
...
@@ -14,7 +14,6 @@ go_library(
"addon_update.go",
"addon_update.go",
"apparmor.go",
"apparmor.go",
"cadvisor.go",
"cadvisor.go",
"cluster_size_autoscaling.go",
"cluster_upgrade.go",
"cluster_upgrade.go",
"cronjob.go",
"cronjob.go",
"daemon_restart.go",
"daemon_restart.go",
...
@@ -23,7 +22,6 @@ go_library(
...
@@ -23,7 +22,6 @@ go_library(
"deployment.go",
"deployment.go",
"disruption.go",
"disruption.go",
"dns.go",
"dns.go",
"dns_autoscaling.go",
"dns_common.go",
"dns_common.go",
"dns_configmap.go",
"dns_configmap.go",
"e2e.go",
"e2e.go",
...
@@ -39,7 +37,6 @@ go_library(
...
@@ -39,7 +37,6 @@ go_library(
"gke_local_ssd.go",
"gke_local_ssd.go",
"gke_node_pools.go",
"gke_node_pools.go",
"ha_master.go",
"ha_master.go",
"horizontal_pod_autoscaling.go",
"ingress.go",
"ingress.go",
"initial_resources.go",
"initial_resources.go",
"job.go",
"job.go",
...
@@ -250,6 +247,7 @@ filegroup(
...
@@ -250,6 +247,7 @@ filegroup(
name = "all-srcs",
name = "all-srcs",
srcs = [
srcs = [
":package-srcs",
":package-srcs",
"//test/e2e/autoscaling:all-srcs",
"//test/e2e/chaosmonkey:all-srcs",
"//test/e2e/chaosmonkey:all-srcs",
"//test/e2e/cluster-logging:all-srcs",
"//test/e2e/cluster-logging:all-srcs",
"//test/e2e/common:all-srcs",
"//test/e2e/common:all-srcs",
...
...
test/e2e/autoscaling/BUILD
0 → 100644
View file @
dac7b3e2
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_library",
)
go_library(
name = "go_default_library",
srcs = [
"cluster_size_autoscaling.go",
"dns_autoscaling.go",
"horizontal_pod_autoscaling.go",
],
tags = ["automanaged"],
deps = [
"//pkg/api/v1:go_default_library",
"//pkg/client/clientset_generated/clientset:go_default_library",
"//test/e2e:go_default_library",
"//test/e2e/common:go_default_library",
"//test/e2e/framework:go_default_library",
"//test/e2e/scheduling:go_default_library",
"//test/utils:go_default_library",
"//vendor:github.com/golang/glog",
"//vendor:github.com/onsi/ginkgo",
"//vendor:github.com/onsi/gomega",
"//vendor:k8s.io/apimachinery/pkg/api/errors",
"//vendor:k8s.io/apimachinery/pkg/api/resource",
"//vendor:k8s.io/apimachinery/pkg/apis/meta/v1",
"//vendor:k8s.io/apimachinery/pkg/fields",
"//vendor:k8s.io/apimachinery/pkg/labels",
"//vendor:k8s.io/apimachinery/pkg/util/intstr",
"//vendor:k8s.io/apimachinery/pkg/util/sets",
"//vendor:k8s.io/apimachinery/pkg/util/uuid",
"//vendor:k8s.io/apimachinery/pkg/util/wait",
"//vendor:k8s.io/client-go/pkg/apis/policy/v1beta1",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
)
test/e2e/autoscaling/OWNERS
0 → 100644
View file @
dac7b3e2
reviewers:
- mwielgus
- jszczepkowski
- MaciekPytel
approvers:
- mwielgus
- jszczepkowski
- MaciekPytel
test/e2e/cluster_size_autoscaling.go
→
test/e2e/
autoscaling/
cluster_size_autoscaling.go
View file @
dac7b3e2
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
*/
*/
package
e2e
package
autoscaling
import
(
import
(
"bytes"
"bytes"
...
@@ -36,6 +36,7 @@ import (
...
@@ -36,6 +36,7 @@ import (
policy
"k8s.io/client-go/pkg/apis/policy/v1beta1"
policy
"k8s.io/client-go/pkg/apis/policy/v1beta1"
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
"k8s.io/kubernetes/test/e2e"
"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/kubernetes/test/e2e/scheduling"
"k8s.io/kubernetes/test/e2e/scheduling"
testutils
"k8s.io/kubernetes/test/utils"
testutils
"k8s.io/kubernetes/test/utils"
...
@@ -82,7 +83,7 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
...
@@ -82,7 +83,7 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
originalSizes
=
make
(
map
[
string
]
int
)
originalSizes
=
make
(
map
[
string
]
int
)
sum
:=
0
sum
:=
0
for
_
,
mig
:=
range
strings
.
Split
(
framework
.
TestContext
.
CloudConfig
.
NodeInstanceGroup
,
","
)
{
for
_
,
mig
:=
range
strings
.
Split
(
framework
.
TestContext
.
CloudConfig
.
NodeInstanceGroup
,
","
)
{
size
,
err
:=
GroupSize
(
mig
)
size
,
err
:=
e2e
.
GroupSize
(
mig
)
framework
.
ExpectNoError
(
err
)
framework
.
ExpectNoError
(
err
)
By
(
fmt
.
Sprintf
(
"Initial size of %s: %d"
,
mig
,
size
))
By
(
fmt
.
Sprintf
(
"Initial size of %s: %d"
,
mig
,
size
))
originalSizes
[
mig
]
=
size
originalSizes
[
mig
]
=
size
...
@@ -190,7 +191,8 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
...
@@ -190,7 +191,8 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
})
})
It
(
"should add node to the particular mig [Feature:ClusterSizeAutoscalingScaleUp]"
,
func
()
{
It
(
"should add node to the particular mig [Feature:ClusterSizeAutoscalingScaleUp]"
,
func
()
{
labels
:=
map
[
string
]
string
{
"cluster-autoscaling-test.special-node"
:
"true"
}
labelKey
:=
"cluster-autoscaling-test.special-node"
labelValue
:=
"true"
By
(
"Finding the smallest MIG"
)
By
(
"Finding the smallest MIG"
)
minMig
:=
""
minMig
:=
""
...
@@ -204,25 +206,30 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
...
@@ -204,25 +206,30 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
removeLabels
:=
func
(
nodesToClean
sets
.
String
)
{
removeLabels
:=
func
(
nodesToClean
sets
.
String
)
{
By
(
"Removing labels from nodes"
)
By
(
"Removing labels from nodes"
)
updateNodeLabels
(
c
,
nodesToClean
,
nil
,
labels
)
for
node
:=
range
nodesToClean
{
framework
.
RemoveLabelOffNode
(
c
,
node
,
labelKey
)
}
}
}
nodes
,
err
:=
GetGroupNodes
(
minMig
)
nodes
,
err
:=
e2e
.
GetGroupNodes
(
minMig
)
framework
.
ExpectNoError
(
err
)
framework
.
ExpectNoError
(
err
)
nodesSet
:=
sets
.
NewString
(
nodes
...
)
nodesSet
:=
sets
.
NewString
(
nodes
...
)
defer
removeLabels
(
nodesSet
)
defer
removeLabels
(
nodesSet
)
By
(
fmt
.
Sprintf
(
"Annotating nodes of the smallest MIG(%s): %v"
,
minMig
,
nodes
))
By
(
fmt
.
Sprintf
(
"Annotating nodes of the smallest MIG(%s): %v"
,
minMig
,
nodes
))
updateNodeLabels
(
c
,
nodesSet
,
labels
,
nil
)
CreateNodeSelectorPods
(
f
,
"node-selector"
,
minSize
+
1
,
labels
,
false
)
for
node
:=
range
nodesSet
{
framework
.
AddOrUpdateLabelOnNode
(
c
,
node
,
labelKey
,
labelValue
)
}
CreateNodeSelectorPods
(
f
,
"node-selector"
,
minSize
+
1
,
map
[
string
]
string
{
labelKey
:
labelValue
},
false
)
By
(
"Waiting for new node to appear and annotating it"
)
By
(
"Waiting for new node to appear and annotating it"
)
WaitForGroupSize
(
minMig
,
int32
(
minSize
+
1
))
e2e
.
WaitForGroupSize
(
minMig
,
int32
(
minSize
+
1
))
// Verify, that cluster size is increased
// Verify, that cluster size is increased
framework
.
ExpectNoError
(
WaitForClusterSizeFunc
(
f
.
ClientSet
,
framework
.
ExpectNoError
(
WaitForClusterSizeFunc
(
f
.
ClientSet
,
func
(
size
int
)
bool
{
return
size
>=
nodeCount
+
1
},
scaleUpTimeout
))
func
(
size
int
)
bool
{
return
size
>=
nodeCount
+
1
},
scaleUpTimeout
))
newNodes
,
err
:=
GetGroupNodes
(
minMig
)
newNodes
,
err
:=
e2e
.
GetGroupNodes
(
minMig
)
framework
.
ExpectNoError
(
err
)
framework
.
ExpectNoError
(
err
)
newNodesSet
:=
sets
.
NewString
(
newNodes
...
)
newNodesSet
:=
sets
.
NewString
(
newNodes
...
)
newNodesSet
.
Delete
(
nodes
...
)
newNodesSet
.
Delete
(
nodes
...
)
...
@@ -264,7 +271,10 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
...
@@ -264,7 +271,10 @@ var _ = framework.KubeDescribe("Cluster size autoscaling [Slow]", func() {
}
}
}
}
By
(
fmt
.
Sprintf
(
"Setting labels for registered new nodes: %v"
,
registeredNodes
.
List
()))
By
(
fmt
.
Sprintf
(
"Setting labels for registered new nodes: %v"
,
registeredNodes
.
List
()))
updateNodeLabels
(
c
,
registeredNodes
,
labels
,
nil
)
for
node
:=
range
registeredNodes
{
framework
.
AddOrUpdateLabelOnNode
(
c
,
node
,
labelKey
,
labelValue
)
}
defer
removeLabels
(
registeredNodes
)
defer
removeLabels
(
registeredNodes
)
framework
.
ExpectNoError
(
waitForAllCaPodsReadyInNamespace
(
f
,
c
))
framework
.
ExpectNoError
(
waitForAllCaPodsReadyInNamespace
(
f
,
c
))
...
@@ -645,11 +655,11 @@ func waitForAllCaPodsReadyInNamespace(f *framework.Framework, c clientset.Interf
...
@@ -645,11 +655,11 @@ func waitForAllCaPodsReadyInNamespace(f *framework.Framework, c clientset.Interf
func
setMigSizes
(
sizes
map
[
string
]
int
)
{
func
setMigSizes
(
sizes
map
[
string
]
int
)
{
for
mig
,
desiredSize
:=
range
sizes
{
for
mig
,
desiredSize
:=
range
sizes
{
currentSize
,
err
:=
GroupSize
(
mig
)
currentSize
,
err
:=
e2e
.
GroupSize
(
mig
)
framework
.
ExpectNoError
(
err
)
framework
.
ExpectNoError
(
err
)
if
desiredSize
!=
currentSize
{
if
desiredSize
!=
currentSize
{
By
(
fmt
.
Sprintf
(
"Setting size of %s to %d"
,
mig
,
desiredSize
))
By
(
fmt
.
Sprintf
(
"Setting size of %s to %d"
,
mig
,
desiredSize
))
err
=
ResizeGroup
(
mig
,
int32
(
desiredSize
))
err
=
e2e
.
ResizeGroup
(
mig
,
int32
(
desiredSize
))
framework
.
ExpectNoError
(
err
)
framework
.
ExpectNoError
(
err
)
}
}
}
}
...
...
test/e2e/dns_autoscaling.go
→
test/e2e/
autoscaling/
dns_autoscaling.go
View file @
dac7b3e2
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
*/
*/
package
e2e
package
autoscaling
import
(
import
(
"fmt"
"fmt"
...
@@ -28,6 +28,7 @@ import (
...
@@ -28,6 +28,7 @@ import (
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/api/v1"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
"k8s.io/kubernetes/pkg/client/clientset_generated/clientset"
"k8s.io/kubernetes/test/e2e"
"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/kubernetes/test/e2e/framework"
.
"github.com/onsi/ginkgo"
.
"github.com/onsi/ginkgo"
...
@@ -119,7 +120,7 @@ var _ = framework.KubeDescribe("DNS horizontal autoscaling", func() {
...
@@ -119,7 +120,7 @@ var _ = framework.KubeDescribe("DNS horizontal autoscaling", func() {
originalSizes
:=
make
(
map
[
string
]
int
)
originalSizes
:=
make
(
map
[
string
]
int
)
sum
:=
0
sum
:=
0
for
_
,
mig
:=
range
strings
.
Split
(
framework
.
TestContext
.
CloudConfig
.
NodeInstanceGroup
,
","
)
{
for
_
,
mig
:=
range
strings
.
Split
(
framework
.
TestContext
.
CloudConfig
.
NodeInstanceGroup
,
","
)
{
size
,
err
:=
GroupSize
(
mig
)
size
,
err
:=
e2e
.
GroupSize
(
mig
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
By
(
fmt
.
Sprintf
(
"Initial size of %s: %d"
,
mig
,
size
))
By
(
fmt
.
Sprintf
(
"Initial size of %s: %d"
,
mig
,
size
))
originalSizes
[
mig
]
=
size
originalSizes
[
mig
]
=
size
...
...
test/e2e/horizontal_pod_autoscaling.go
→
test/e2e/
autoscaling/
horizontal_pod_autoscaling.go
View file @
dac7b3e2
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
limitations under the License.
*/
*/
package
e2e
package
autoscaling
import
(
import
(
"time"
"time"
...
...
test/e2e/e2e_test.go
View file @
dac7b3e2
...
@@ -19,6 +19,7 @@ package e2e
...
@@ -19,6 +19,7 @@ package e2e
import
(
import
(
"testing"
"testing"
_
"k8s.io/kubernetes/test/e2e/autoscaling"
_
"k8s.io/kubernetes/test/e2e/cluster-logging"
_
"k8s.io/kubernetes/test/e2e/cluster-logging"
"k8s.io/kubernetes/test/e2e/framework"
"k8s.io/kubernetes/test/e2e/framework"
_
"k8s.io/kubernetes/test/e2e/perf"
_
"k8s.io/kubernetes/test/e2e/perf"
...
...
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