[!NOTE] A plugin for Kubernetes command-line tool kubectl, which allows you to convert manifests between different API versions. This can be particularly helpful to migrate manifests to a non-deprecated api version with newer Kubernetes release.
# intel$curl-LO"https://dl.k8s.io/release/$(curl-L-shttps://dl.k8s.io/release/stable.txt)/bin/darwin/amd64/kubectl"# apple silicon$curl-LO"https://dl.k8s.io/release/$(curl-L-shttps://dl.k8s.io/release/stable.txt)/bin/darwin/arm64/kubectl"# or via brew$brewinstallkubectl
completion
[!NOTE] The Homebrew installation of bash-completion v2 sources all the files in the BASH_COMPLETION_COMPAT_DIR directory, that's why the latter two methods work
$kubectlgetapiservices.apiregistration.k8s.ioNAMESERVICEAVAILABLEAGEv1.LocalTrue4yv1.appsLocalTrue4yv1.authentication.k8s.ioLocalTrue4yv1.authorization.k8s.ioLocalTrue4yv1.autoscalingLocalTrue4yv1.batchLocalTrue4yv1.monitoring.coreos.comLocalTrue168dv1.networking.k8s.ioLocalTrue4yv1.rbac.authorization.k8s.ioLocalTrue4yv1.storage.k8s.ioLocalTrue4yv1beta1.admissionregistration.k8s.ioLocalTrue4yv1beta1.apiextensions.k8s.ioLocalTrue4yv1beta1.appsLocalTrue4yv1beta1.authentication.k8s.ioLocalTrue4yv1beta1.authorization.k8s.ioLocalTrue4yv1beta1.batchLocalTrue4yv1beta1.certificates.k8s.ioLocalTrue4yv1beta1.coordination.k8s.ioLocalTrue4yv1beta1.events.k8s.ioLocalTrue4yv1beta1.extensionsLocalTrue4yv1beta1.metrics.k8s.iokube-system/metrics-serverFalse (ServiceNotFound) 188dv1beta1.policyLocalTrue4yv1beta1.rbac.authorization.k8s.ioLocalTrue4yv1beta1.scheduling.k8s.ioLocalTrue4yv1beta1.storage.k8s.ioLocalTrue4yv1beta2.appsLocalTrue4yv2beta1.autoscalingLocalTrue4yv2beta2.autoscalingLocalTrue4y0$kubectlgetapiservices.apiregistration.k8s.iov1beta1.metrics.k8s.io-oyaml--exportapiVersion:apiregistration.k8s.io/v1kind:APIServicemetadata:name:v1beta1.metrics.k8s.iospec:group:metrics.k8s.iogroupPriorityMinimum:100insecureSkipTLSVerify:trueservice:name:prometheus-adapternamespace:monitoringversion:v1beta1versionPriority:100status:conditions:-lastTransitionTime:2022-08-15T14:10:39Zmessage:allcheckspassedreason:Passedstatus:"True"type: Available
troubleshooting
[!NOTE|label:references:]
$ kubectl api-resources
error: unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server is currently unable to handle the request
# Edit the last-applied-configuration annotations by type/name in YAMLkubectlapplyedit-last-applieddeployment/nginx# Edit the last-applied-configuration annotations by file in JSONkubectlapplyedit-last-applied-fdeploy.yaml-ojson