Skip to content
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

Wait for available API token in a new namespace #7045

Merged
merged 1 commit into from
Dec 19, 2020

Conversation

oomichi
Copy link
Contributor

@oomichi oomichi commented Dec 16, 2020

What type of PR is this?

/kind failing-test
/kind flake

What this PR does / why we need it:

Just after creating a namespace, the corresponding token could not be created and sometimes the pod creation might be failed.
This adds check of the token in the new namespace to make this test case stable.

Which issue(s) this PR fixes:

Fixes #7043

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. kind/flake Categorizes issue or PR as related to a flaky test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 16, 2020
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 16, 2020
@oomichi oomichi force-pushed the add-wait-for-token branch 2 times, most recently from a0de285 to 8d6c108 Compare December 16, 2020 21:21
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 16, 2020
Just after creating a namespace, the corresponding token could not be
created and sometimes the pod creation might be failed.
This adds check of the token in the new namespace to make this test
case stable.
@oomichi
Copy link
Contributor Author

oomichi commented Dec 17, 2020

/retest

@LuckySB
Copy link
Contributor

LuckySB commented Dec 17, 2020

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 17, 2020
@floryut
Copy link
Member

floryut commented Dec 19, 2020

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 19, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: floryut, LuckySB, oomichi

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 275c54e into kubernetes-sigs:master Dec 19, 2020
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Jan 17, 2021
Just after creating a namespace, the corresponding token could not be
created and sometimes the pod creation might be failed.
This adds check of the token in the new namespace to make this test
case stable.
@oomichi oomichi deleted the add-wait-for-token branch March 2, 2021 16:51
VannTen added a commit to VannTen/kubespray that referenced this pull request Oct 25, 2024
…igs#7045)"

This reverts commit 275c54e.

Static tokens are no longer created automatically for service account in
Kubernetes. Instead, they are dynamically injected into pods using a
projected volume.

Thus there is no longer a need to check for this (it didn't work anyway,
since the describe output actually contains <none> when there is no
tokens:
{
  "attempts": 1,
  "changed": false,
  "cmd": "set -o pipefail && /usr/local/bin/kubectl describe serviceaccounts default --namespace test | grep Tokens | awk '{print $2}'",
  "delta": "0:00:00.075633",
  "end": "2024-10-19 14:25:04.858871",
  "msg": "",
  "rc": 0,
  "start": "2024-10-19 14:25:04.783238",
  "stderr": "",
  "stderr_lines": [],
  "stdout": "<none>",
  "stdout_lines": [
    "<none>"
  ]
}
)
VannTen added a commit to VannTen/kubespray that referenced this pull request Dec 12, 2024
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.
VannTen added a commit to VannTen/kubespray that referenced this pull request Dec 12, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. kind/flake Categorizes issue or PR as related to a flaky test. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TASK [Run 2 busybox pods in test ns] was failed on packet_centos8-calico
4 participants