Skip to content

Instantly share code, notes, and snippets.

@davidwalter0
Last active March 2, 2019 22:25
Show Gist options
  • Save davidwalter0/1883e2b3d0f96e18f464d4fc9000e745 to your computer and use it in GitHub Desktop.
Save davidwalter0/1883e2b3d0f96e18f464d4fc9000e745 to your computer and use it in GitHub Desktop.
kubernetes / jq example rule
#!/bin/bash
kubectl get no -o json|jq -r '.items[]|select(.metadata.name == "node1.example.com")|.metadata' | cat -
curl 0.0.0.0:8080/api/v1/nodes|jq -r '.items[]|select(.metadata.name == "node1.example.com")|.metadata' | cat -
kubectl get no -o json|jq -r '.items[]|select(.metadata.name == "node1.example.com")|.metadata.annotations."flannel.alpha.coreos.com/backend-data"' | cat -
curl -s 0.0.0.0:8080/api/v1/nodes|jq -r '.items[]|select(.metadata.name == "node1.example.com")|.metadata.annotations.flannel.alpha.coreos.com/backend-data' | cat -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment