client.CoreV1Api.read_namespaced_pod(pod_name, pod_namespace) returning incomplete data for several minutes after pod is deployed #2201
Labels
kind/bug
Categorizes issue or PR as related to a bug.
client.CoreV1Api.read_namespaced_pod(pod_name, pod_namespace)
returns incomplete data for several minutes after pod is deployed if it is queried as soon as pod is deployed.A bit more detail ...
I am deploying a pod and then immediately using the
read_namespaced_pod
method to determine the pod IP. Here is an outline of the code I am running. pod_ip is set to None for several minutes after the pod is deployed, and well after I can query the pod IP usingkubectl describe pod <pod_name>
. Presumably the read_namespaced_pod is returning a cached result that contains incomplete data.pod = read_namespaced_pod(pod_name, pod_namespace)
pod_ip = pod.status.pod_ip
I've worked around this for now by inserting a 10s sleep after a pod is deployed before attempting to determine the pod_ip. That appears to be consistently working.
The text was updated successfully, but these errors were encountered: