Mazen Ezzeddine
Mazen Ezzeddine

Reputation: 822

Kubernetes object creation time

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.

Upvotes: 0

Views: 2123

Answers (2)

Wytrzymały Wiktor
Wytrzymały Wiktor

Reputation: 13858

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.

Upvotes: 1

Sahadat Hossain
Sahadat Hossain

Reputation: 4351

No, but you can see the events and CreationTimestamp by kubectl describe deployments <deployment_name>

Upvotes: 0

Related Questions