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

CoreV1().Pods.List and pod.Status.Phase == apiv1.PodRunning is not a good way to test if pods are Running #815

Closed
BrunoMCBraga opened this issue Jun 16, 2020 · 6 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@BrunoMCBraga
Copy link

Hello guys

What is my k8s client-go version? Latest but this is my go.sum:

k8s.io/client-go v0.0.0-20200307122516-5194bac86967
k8s.io/client-go v0.0.0-20200307122516-5194bac86967/go.mod
k8s.io/client-go v0.17.0
k8s.io/client-go v0.17.0/go.mod
k8s.io/client-go v11.0.0+incompatible
k8s.io/client-go v11.0.0+incompatible/go.mod

I am using this library to deploy Docker containers on Amazon and after the deployment is done, i check the status of the pods with: pod.Status.Phase == apiv1.PodRunning.

However, looking at all the possible states (https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/), it seems none is good enough to test the pod is healthy and running. Running only means the Container has been started or is starting but i noticed that sometimes the check succeeds but then the pod is stuck on CrashLoopBackOff.

Any ideas on how to wait for all the containers to be in a Running state? Succeeded does not work for me because i expect the container to keep running.

Best regards and thank you

PS: Let me know if you need more information regarding versions. I assume the problem is generic enough.

@BrunoMCBraga
Copy link
Author

BUMP

@avtarOPS
Copy link

Yeah had to see the Status from Condition in PodStatus struct. IsPodReady function is also there which can be used https://godoc.org/k8s.io/kubernetes/pkg/api/v1/pod didn't use it though.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 22, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Dec 22, 2020
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@twgcode twgcode mentioned this issue Jun 10, 2022
pierDipi added a commit to pierDipi/eventing-kafka-broker that referenced this issue Aug 19, 2022
…ods are Running

See kubernetes/client-go#815

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
pierDipi added a commit to pierDipi/eventing-kafka-broker that referenced this issue Aug 19, 2022
…ods are Running

See kubernetes/client-go#815

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
pierDipi added a commit to pierDipi/eventing-kafka-broker that referenced this issue Aug 19, 2022
…ods are Running

See kubernetes/client-go#815

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
pierDipi added a commit to pierDipi/eventing-kafka-broker that referenced this issue Aug 19, 2022
…ods are Running

See kubernetes/client-go#815

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
pierDipi added a commit to pierDipi/eventing-kafka-broker that referenced this issue Aug 19, 2022
…ods are Running

See kubernetes/client-go#815

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
knative-prow bot pushed a commit to knative-extensions/eventing-kafka-broker that referenced this issue Aug 23, 2022
…ods are Running (#2523)

See kubernetes/client-go#815

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
knative-prow-robot pushed a commit to knative-prow-robot/eventing-kafka-broker that referenced this issue Aug 23, 2022
…ods are Running

See kubernetes/client-go#815

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
knative-prow-robot pushed a commit to knative-prow-robot/eventing-kafka-broker that referenced this issue Aug 23, 2022
…ods are Running

See kubernetes/client-go#815

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
knative-prow-robot pushed a commit to knative-prow-robot/eventing-kafka-broker that referenced this issue Aug 23, 2022
…ods are Running

See kubernetes/client-go#815

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
knative-prow bot pushed a commit to knative-extensions/eventing-kafka-broker that referenced this issue Aug 23, 2022
…ods are Running (#2544)

See kubernetes/client-go#815

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Co-authored-by: Pierangelo Di Pilato <pierdipi@redhat.com>
knative-prow bot pushed a commit to knative-extensions/eventing-kafka-broker that referenced this issue Aug 23, 2022
…ods are Running (#2543)

See kubernetes/client-go#815

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Co-authored-by: Pierangelo Di Pilato <pierdipi@redhat.com>
openshift-merge-robot pushed a commit to openshift-knative/eventing-kafka-broker that referenced this issue Aug 23, 2022
…ods are Running (#383)

See kubernetes/client-go#815

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
knative-prow bot pushed a commit to knative-extensions/eventing-kafka-broker that referenced this issue Aug 24, 2022
…ods are Running (#2545)

See kubernetes/client-go#815

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>

Signed-off-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Co-authored-by: Pierangelo Di Pilato <pierdipi@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

4 participants