The patch is to fix a scenario when LB or Pool ID
is not available while attempting to reconcile members.
Change-Id: I3d6e09f0a17228994032eba2fecf9f7663e6cf14
This commit extends the loadbalancer reconcilation tempest
test to cover for when the listeners are deleted on OpenStack
Implements: blueprint reconcile-openstack-resources-with-k8s
Change-Id: If14b468e9a5f7d2c1492881d5a75ac8807030c4e
There is a need for changing names again, since namespace id is no
longer stored in description and name for net/subnet is a compound of
name and uid.
Depends-On: https://review.opendev.org/c/openstack/kuryr-tempest-plugin/+/845745
Change-Id: Ib97a597f8afb47316e77154a9bf3ced41ce48468
Seems like folks developing Python kubernetes client had move the
ApiException around. So the backward-compatible way of using it is
kubernetes.client.rest.ApiException and trying to use it by
kubernetes.client.excetpions.ApiException will not work in older library
versions. As this client is supposed to still be compatible with
stable/victoria and kubernetes==11.0.0, this commit changes the
exception module to `rest` where needed.
Change-Id: If056529d49a053970891f89d12007174f544a551
During execution it may happen, that there will be UnboundLocalError
exception thrown for crd_lb_ip variable, due to unmet condition for
service ip not being set in the KuryrLoadbalancerCRD. Fixed by simply
defining variable.
Change-Id: Ie879ba0b9b85111ec1b906d66ec48127ce8dd1f9
In test_kuryr_restart use one pod to check connectivity to the
created pods from this pod instead of assigning a fip for each created
pod. This can solve problems when there is shortage of floating ips.
Also, Don't fail on deletion of a pod in cleanup if it's not found
Change-Id: I55a33f88356ff3d1ef6ed0ce83bb102172e46023
Set kns_crd dictionary initial value in order to avoid the
unhandled error `UnboundLocalError: local variable 'kns_crd'
referenced before assignment` when the timeout_period is
reached.
Change-Id: I20f9c2400dd0ecf0171f02d7cfd3fc10923f4d18
When testing UDP connectivity to a Service we're using ncat with `-w 5`
option. This sets the connectivity timeout to that value. However our
`exec_command_in_pod()` method is run in async mode and defaults timeout
to wait for completion to just 2 seconds. This is in conflict and if for
some reason UDP server on the pod is slow, will terminate the request
before it's completed, leaving empty stdout but also stderr, so that we
won't even log the error response.
This commit bumps that timeout to 10 seconds to give the pod time to
actually response. I decided to bump it for all the checks as we've seen
this happening with SCTP tests as well and I expect this might have the
same cause.
Change-Id: I303b87d01496cf7353b2b8b699e0dce598e032ab
That support is long gone from kuryr-kubernetes and this commit removes
the tests that are no longer needed.
Change-Id: I3593285d09ecde0c2bdc14805adc39630a592a49
As the K8s client is logging every response to every request, we're
starting to hit limits of tox' or Zuul's log side limit. This commit
attempts to limit number of requests by making sure that in case of
status checks we're iterating a list of pods instead of calling API for
every pod. Moreover many `time.sleep()` occurences are modified to
reduce the number of the requests made.
Change-Id: Ifc2dfce2405429bbcae8c01f13f06d4e9fae9c8a
Seems like the test in question was only waiting for the NP to get the
podSelector written into the status and not for the expected and
existing SG rules to match. This commit fixes that.
Change-Id: I04c3906225877caafe26487696991e9e3dbaf082
There are some old kuryr-kubernetes versions that don't
support LB pool members removal upon endpoint deletion.
For such cases, and in order to be able to run the test
test_service_without_selector for all the versions, a
new configuration option test_endpoints_object_removal
is defined.
It's expected to set test_endpoints_object_removal to
False in those environments where the removal is not
supported, and keep it to the default True value in
the rest of them.
Change-Id: I8c2d6e8e66d707fcf22311456c0584a6167acea1
It was complaining about string formatting when the timeouts
were being reached:
TypeError: not all arguments converted during string formatting
Change-Id: Ia926be7d43c0f06b775a35092fe644c0c7b78b1d
This test case automates the issue described in
BZ https://bugzilla.redhat.com/show_bug.cgi?id=1980957.
The new test case:
- creates a deployment with a failing readiness probe so all
the pods are not ready
- creates a service for the deployment (where the endpoints
are not ready)
- it checks Kuryr pods are not restarted
Change-Id: Id19f85625901b35900f9441aace8fe8938cb1d68
Move ingress_cidrs_found and egress_cidrs_initialization to
inside the while loop so they're cleared in each iteration.
Move rule match comprobation outside the rules for loop.
Change-Id: I1acba9f407de084f19d9ee12fb6e95de03d578df
The test test_egress_np_to_service_wo_selector is failing in some
environments when checking the connectivity to services (before
the NP is applied). The endpoints are defined in kuryrloadbalancers
objects but the connectivity is not working.
This change adds the method wait_until_service_LB_is_active() and
calls it in that test before checking the connectivity to the
services.
Change-Id: I41cec1ea1db43e2fbeb0bf6d5fafb84c87e77d1c
For svc and route endpoint connectivity checks there is a repetition
parameter that can be tuned to be proportional to the expected number
of different endpoint responses.
For each expected different backend 10 repetitions seems to be enough
and it will save significant tests execution time.
Change-Id: Id9e6389bfafc89a4d407952ee0625a932b51ef38
This commit ensures the load-balancer is active before checking
connectivity to it for the scenario of test_pod_service_curl.
Change-Id: I935cc510d8d96ca031f30c4a3dbdfec6a6238e92
The method has the status parameter but then it's not being used
to compare with the obtained status, as 'Running' is always used.
This change replaces the hardcoded status with the status parameter.
Change-Id: I7c716dd11f4ed14a31fd5d5aa4706db136cbbeed
Using the CONF.kuryr_kubernetes.lb_build_timeout config option instead
of the LB_TIMEOUT constant allows modifing the LB creation timeout for
different environments where the LB creation time can vary
significantly.
Remove LB_RECONCILE_TIMEOUT as well in favor of a new config option
CONF.kuryr_kubernetes.lb_reconcile_timeout.
Change-Id: Id1eb72c294abd6a2e5111bd0c7f97e311969b698
Remove the usage of the bool() method as it wasn't behaving as expected
- bool("False") returns True instead of False.
The get_readiness_state() method was returning a string when
container_name wasn't None and it's been changed to return a boolean
instead.
container.ready param is already a Boolean but condition.status is a
string.
Increase the timeout waiting for pods to be ready after scaling in the
scale_deployment() method.
Change-Id: Ie64f868b877ca4c9f1ff8916360638f013fc2926
For some unknown reason kubernetes==21.7.0 renamed V1EndpointPort to
CoreV1EndpointPort while other V1Endpoint* haven't got the prefix. This
seems like a bug, but in order to deal with it, this patch adds a
fallback to the new name.
Change-Id: I4c38c09faba99c8ca56abc0a32bc421011f9b2dd
Clean-up in get_pod_readiness() method definition and change a reference to
get_pod_readiness() by get_container_readiness().
Change-Id: Icf2b7b99d5142298bd9a11d79ae05e83932d270a
With the handling of Namespaces now being
dependent on Pods creation, tempests tests
need to get updated to account for that.
Updated port_pool test
Change-Id: Icd96eeb0594d43d82d72fa5f065f0c89021b935b
Depends-on: I0a69e0963aaef186238c0e1bd0bdc4430e3e197c