Skip to content

Instantly share code, notes, and snippets.

@yuya-maemichi-synspective
Last active June 10, 2024 05:47
Show Gist options
  • Save yuya-maemichi-synspective/728491dc3246c3c308246d0244b2d4c3 to your computer and use it in GitHub Desktop.
Save yuya-maemichi-synspective/728491dc3246c3c308246d0244b2d4c3 to your computer and use it in GitHub Desktop.
k8s snippets
pp %x(kubectl api-versions).scan(/(?:(?<group>\S+)\/)?(?<version>\w+)/)
pp %x(kubectl api-versions).split.map { /(?:(?<group>\S+)\/)?(?<version>\w+)/.match(_1)&.named_captures }
kubectl api-versions | \
ruby -ne 'pp /(?:(?<group>[^\/]*)\/)?(?<version>\w+)/.match($_)&.named_captures'
/(?:(?<group>[^\/]+)\/)?(?<version>\w+)/
.stringData=(.data|with_entries(.value|=@base64d))
kubectl get --show-kind --ignore-not-found --namespace=sieve-dev --output=name $(
kubectl api-resources --namespaced --verbs=list --output=name |
paste -s -d',' -
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment