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

Differences between displaying "Age" in the Dashboard and in a console #573

Closed
kwodzynski opened this issue Mar 24, 2016 · 4 comments
Closed
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@kwodzynski
Copy link

Issue details

Differences between displaying "Age" in the Dashboard and in a console.
In web application are empty values in column "Age" when POD has status "Pending", but in console in the same situation "Age" is normally displaying

Environment
Dashboard version: gcr.io/google_containers/kubernetes-dashboard-amd64:v1.0.0
Kubernetes version: v1.3.0-alpha.0.604+b494cbc0c17dd7
Operating system: linux/amd64
Node.js version: v0.10.40
Go version: go1.4.2
Steps to reproduce

I have correctly Replication controller and i go to PODS view. Next I type the command "kubectl get pods --all-namespaces" into console.

Observed result

In console "Age" is displaying for all of PODS, but in Dashboard only if status is "Running", for "Pending" column "Age" has empty values.
noage

Expected result

Views in Dashboard and in consol should be the same.

Comments
@maciaszczykm maciaszczykm self-assigned this Mar 25, 2016
@bryk
Copy link
Contributor

bryk commented Mar 29, 2016

Hmm... Interesting. Marcin, take a look and triage this bug.

@maciaszczykm
Copy link
Member

- character is shown when pod.startTime is not provided to front-end. In back-end we take this value from Kubernetes API:

StartTime:    pod.Status.StartTime,

Where it's described as:

// Date and time at which the object was acknowledged by the Kubelet.
// This is before the Kubelet pulled the container image(s) for the pod.
StartTime *unversioned.Time `json:"startTime,omitempty"`

It works in most of the cases, but when we are testing it on replication controllers with bigger number of pods it doesn't return any value for some of them (usually ones, that are in pending status and won't be started soon).

I'd say we need to investigate how kubectl works and follow their way of getting pods age to make it work. Moreover, I'm still not sure why it doesn't work at the moment...

@maciaszczykm
Copy link
Member

Result of log.Print(pod.Status.StartTime); in the back-end:

2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 <nil>
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 <nil>
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 <nil>
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 <nil>
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 <nil>
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST
2016/03/29 14:12:53 2016-03-29 14:00:10 +0200 CEST

So it's not entirely our fault. kubectl should be an answer to this issue.

@maciaszczykm
Copy link
Member

Okay, it seems, that I've solution for this issue. We've to use pod.CreationTimestamp instead of pod.Status.StartTime:

// CreationTimestamp is a timestamp representing the server time when this object was
// created. It is not guaranteed to be set in happens-before order across separate operations.
// Clients may not set this value. It is represented in RFC3339 form and is in UTC.
CreationTimestamp unversioned.Time `json:"creationTimestamp,omitempty"`

I'll create pull request soon :)

@maciaszczykm maciaszczykm added kind/bug Categorizes issue or PR as related to a bug. priority/P2 labels Mar 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

3 participants