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

Pod restarts not showing up in details #2259

Closed
abuehrle opened this issue Feb 17, 2017 · 6 comments
Closed

Pod restarts not showing up in details #2259

abuehrle opened this issue Feb 17, 2017 · 6 comments
Assignees
Labels
feature Indicates that issue is related to new end user functionality k8s Pertains to integration with Kubernetes
Milestone

Comments

@abuehrle
Copy link
Contributor

When I run kubectl get pods --all-namespaces in the terminal on the master host in Scope, I see a number of container in the sockshop have restarted:

screen shot 2017-02-17 at 1 10 33 pm

But this information is not displayed on the container and says 0:

screen shot 2017-02-17 at 1 11 01 pm

@2opremio 2opremio changed the title Container restarts not showing up in details Pod restarts not showing up in details Feb 17, 2017
@2opremio 2opremio added feature Indicates that issue is related to new end user functionality k8s Pertains to integration with Kubernetes labels Feb 17, 2017
@2opremio 2opremio added this to the 1.3 milestone Feb 17, 2017
@rade rade added bug Broken end user or developer functionality; not working as the developers intended it and removed feature Indicates that issue is related to new end user functionality labels Apr 6, 2017
@rade
Copy link
Member

rade commented Apr 6, 2017

surely the fact that it says 0 is a bug. -> changing labels.

@rade
Copy link
Member

rade commented May 18, 2017

When pods restart, do their containers get re-created or re-started?

@2opremio
Copy link
Contributor

Good question. I would say they are restarted. I think that the restart count is obtained from docker and I would doubt we have a bug specifically for the kubernetes case.

@rade
Copy link
Member

rade commented May 18, 2017

Hmmm.

$ docker version
Client:
 Version:      17.03.1-ce
 API version:  1.27
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Mon Mar 27 17:14:09 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.03.1-ce
 API version:  1.27 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Mon Mar 27 17:14:09 2017
 OS/Arch:      linux/amd64
 Experimental: false
$ docker run --name test -dti alpine /bin/sh
b70426355549d77aeb632ae38982e06328324a228a56ca5c7835684e2d0efc65
$ docker inspect -f '{{.RestartCount}} {{.State.StartedAt}}' test
0 2017-05-18T14:07:31.877338973Z
$ docker restart -t 0 test
test
$ docker inspect -f '{{.RestartCount}} {{.State.StartedAt}}' test
0 2017-05-18T14:07:40.494411989Z

This suggests to me that k8s is counting something different.

@abuehrle
Copy link
Contributor Author

Docker doesn't seem to have a state 'restarted' but rather they have 'restarting' - in the act of restarting. And Kubernetes has a restart policy that determines if the container is restarted or not:

https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/

@rade rade modified the milestones: 1.3, Next, 1.6 Jul 12, 2017
@2opremio 2opremio self-assigned this Jul 25, 2017
@2opremio
Copy link
Contributor

I think there has been a mix-up here. The details pane shown by @abuehrle (with restart # = 0) corresponds to a container whereas the command-line output corresponds to a kubernetes pod. We don't currently show restart counts for pods in the UI (and as far as I have been able to see, we never had).

The restart counts of containers (based on how many times a specific container been restarted) are totally different to those of a container in a pod (based on the number of different dead containers that have not yet been removed).

To be even more precise, kubectl get pods shows the sum of the restart for all the containers of the pod (init containers make it a bit more complicated but let's not get into that).

So, this is really a new feature, which should be fairly easy to implement.

@2opremio 2opremio added feature Indicates that issue is related to new end user functionality and removed bug Broken end user or developer functionality; not working as the developers intended it labels Jul 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Indicates that issue is related to new end user functionality k8s Pertains to integration with Kubernetes
Projects
None yet
Development

No branches or pull requests

3 participants