-
Notifications
You must be signed in to change notification settings - Fork 40.5k
Expose pod start time via the Downward API #36813
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
Comments
I'm not sure about implementation as the creationTime is set in status after the Pod is created, which means having an env var that points to that field will always result to that env var being empty (because the vars are set before pod is created). |
@mfojtik the creation time is metadata but I also think the pod IP is accessible via the downward API, isn't that also status? |
also, creationTime != scheduled time != started time... I don't think I'd want processes in a pod timing anything from when the pod was created |
Right, we want the start time. But the status is still accessible via the downward api. |
I think this is very reasonable to support. |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Or exec /close |
@Kargakis will uptime return the actual uptime of the pod? What if the pod has been restarted (say, due to an intermittent failure)? I'd be nice to know the actual time the pod was started, which if I understand this correctly may not line up with Any chance that this could be reconsidered as something to add into the API? |
Uptime seems to reflect the hosts' uptime, and not that of the pod. |
Use-case: a Job or Pod that needs to set timeouts in various points in its lifecycle. For example, a deployer pod that has a global timeout to finish its work and various steps need to use a timeout too.
Deployer pod with a timeout of 10 minutes:
The wait part in the second step needs a timeout of (10m - (time.Now - podStartTime)). The only way to achieve this currently is to use a pod client in the pod and query the api server.
cc: @mfojtik @pmorie
The text was updated successfully, but these errors were encountered: