Is there a command/method to get the time elapsed from the instance a Kubernetes object creation command is launched (e.g., kubectl create -f mydeployment-pod.yaml
), until the Kubernetes object (deployment/pod…) is fully created and in running/ready state.
No, but you can see the events and CreationTimestamp
by kubectl describe deployments <deployment_name>
As mentioned by @Sahadat: there is no native way of calculating that. However, you can use kubectl get events
to see the CreationTimestamp
, firstTimestamp
and lastTimestamp
. You can either request the output in yaml/json format by executing kubectl get events -o yaml
or use custom columns and fields selectors to narrow down the output, for example:
kubectl get events -o custom-columns=FirstSeen:.firstTimestamp,LastSeen:.lastTimestamp,Created:.CreationTimestamp
That of course can be adjusted according to your needs.