Commit Graph

128 Commits

Author SHA1 Message Date
Caleb Woodbine
125e839d77 Fix formatting 2020-07-20 13:16:35 +12:00
Caleb Woodbine
b38d7f25fe Remove watch tooling 2020-07-20 11:00:37 +12:00
wawa0210
9d1948a2f5
fix test/e2e/apps staticcheck 2020-07-02 18:14:12 +08:00
Caleb Woodbine
e719b723f7 Update checks and status messages; Remove asserting of status values 2020-06-29 11:08:45 +12:00
Caleb Woodbine
3149247932 Add Deployment resource lifecycle test as-is 2020-06-25 10:29:53 +12:00
Jordan Liggitt
c9638d54d0 Defer ginkgo recovers 2020-06-01 11:02:41 -04:00
Tomas Nozicka
df8994c202 Fix watches in e2e framework 2020-04-23 17:17:26 +02:00
drfish
dfab6b637f Update .import-aliases for e2e test framework 2020-03-25 11:40:02 +08:00
drfish
f4da086cbe Move resource methods from e2e fw to e2e resource fw 2020-03-08 15:27:49 +08:00
Mike Danese
76f8594378 more artisanal fixes
Most of these could have been refactored automatically but it wouldn't
have been uglier. The unsophisticated tooling left lots of unnecessary
struct -> pointer -> struct transitions.
2020-03-05 14:59:47 -08:00
Mike Danese
c58e69ec79 automated refactor 2020-03-05 14:59:46 -08:00
Mike Danese
25651408ae generated: run refactor 2020-02-08 12:30:21 -05:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
toyoda
91dca8ff8c Use e2eskipper package in e2e/apps 2020-01-10 15:08:19 +09:00
tanjunchen
2f0e5b262a move functions from e2e/framework/deployment/ to e2e/apps/ and e2e/upgrades 2020-01-02 13:01:09 +08:00
tanjunchen
f19ed6ccfe remove unused code in test/e2e/apps/deployment 2019-12-27 12:57:00 +08:00
danielqsj
6596a14d39 add missing alias of api errors under test 2019-12-26 17:29:38 +08:00
yuxiaobo
4123973726 e2e: move funs of framework/deployment/fixtures.go to e2e/apps/deployment.go
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-12-24 16:23:42 +08:00
Kubernetes Prow Robot
9b840a72c9
Merge pull request #86148 from tanjunchen/use-framework-Equal
test/e2e/: use framework.Equal() replace gomega.Expect(...).To(gomega…
2019-12-17 04:19:59 -08:00
tanjunchen
77a9d4772b move funcs from test/e2e/framework/replicaset to test/e2e/apps 2019-12-13 13:02:02 +08:00
tanjunchen
f786cb07b7 test/e2e/: use framework.Equal() replace gomega.Expect(...).To(gomega.BeTrue()|BeFalse()) 2019-12-13 10:11:47 +08:00
SataQiu
10b173868a move funs of framework/deployment to e2e/apps 2019-12-09 11:30:15 +08:00
wojtekt
5cd06d15d8 Fix deployment e2e test at scale 2019-10-25 12:50:59 +02:00
wojtekt
bf34ba0cdf Fix timeouts for networking tests in large clusters 2019-10-23 14:44:45 +02:00
Dan Winship
52b366457f Add Namespace to e2eservice.TestJig, make all methods use jig namespace and name
Many TestJig methods made the caller pass a serviceName argument, even
though the jig already has a name, and every caller was passing the
same name to each function as they had passed to NewTestJig().

Likewise, many methods made the caller pass a namespace argument, but
only a single test used more than one namespace, and it can easily be
rewritten to use two test jigs as well.
2019-10-18 08:37:19 -04:00
Dan Winship
a0ad420018 Make e2eservice.TestJig methods return errors rather than failing
This is the preferred style for framework methods, and it lets us
write tests to confirm that certain things *don't* work.
2019-10-18 08:36:40 -04:00
Miciah Masters
980b6406b2 Prefer to delete doubled-up pods of a ReplicaSet
When scaling down a ReplicaSet, delete doubled up replicas first, where a
"doubled up replica" is defined as one that is on the same node as an
active replica belonging to a related ReplicaSet.  ReplicaSets are
considered "related" if they have a common controller (typically a
Deployment).

The intention of this change is to make a rolling update of a Deployment
scale down the old ReplicaSet as it scales up the new ReplicaSet by
deleting pods from the old ReplicaSet that are colocated with ready pods of
the new ReplicaSet.  This change in the behavior of rolling updates can be
combined with pod affinity rules to preserve the locality of a Deployment's
pods over rollout.

A specific scenario that benefits from this change is when a Deployment's
pods are exposed by a Service that has type "LoadBalancer" and external
traffic policy "Local".  In this scenario, the load balancer uses health
checks to determine whether it should forward traffic for the Service to a
particular node.  If the node has no local endpoints for the Service, the
health check will fail for that node.  Eventually, the load balancer will
stop forwarding traffic to that node.  In the meantime, the service proxy
drops traffic for that Service.  Thus, in order to reduce risk of dropping
traffic during a rolling update, it is desirable preserve node locality of
endpoints.

* pkg/controller/controller_utils.go (ActivePodsWithRanks): New type to
sort pods using a given ranking.
* pkg/controller/controller_utils_test.go (TestSortingActivePodsWithRanks):
New test for ActivePodsWithRanks.
* pkg/controller/replicaset/replica_set.go
(getReplicaSetsWithSameController): New method.  Given a ReplicaSet, return
all ReplicaSets that have the same owner.
(manageReplicas): Call getIndirectlyRelatedPods, and pass its result to
getPodsToDelete.
(getIndirectlyRelatedPods): New method.  Given a ReplicaSet, return all
pods that are owned by any ReplicaSet with the same owner.
(getPodsToDelete): Add an argument for related pods.  Use related pods and
the new getPodsRankedByRelatedPodsOnSameNode function to take into account
whether a pod is doubled up when sorting pods for deletion.
(getPodsRankedByRelatedPodsOnSameNode): New function.  Return an
ActivePodsWithRanks value that wraps the given slice of pods and computes
ranks where each pod's rank is equal to the number of active related pods
that are colocated on the same node.
* pkg/controller/replicaset/replica_set_test.go (newReplicaSet): Set
OwnerReferences on the ReplicaSet.
(newPod): Set a unique UID on the pod.
(byName): New type to sort pods by name.
(TestGetReplicaSetsWithSameController): New test for
getReplicaSetsWithSameController.
(TestRelatedPodsLookup): New test for getIndirectlyRelatedPods.
(TestGetPodsToDelete): Augment the "various pod phases and conditions, diff
= len(pods)" test case to ensure that scale-down still selects doubled-up
pods if there are not enough other pods to scale down.  Add a "various pod
phases and conditions, diff = len(pods), relatedPods empty" test case to
verify that getPodsToDelete works even if related pods could not be
determined.  Add a "ready and colocated with another ready pod vs not
colocated, diff < len(pods)" test case to verify that a doubled-up pod gets
preferred for deletion.  Augment the "various pod phases and conditions,
diff < len(pods)" test case to ensure that not-ready pods are preferred
over ready but doubled-up pods.
* pkg/controller/replicaset/BUILD: Regenerate.
* test/e2e/apps/deployment.go
(testRollingUpdateDeploymentWithLocalTrafficLoadBalancer): New end-to-end
test.  Create a deployment with a rolling update strategy and affinity
rules and a load balancer with "Local" external traffic policy, and verify
that set of nodes with local endponts for the service remains unchanged
during rollouts.
(setAffinity): New helper, used by
testRollingUpdateDeploymentWithLocalTrafficLoadBalancer.
* test/e2e/framework/service/jig.go (GetEndpointNodes): Factor building the
set of node names out...
(GetEndpointNodeNames): ...into this new method.
2019-10-17 11:52:32 -04:00
Claudiu Belu
b91aa9a5c3 tests: Replaces Redis image with Agnhost
Some tests are using the Redis image, but they do not explicitly need it.
This commit replaces the usage of the Redis image with the Agnhost image
in such test cases.
2019-09-09 00:25:18 -07:00
toyoda
c3fdb5e7d9 Use log functions of core framework on test/e2e/apps 2019-08-26 17:38:11 +09:00
draveness
d3158b2c71 feat: use framework.ExpectNotEqual in e2e test 2019-07-10 21:36:26 +08:00
draveness
0ec95afb76 feat: use framework.ExpectEqual instead of should 2019-07-07 21:07:48 +08:00
Claudiu Belu
c752ea8134 tests: Replaces images used with agnhost (part 3)
Quite a few images are only used a few times in a few tests. Thus,
the images are being centralized into the agnhost image, reducing
the number of images that have to be pulled and used.

This PR replaces the usage of the following images with agnhost:

- audit-proxy
- crd-conversion-webhook
- entrypoint-tester
- inclusterclient
- iperf
- porter
- serve-hostname
2019-06-26 13:33:55 -07:00
Antonio Ojea
410df752cd
Add ipv6 support to [sig-apps] StatefulSet e2e test
Use httpd docker images instead of nginx because they listen
by default both in IPv4 and IPv6
2019-06-23 17:23:28 +02:00
Jordan Liggitt
6ca80760fd Switch test manifests to apps/v1, remove beta workloads calls 2019-06-22 13:58:07 -07:00
Kubernetes Prow Robot
dc8b928136
Merge pull request #79162 from SataQiu/fix-test-20190619
Refactor: replace framework.Failf with e2elog.Failf
2019-06-21 12:17:04 -07:00
Aaron Crickenberger
2a8bee4b37 add import-alias for k8s.io/api/extensions/v1beta1 2019-06-20 11:40:21 -07:00
Aaron Crickenberger
0aae740ede add import-alias for k8s.io/api/apps/v1 2019-06-20 11:39:40 -07:00
SataQiu
332be4b1e3 refactor: replace framework.Failf with e2elog.Failf 2019-06-19 17:52:35 +08:00
Jorge Alarcon Ochoa
4969a05327 Refactored pod-related functions from framework/util.go
This a refactoring of framework/utils.go into framework/pod.

Signed-off-by: Jorge Alarcon Ochoa <alarcj137@gmail.com>
2019-05-30 09:30:26 -04:00
toyoda
4841e5b98c use framework.ExpectNoError() for daemon_set.go and deployment.go in e2e/apps 2019-05-14 08:44:54 +09:00
Kubernetes Prow Robot
389252feae
Merge pull request #77709 from danielqsj/test
replace test error checking with more readable way
2019-05-13 13:15:23 -07:00
danielqsj
f3ea5e5c94 replace test error checking with more readable way 2019-05-10 10:15:45 +08:00
draveness
c045046e5b feat: use framework.ExpectNoError instead in e2e test 2019-05-10 09:53:10 +08:00
hui luo
4d4e4f4056 Modify apimachinery,apps,instrumentation tests to import framework/log
This is part of the transition to using framework/log instead
of the Logf inside the framework package. This will help with
import size/cycles when importing the framework or subpackages
2019-05-08 16:46:39 -07:00
Jorge Alarcon Ochoa
dc619067d9 Refeactored framework deployment utils
This is the continuation of the refactoring of framework/deployment_utils.go
into framework/deployment.

Signed-off-by: Jorge Alarcon Ochoa <alarcj137@gmail.com>
2019-05-03 18:00:53 -04:00
Jorge Alarcon Ochoa
8200ae6279 Refeactored framework deployment utils
xref: #76206

Signed-off-by: Jorge Alarcon Ochoa <alarcj137@gmail.com>
2019-04-24 19:28:03 -04:00
SataQiu
03180ec2b2 fix golint failures of test/e2e/apps 2019-04-17 19:04:51 +08:00
draveness
dee97a4e5c refactor: cleanup e2e replicaset utils 2019-04-12 01:48:10 +08:00
hangaoshuai
3d705c0559 catch error when failed to get podList in function failureTrap 2018-08-27 16:14:59 +08:00
Kubernetes Submit Queue
71b074ff0a
Merge pull request #66634 from janetkuo/deploy-conform
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add Deployment conformance tests

**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**: @kubernetes/sig-apps-pr-reviews @kubernetes/sig-architecture-pr-reviews 

**Release note**:

```release-note
NONE
```
2018-08-07 18:17:30 -07:00
stewart-yu
55251c716a update the import file for move util/pointer to k8s.io/utils 2018-07-27 19:47:02 +08:00
Janet Kuo
4eb583c2b1 Add Deployment conformance tests 2018-07-25 17:15:27 -07:00
Maciej Szulik
383872615d
Remove kubectl reapers 2018-05-25 22:18:05 +02:00
Anthony Yeh
a6a5190494
test/e2e: Use apps/v1 Deployment/ReplicaSet.
This must be done at the same time as the controller update,
since they share code.
2018-05-22 13:43:06 -07:00
Kubernetes Submit Queue
2ba2cc1321
Merge pull request #61615 from janetkuo/rm-adopt-hash
Automatic merge from submit-queue (batch tested with PRs 61790, 61808, 60339, 61615, 61757). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Deployment to stop adding pod-template-hash labels/selector on adoption

**What this PR does / why we need it**: This is a blocker for #55714, because ReplicaSet selector becomes immutable in `apps/v1`. With controller ref, Deployment's ReplicaSets and Pods can avoid fighting with each others without unique label/selector (pod-template-hash), so it's safe to stop adding hash label/selector on adoption. 

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #61433

**Special notes for your reviewer**: This is a behavioral change to Deployment controller that will affect all versions of Deployment APIs (`apps/v1`, `extensions/v1beta1`, `apps/v1beta1`, `apps/v1beta2`). 

**Release note**:

```release-note
Deployment will stop adding pod-template-hash labels/selector to ReplicaSets and Pods it adopts. Resources created by Deployments are not affected (will still have pod-template-hash labels/selector). 
```
2018-03-28 09:39:18 -07:00
Janet Kuo
fa0ce15d47 Stop checking hash labels of adopted resources in e2e tests 2018-03-26 17:08:31 -07:00
p0lyn0mial
1f1d24005a removes custom scalers from kubectl 2018-03-26 19:33:42 +02:00
Anthony Yeh
b27836032a
ReplicaSet: Use apps/v1 RS in e2e test. 2018-03-20 09:10:40 -07:00
Jun Xiang Tee
1df84ba0db add deployment proportional scaling e2e test 2018-02-20 16:56:19 -08:00
Jun Xiang Tee
e4fc811a1d verify no extra RS was created when re-creating a deployment 2018-02-07 15:22:55 -08:00
Jun Xiang Tee
1334b61029 add basic functionality deployment integration tests 2018-02-01 16:21:07 -08:00
Jun Xiang Tee
25469e9b44 convert testScaledRolloutDeployment e2e test to integration test 2017-11-20 15:36:27 -08:00
supereagle
b694d51842 use versiond group clients from client-go 2017-11-07 14:47:22 +08:00
Jun Xiang Tee
131f7e1469 convert testOverlappingDeployment e2e test to integration test 2017-10-31 11:39:27 -07:00
Kubernetes Submit Queue
84284c0ba4
Merge pull request #54331 from crimsonfaith91/dfailed
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

convert testFailedDeployment e2e test to integration test

**What this PR does / why we need it**:
This PR convert a deployment e2e test named "testFailedDeployment" to integration test.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: xref #52113 

**Release note**:

```release-note
NONE
```
/assign
2017-10-27 15:19:20 -07:00
Jun Xiang Tee
21bc54508b convert testFailedDeployment e2e test to integration test 2017-10-27 13:19:50 -07:00
Kevin
4c8539cece use core client with explicit version globally 2017-10-27 15:48:32 +08:00
Janet Kuo
f7f1f17c89 Move deployment e2e test for hash label adoption to integration 2017-10-23 21:35:19 -07:00
Janet Kuo
1ca6120af3 Move deployment e2e test for rollback with no revision to integration 2017-10-23 18:58:05 -07:00
Janet Kuo
4de496d4f8 Combine deployment rollback e2e tests 2017-10-23 18:57:18 -07:00
Janet Kuo
241f4fbc98 Move deployment collision avoidance e2e test to integration 2017-09-25 10:27:31 -07:00
Janet Kuo
124344a1a4 Move paused deployment e2e tests to integration 2017-09-06 18:12:28 -07:00
Di Xu
85602fd542 CollisionCount should have type int32 across controllers that use it for collision avoidance 2017-08-18 10:48:12 +08:00
Kubernetes Submit Queue
3e8a25e818 Merge pull request #50008 from atlassian/meta-controller-ref
Automatic merge from submit-queue

Migrate to controller references helpers in meta/v1

**What this PR does / why we need it**:
This is a follow up for #48319 that migrates all method usages to new methods in meta/v1.

**Special notes for your reviewer**:
Looking at each commit individually might be easier.

**Release note**:
```release-note
NONE
```
/sig api-machinery
/kind cleanup
2017-08-10 17:07:30 -07:00
Dr. Stefan Schimanski
83895daed1 Fix printer hack to get a versioned client 2017-08-06 15:30:13 +02:00
Dr. Stefan Schimanski
1910b5a1dd Fix code implicitly casting clientsets to getters 2017-08-06 15:30:13 +02:00
Mikhail Mazurskiy
b28a83a4cf
Migrate to GetControllerOf from meta/v1 package 2017-08-06 22:41:58 +10:00
Michail Kargakis
5e93ed27bd
Rename test dir to allude sig-apps ownership
Signed-off-by: Michail Kargakis <mkargaki@redhat.com>
2017-07-22 12:43:36 +02:00