Forum Topic

Thanks for your participation and contribution.


Back to Kubernetes

Useful commands for daily work

i90runner1
i90runner1

Get Events and sort by Timestamp

kubectl get events -n kube-system  --sort-by='.metadata.creationTimestamp' -A

Loop through hosts in ingress and quick sanity check http status code

hosts=$(kubectl get ingresses --all-namespaces -o wide -o json | jq -r .items[].spec.rules[].host) 
echo $hosts
#  for host in $hosts ; do echo $host $(curl https://$host --verbose) ; done
# for host in $hosts ; do echo $host $(curl -I https://$host ) ; done
for host in $hosts ; do echo $host $(curl  -s -o /dev/null -w "%{http_code}"  https://$host ) ; done

Last updated

1-1 of 1

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.