From 3ed5cd92a98bdf3467be67bcad7eb5887cb17401 Mon Sep 17 00:00:00 2001 From: Jonas Forsberg Date: Thu, 13 Mar 2025 09:11:47 +0100 Subject: [PATCH] Adds kubectl-deprecated_api --- README.md | 6 ++++++ kubectl-deprecated_api | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100755 kubectl-deprecated_api diff --git a/README.md b/README.md index e52020c..69d1aae 100644 --- a/README.md +++ b/README.md @@ -23,3 +23,9 @@ Usage: | KUBECTL_RSH_IMAGE_TAG | latest | Image tag to use | | KUBECTL_RSH_NAMESPACE | default | Namespace to create the rsh pod in | | KUBECTL_RSH_POD_CREATE_TIMEOUT | 3 | Minutes to wait before failing to create pod | + +## kubectl-deprecated_api +Lists APIs flagged as deprecated + +Usage: + kubectl deprecated-api diff --git a/kubectl-deprecated_api b/kubectl-deprecated_api new file mode 100755 index 0000000..fcd253c --- /dev/null +++ b/kubectl-deprecated_api @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +if ! command -v prom2json > /dev/null; then + echo "You need prom2json to use this command" + exit 1 +fi +kubectl get --raw /metrics | prom2json | jq -c '.[] | select(.name=="apiserver_requested_deprecated_apis").metrics[].labels' | column -t -s'{}[],"'