Commit Graph

1219 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
e6e39db4c1 Merge pull request #125203 from danwinship/kind-loadbalancers-2
Fix eTP:Local NodePort test
2024-05-30 16:06:02 -07:00
Dan Winship
fff883ab4a Improve eTP:Local NodePort test
It previously assumed that pod-to-other-node-nodeIP would be
unmasqueraded, but this is not the case for most network plugins. Use
a HostNetwork exec pod to avoid problems.

This also requires putting the client and endpoint on different nodes,
because with most network plugins, a node-to-same-node-pod connection
will end up using the internal "docker0" (or whatever) IP as the
source address rather than the node's public IP, and we don't know
what that IP is.

Also make it work with IPv6.
2024-05-30 11:43:07 -04:00
Dan Winship
d01b264345 Improve LoadBalancerSourceRanges test
The existing test had two problems:

  - It only made connections from within the cluster, so for VIP-type
    LBs, the connections would always be short-circuited and so this
    only tested kube-proxy's LBSR implementation, not the cloud's.

  - For non-VIP-type LBs, it would only work if pod-to-LB connections
    were not masqueraded, which is not the case for most network
    plugins.

Fix this by (a) testing connectivity from the test binary, so as to
test filtering external IPs, and ensure we're testing the cloud's
behavior; and (b) using both pod and node IPs when testing the
in-cluster case.

Also some general cleanup of the test case.
2024-05-30 07:24:36 -04:00
Dan Winship
41527afe28 Move eTP:Local NodePort test from loadbalancer.go to service.go
(And in particular, remove `[Feature:LoadBalancer]` from it.)
2024-05-29 16:21:36 -04:00
Dan Winship
5230bab600 Convert test/e2e/network/service.go to utils/ptr 2024-05-29 16:21:34 -04:00
Antonio Ojea
5221df5074 add logging on e2e loadbalancer test 2024-05-23 23:32:08 +00:00
Sean Sullivan
cc9b4f47aa Export PokeUDP helper function 2024-05-15 20:30:48 -07:00
Kubernetes Prow Robot
8362f51c66 Merge pull request #124876 from danwinship/kind-loadbalancers-1
e2e-kind-cloud-provider-loadbalancer fixes, part 1
2024-05-15 07:09:53 -07:00
Sascha Grunert
104b5a0f2c Fix assertion for host network hostname e2e test
The original assumption is wrong, as the node name may not match the
hostname of the host in some circumstances.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2024-05-13 14:36:10 +02:00
Dan Winship
85d5b4bd4a Skip source IP preservation checks for Proxy-type load balancers
To be revisited
2024-05-11 08:32:41 -04:00
Dan Winship
79394a1cbd Don't require ICMP reject on UDP LB with no endpoints
Allow either drop or reject; we previously made the same change for
TCP load balancers.
2024-05-11 08:32:41 -04:00
Kubernetes Prow Robot
d36b267023 Merge pull request #124660 from danwinship/feature-loadbalancer
Fix LoadBalancer tests to be provider-agnostic
2024-05-09 01:23:11 -07:00
Kubernetes Prow Robot
7ac9237b89 Merge pull request #124725 from aojea/e2e_network_test
Debug E2e network test flake
2024-05-08 04:15:45 -07:00
Kubernetes Prow Robot
74ae6d1b4b Merge pull request #124428 from yashsingh74/yashsingh/hostname-test
Added a testcase to check hostname and hostNetwork
2024-05-07 20:42:54 -07:00
Dan Winship
67e0c519e3 Fix references to "ESIPP" and "OnlyLocal" in network e2e tests 2024-05-07 21:11:13 -04:00
Dan Winship
2d5f148d4a Add feature.LoadBalancer and remove provider-based skips from LB tests 2024-05-07 21:11:13 -04:00
Dan Winship
582a49599a Update the "new" code to pass current lint 2024-05-07 21:11:07 -04:00
Dan Winship
b421bde1de Drop GCE-only tests and subtests from LoadBalancer tests 2024-05-07 11:33:26 -04:00
Dan Winship
35a8c0fb3f Add back the previously-removed loadbalancer e2e tests
(No changes from before they were deleted, and thus they don't
actually compile because of missing provider code.)
2024-05-07 11:31:32 -04:00
Antonio Ojea
ff8573343c Revert "e2e/network: stream pod logs for debugging"
This reverts commit d70f96fe22.
2024-05-07 08:53:27 +00:00
Davanum Srinivas
7187d9af81 address comments during review
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-05-01 18:01:25 -04:00
Davanum Srinivas
efdb2961b6 drop unused code pointed out by linter
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-05-01 09:03:57 -04:00
Davanum Srinivas
bf268f02a3 Remove gcp in-tree cloud provider and credential provider
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-05-01 09:03:53 -04:00
Daman Arora
d70f96fe22 e2e/network: stream pod logs for debugging
Intermittent logging to understand root cause of
https://github.com/kubernetes/kubernetes/issues/123760

Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-05-01 11:27:11 +05:30
Yash Kumar Singh
091a05b1cb Added a testcase to check hostname and hostNetwork 2024-04-29 11:09:59 +05:30
Antonio Ojea
484f8bc54b tag TrafficDistribution tests to avoid running on clusters without the feature enabled 2024-04-26 17:15:35 +00:00
Kubernetes Prow Robot
7fa3098a9d Merge pull request #124161 from aojea/lb_timeout
fix e2e loadbalancer test timeouts and assumptions
2024-04-23 09:29:16 -07:00
huweiwen
6ec421e2cf test/e2e: do not use global variable for image
We have "-kube-test-repo-list" command line flag to override the image registry. If we store it in global variable, then that overriding cannot take effect.

And this can cause puzzling bugs, e.g.: containerIsUnused() function will compare incorrect image address.
2024-04-22 19:29:39 +08:00
Dan Winship
a1c1ef31df Remove unnecessary e2e feature.UDP
[Feature:UDP] was probably added in the past by analogy to
[Feature:SCTP], but is unnecessary since UDP support has always been
required.
2024-04-20 10:02:59 -04:00
Antonio Ojea
9a40ea2e28 fix e2e loadbalancer test timeouts and assumptions
Change-Id: Ie9e30ef8e0b20863210bd4a2b5c12e1709654b76
2024-04-03 08:03:44 +00:00
Gaurav Kumar Ghildiyal
6680700b5d Add e2e and integration tests for Service.spec.trafficDistribution (#123812)
* Add e2e tests for Service.spec.trafficDistribution

* Fix linting issue

* Fix spelling

* Add integration tests for trafficDistribution

* Use nodeSelection instead of nodeName to schedule pods on a specific zonal node

* Fix import alias corev1 -> v1 in e2e test

* Address comments

* Add a way to only print log lines in case of errors. This is deemed to be good behaviour by e2e tests guidelines
2024-03-13 14:46:21 -07:00
Aaron U'Ren
d2051503a3 e2e/service.go: remove same node nodeport test
Remove local pod -> local nodeport from service termination test
2024-03-01 17:01:07 -06:00
Shiming Zhang
d303cec118 Update test 2024-02-29 11:48:18 +08:00
carlory
63e91ed023 remove deprecated framework.ExpectNotEqual 2024-02-06 02:53:28 +08:00
Kubernetes Prow Robot
57e9981dc2 Merge pull request #122865 from pohly/e2e-framework-logging
e2e framework: unify logging, support skipping helpers
2024-02-01 09:37:02 -08:00
Qi Ni
2c829cf29b chore: Refactor network load balancer creation in e2e tests
Refactor the code related to creating an internal type load balancer in the e2e tests for network load balancers. The modification removes the check for the "azure" provider and updates it to only check for "gke" and "gce" providers. This change ensures that the test only runs when the cluster is using "gke" or "gce" as the provider. The counterpart test is in the out-of-tree cloud provider azure.
2024-01-29 14:15:25 +08:00
Patrick Ohly
43539c855f e2e framework: unify logging, support skipping helpers
ginkgo.GinkgoHelper is a recent addition to ginkgo which allows functions to
mark themselves as helper. This then changes which callstack gets reported for
failures. It makes sense to support the same mechanism also for logging.

There's also no reason why framework.Logf should produce output that is in a
different format than klog log entries. Having time stamps formatted
differently makes it hard to read test output which uses a mixture of both.
Another user-visible advantage is that the error log entry from
framework.ExpectNoError now references the test source code.

With textlogger there is a simple replacement for klog that can be reconfigured
to let the caller handle stack unwinding. klog itself doesn't support that
and should be modified to support it (feature freeze).

Emitting printf-style output via that logger would work, but become less
readable because the message string would get quoted instead of printing it
verbatim as before. So instead, the traditional klog header gets reproduced
in the framework code. In this example, the first line is from klog, the second
from Logf:

    I0111 11:00:54.088957  332873 factory.go:193] Registered Plugin "containerd"
    ...
      I0111 11:00:54.987534 332873 util.go:506] >>> kubeConfig: /var/run/kubernetes/admin.kubeconfig

Indention is a bit different because the initial output is printed before
installing the logger which writes through ginkgo.GinkgoWriter.

One welcome side effect is that now "go vet" detects mismatched parameters for
framework.Logf because fmt.Sprintf is called without mangling the format
string. Some of the calls were incorrect.
2024-01-20 18:23:31 +01:00
Patrick Ohly
3aa366a3eb e2e: remove dead code
The dead code was found with:

    deadcode -test -filter=k8s.io/kubernetes/test/e2e/framework/... ./test/e2e ./test/e2e_node ./test/e2e_node ./test/e2e_kubeadm

See https://go.dev/blog/deadcode for an introduction.

Only dead code which is clearly not needed anymore (glog logging),
questionable (skipping based on feature gates) or
redundant (WaitForPodSuccessInNamespaceSlow) gets removed for now. More
removals might make sense in the future.
2024-01-17 12:57:35 +01:00
Kubernetes Prow Robot
12fc215656 Merge pull request #122663 from aroradaman/drop-ct-state-invalid-rule
pkg/proxy/nftables: drop conntrack state invalid rule
2024-01-13 19:01:16 +01:00
Kubernetes Prow Robot
c9158e9a19 Merge pull request #122595 from dims/support-building-with-and-without-cloud-providers
KUBE_PROVIDERLESS - Support building with and without cloud providers
2024-01-11 05:42:23 +01:00
Daman Arora
b0e929264f e2e/network/conntrack: rename invalid conntrack state test
Signed-off-by: Daman Arora <aroradaman@gmail.com>
2024-01-11 03:11:42 +05:30
Aaron U'Ren
683f7f43af e2e/endpointslice: add ready conditions
Add ready conditions to the Endpoints of the self-generated
EndpointSlice tests so that the readiness is not ambiguous and it will
work across CNIs that filter for ready endpoints.
2024-01-07 19:56:30 -06:00
Davanum Srinivas
549ef5da1b split ingress tests into multiple files
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-01-07 08:16:06 -05:00
Davanum Srinivas
7a236bd7e0 Add providerless tags appropriately in test/
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-01-07 08:16:05 -05:00
Quan Tian
afefc6f4eb Make EndpointSlice API e2e test faster
EndpointSlices and Endpoints usually become ready pretty fast, but the
test always waited 5s before performing every check and it performed the
check 4 times in total, so unnecessarily extends the test 20s.

The commit changes the poll function to perform a check before waiting,
and reduces the interval to 2 seconds to align with other EndpointSlice
tests. It reduces the test duration from 30s to 4s.

Signed-off-by: Quan Tian <qtian@vmware.com>
2024-01-05 18:54:56 +08:00
Aaron U'Ren
d849c625ec Remove kube-proxy proxy detection & increase timeout
Removes kube-proxy specific proxy type detection and globally increases
the timeout for session affinity testing so that it works for more
use-cases by default (noteably including IPVS)
2023-12-22 15:32:36 -06:00
upodroid
60520b6d4a look for the cm after the lb is created 2023-11-09 20:39:42 -06:00
Patrick Ohly
f2cfbf44b1 e2e: use framework labels
This changes the text registration so that tags for which the framework has a
dedicated API (features, feature gates, slow, serial, etc.) those APIs are
used.

Arbitrary, custom tags are still left in place for now.
2023-11-01 15:17:34 +01:00
Antonio Ojea
9917c727a1 test e2e: use new ServiceCIDR API
Change-Id: I82075c4252d8734886f80dd68327fe73e2ed4ba5
2023-10-31 21:05:57 +00:00
Antonio Ojea
cb509b01f3 e2e for ServiceCIDRs
Change-Id: Id7b711e30def4ac02f9e55425b1997d2cfe100f9
2023-10-31 21:05:05 +00:00