Skip to content

Instantly share code, notes, and snippets.

@perbly
perbly / k8saliases.txt
Created October 9, 2025 06:44
Kubernetes aliases
## add to ~/.zshrc or prefered shell
#### SAVE YOUR KEYBOARD KUBERNETES ALIASES #######
## example "k8slogs aws" will grep logs for pods starting with 'aws'
getk8slogs () {
if [ $# -eq 0 ]; then
echo "No arguments supplied"
else
kubectl get pods --all-namespaces -o wide | awk -v reg=$1 '{for (i=1;i<=NF;i++){if($i ~ "^" reg ".*"){system("kubectl logs "$i " --all-containers -n " $1)}}}' | tspin
fi
- source_labels: [__meta_consul_tags]
regex: .*,prometheus_metrics_path=([^,]+),.*
replacement: '${1}'
target_label: __metrics_path__
- source_labels: [__meta_consul_tags]
regex: .*,prometheus_metrics_address=([^,]+),.*
replacement: '${1}'
target_label: __address__
- source_labels: [__meta_consul_tags]
regex: .*,prometheus_metrics=false,.*

Keybase proof

I hereby claim:

  • I am perbly on github.
  • I am pbpb (https://keybase.io/pbpb) on keybase.
  • I have a public key ASCsmqoOECnu-12EWONOWHufy-3oGtDRToeywu0xSwof7go

To claim this, I am signing this object: