You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During my recent CKAD exam, I was asked similar question but I'm not sure how the solution you have provided is matching the question. Please clarify.
As per the question we need to get namespace and pod name in the format /, but the answer you have given is to get all columns, please clarify.
"Lots of pods are running in qa,alan,test,production namespaces. All of these pods are configured with liveness probe. Please list all pods whose liveness probe are failed in the format of / per line."
The text was updated successfully, but these errors were encountered:
Hi,I think the following solution might be able to answer the question, I will go through all the namespaces instead of just the mentioned names but you can use try it with multiple namespaces.
kubectl get events -A | grep -i "Liveness probe are failed " | awk '{print $1 "/"$5}
This answers the question but you can even get the columns that are output of the command kubectl get events -A and then grep the required output
kubectl get events -A -o custom-columns="Namespace:.metadata.namespace,PodName:involvedObject.name,Message:message" | grep -i "Liveness probe errored" |awk {'print $1"/"$2'}
You can also refer to the solution mentioned here #177 (comment)
During my recent CKAD exam, I was asked similar question but I'm not sure how the solution you have provided is matching the question. Please clarify.
As per the question we need to get namespace and pod name in the format /, but the answer you have given is to get all columns, please clarify.
"Lots of pods are running in qa,alan,test,production namespaces. All of these pods are configured with liveness probe. Please list all pods whose liveness probe are failed in the format of / per line."
The text was updated successfully, but these errors were encountered: