How to check a particular script execution is completed by a Kubernetes pod How to check a particular script execution is completed by a Kubernetes pod kubernetes kubernetes

How to check a particular script execution is completed by a Kubernetes pod


So you also need to check for the pods to be in Running state (all containers in the pod)

# wait for the pod check_pod_state("cos-plugin-diag")

So if the Pod has 2 containers, for example, you should check for 2/2

Example:

NAME                                                                 READY     STATUS    RESTARTS   AGEcalico-node-9wnst                                                    2/2       Running   0          6d

The other aspect that you need to check a string in the log file that determines the end of your log and you can check it with

kubectl logs <pod-name> -c <container-if-multiple-containers> -n <your-namespace>

Hope it helps