Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liveness probe #187

Closed
Venkateshjsoft opened this issue Apr 26, 2021 · 2 comments
Closed

Liveness probe #187

Venkateshjsoft opened this issue Apr 26, 2021 · 2 comments

Comments

@Venkateshjsoft
Copy link

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."

@ahmedqazi444
Copy link

ahmedqazi444 commented Apr 26, 2021

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)

@Venkateshjsoft
Copy link
Author

Closing the issue as I received expected response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants