Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maheshrayas/kube-depre
CLI tool to list kubernetes deprecated apiVersion in cluster or files
https://github.com/maheshrayas/kube-depre
apis apiversioncheck deprecated deprecated-api gke kubecli kubernetes
Last synced: about 2 months ago
JSON representation
CLI tool to list kubernetes deprecated apiVersion in cluster or files
- Host: GitHub
- URL: https://github.com/maheshrayas/kube-depre
- Owner: maheshrayas
- License: apache-2.0
- Created: 2022-04-16T10:03:35.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-05T01:56:53.000Z (over 1 year ago)
- Last Synced: 2024-04-21T17:20:57.874Z (8 months ago)
- Topics: apis, apiversioncheck, deprecated, deprecated-api, gke, kubecli, kubernetes
- Language: Rust
- Homepage:
- Size: 194 KB
- Stars: 18
- Watchers: 2
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Kube-depre
## Motivation
Given that kubernetes frequently deprecates apiVersions, we want to check for the resources with deprecated apiVersions in cluster or files or as a part of Continous Integration pipeline (Github Actions) so that we can update the apiVersion in manifest before the cluster is upgraded.
`kube-depre` is a simple CLI tool that allows us to find such deprecated apiVersion in Kubernetes cluster, or in files and as well integrated with github actions to report the Deprecated Apis as a comment on Pull Request.
## Installation
Supports only Linux and Mac
1. Download from the [Release](https://github.com/maheshrayas/kube-depre/releases)
OR
2.
```bash
curl -L https://raw.githubusercontent.com/maheshrayas/kube-depre/main/release/install.sh | sh -```
## How to use
### Prerequisite if validating against the K8s cluster
kube-depre by default looks for `~/.kube/config` for kuberenetes configuration. If the configuration is stored in other file location, set that location in the `KUBECONFIG` environment variable.
```bash
export KUBECONFIG={config-location}
```### CLI Supported Args
```bash
kube-depre 0.4.0USAGE:
kube-depre [OPTIONS]OPTIONS:
-d, --debug
supply --debug to print the debug information-f, --file
supply -f or --file "Manifest file directory". if -f not supplied, it will by default
query the cluster-h, --help
Print help information-o, --output
Output format for the list of deprecated APIs [default: table] [possible values: table,
csv, markdown-table]-t, --target-version
list of deprecated APIs in a specific kubernetes version, -t 1.22. If -t not supplied,
it will query for versions : 1.16, 1.22, 1.25, 1.26, 1.27, 1.29, custom-V, --version
Print version information
```### Commands
#### Check for deprecated APIs in cluster
```bash
# check for list for depreacted Apis in the cluster in K8s 1.22 and output will be printed on terminal
./kube-depre -t 1.22# check for list for depreacted Apis in the cluster in K8s 1.22 & 1.24 and output will be printed on terminal, it can be outputted to csv as well
./kube-depre -t 1.22,1.24# check for list for depreacted Apis in the cluster in K8s 1.22 and output will be in csv format
./kube-depre -t 1.22 -o csv# check for list for depreacted Apis in the cluster for non default K8s Custom resouces, for example: Istio, SecretStoreCSI etc.
./kube-depre -t custom# check for list for depreacted Apis in the cluster in K8s version 1.16,1.22,1.24,1.25 and output will be in csv format
./kube-depre -o csv```
#### Check for deprecated APIs in files
```bash
# check for list for depreacted Apis in the supplied file directory in K8s 1.22 and output will be printed on terminal
./kube-depre -t 1.22 -f $(pwd)/tests/data# check for list for depreacted Apis in the supplied file directory in K8s 1.22 & 1.24 and output will be printed on terminal, it can be outputted to csv as well
./kube-depre -t 1.22,1.24# check for list for depreacted Apis in the supplied file directory in K8s 1.22 and output will be in csv format
./kube-depre -t 1.22 -o csv -f $(pwd)/tests/data# check for list for depreacted Apis in the files for non default K8s Kinds or Custom resouces, for example: Istio, SecretStoreCSI etc.
./kube-depre -t custom -o csv -f $(pwd)/tests/data# check for list for depreacted Apis in the supplied file directory in K8s version 1.16,1.22,1.24,1.25 and output will be in csv format
./kube-depre -o csv -f $(pwd)/tests/data```
**If you want to add additional kinds(non default), please feel free to PR [here](https://github.com/maheshrayas/k8s_deprecated_api/blob/main/vcustom/data.json)**#### Check for deprecated APIs as a part of Pull request in Github
Refer github [workflow](./.github/workflows/check_deprecated.yaml) on how to scan kubernetes manifests in github repo and comment on PR with list of Deprecated APIs.
![](./docs/img/github_action.png)