tags | |||
---|---|---|---|
|
kubectl get nodes -ogo-template='{{range .items}}{{ if .status.volumesAttached }}{{.metadata.name}} - {{.status.volumesAttached | len}}{{"\n"}}{{end}}{{end}}'
Note: This only works in non-CSI environments.
kubectl get secret my-secret -ogo-template='{{index .data "config.yaml" | base64decode}}'
kubectl -n kube-public --as system:serviceaccount:monitoring:prometheus-operator get prometheusrules
see gist runs in kube-system debug-ds.yaml
kubectl apply -f https://gist.githubusercontent.com/chrigl/6184d4de911052711b149665829ce66d/raw/11ec5a0196fd0c8f415e7a3faf53e68e523d66e4/debug-ds.yaml
kubectl logs -p -c ruby web-1
No error handling here, so be prepared for jq: error (at <stdin>:17450): Cannot iterate over null (null)
kubectl get jobs -ojson -A | jq -r '.items[] | select(.status.conditions[] | select(.reason=="BackoffLimitExceeded" and .type == "Failed" and .status == "True")) | [.metadata.namespace, .metadata.name] | @tsv'
Hmm. Maybe not the right place here, but good for now.
ingress-nginx
doesn't write the the full configuration to /etc/nginx/nginx.conf
but uses lua for some parts. There is a tool /dbg
in the container to help debugging.
$ /dbg --help
dbg is a tool for quickly inspecting the state of the nginx instance
Usage:
dbg [command]
Available Commands:
backends Inspect the dynamically-loaded backends information
certs Inspect dynamic SSL certificates
completion Generate the autocompletion script for the specified shell
conf Dump the contents of /etc/nginx/nginx.conf
general Output the general dynamic lua state
help Help about any command
Flags:
-h, --help help for dbg
--status-port int Port to use for the lua HTTP endpoint configuration. (default 10246)
Use "dbg [command] --help" for more information about a command.
kubectl -n cortex get ingress -oyaml | yq e '.items[] | split_doc'