-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix flakey test + cleanup in testcases/030-checknetwork #11792
Fix flakey test + cleanup in testcases/030-checknetwork #11792
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: VannTen The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This is a followup to 2ba28a3 (Revert "Wait for available API token in a new namespace (kubernetes-sigs#7045)", 2024-10-25). While checking for the serviceaccount token is not effective, there is still a race when creating a Pod directly, because the ServiceAccount itself might not be created yet. More details at kubernetes/kubernetes#66689. This cause very frequent flakes in our CI with spurious failures. Use a Deployment instead ; it will takes cares of creating the Pods and retrying ; it also let us use kubectl rollout status instead of manually checking for the pods.
There is no pods with hostNetwork deployed in this test, and therefore the tasks are skipped / empty output (checked in CI).
3889889
to
12ed1fc
Compare
/ok-to-test |
runAsUser: 1000 | ||
runAsNonRoot: true | ||
seccompProfile: | ||
type: RuntimeDefault |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI @VannTen
If there is podAntiAffinity
to assign the pod between nodes, it can help to test the network connection between nodes.
Is it a good idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not, but I would put that in another PR.
Here I'm just switching to Deployment to avoid (well, rather, make it the controller problem ^^) the race with de sa cration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @VannTen
/lgtm
What type of PR is this?
/kind flake
What this PR does / why we need it:
Follow-up to #11667
Basically, creating a pod just afer its namespace is racey (see Creating a pod fails if default service account does not exist with the default service account enabled. kubernetes/kubernetes#66689)
Instead we create a deployment.
Cleanup of noop tasks in 030-checknetwork (no idea why we're checking for hostNetwork pods here when we don't have any, see commit message for full details)
Which issue(s) this PR fixes:
Fixes #
Does this PR introduce a user-facing change?:
/label tide/merge-method-merge