Skip to content

Instantly share code, notes, and snippets.

@cdelashmutt-pivotal
Created March 21, 2024 16:07
Show Gist options
  • Save cdelashmutt-pivotal/40e4ed50e90e92243a2a47b29146626f to your computer and use it in GitHub Desktop.
Save cdelashmutt-pivotal/40e4ed50e90e92243a2a47b29146626f to your computer and use it in GitHub Desktop.
Query for APIs Deprecated in Kubernetes 1.25
#!/bin/bash
# You can reference specific API versions from the `kubectl` cli using the following format:
# kubectl get <pluralized-object-name>.<version>.<api-group>
# batch/v1beta1 API version of CronJob
echo "-- CronJobs --"
kubectl get cronjobs.v1beta1.batch -A
# discovery.k8s.io/v1beta1 API version of EndpointSlice
echo "-- EndpointSlices --"
kubectl get endpointslices.v1beta1.discovery.k8s.io -A
# events.k8s.io/v1beta1 API version of Event
echo "-- Events --"
kubectl get events.v1beta1.events.k8s.io -A
# autoscaling/v2beta1 API version of HorizontalPodAutoscaler
echo "-- HorizontalPodAutoscalers --"
kubectl get horizontalpodautoscalers.v2beta1.autoscaling -A
# policy/v1beta1 API version of PodDisruptionBudget
echo "-- PodDisruptionBudgets --"
kubectl get poddisruptionbudgets.v1beta1.policy -A
# PodSecurityPolicy in the policy/v1beta1 API
echo "-- PodSecurityPolicies --"
kubectl get podsecuritypolicies.v1beta1.policy -A
# RuntimeClass in the node.k8s.io/v1beta1 API
echo "-- RuntimeClasses --"
kubectl get runtimeclasses.v1beta1.node.k8s.io -A
echo
echo "Migration instructions are available at https://kubernetes.io/docs/reference/using-api/deprecation-guide/#v1-25"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment