Skip to content

Commit 85973b1

Browse files
pipo02mixlyind
andauthored
Add ops recipe for pluto (#300)
* Add ops recipe for pluto * Update content/docs/support-and-ops/ops-recipes/check-deprecated-apis.md Co-authored-by: Jonas Zeiger <[email protected]> --------- Co-authored-by: Jonas Zeiger <[email protected]>
1 parent d511718 commit 85973b1

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
- New recipe for Kyverno stuck in upgrade pending.
13+
- New recipe for Pluto to check deprecated APIs.
1314
- New recipe explaining how descheduler works.
1415
- MC types to glossary (ephemeral and stable-testing)
1516
- Added `kubectl debug` info in Troubleshooting recipe
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
---
2+
title: "Checking for Deprecated Kubernetes APIs with Pluto"
3+
owner:
4+
- https://github.com/orgs/giantswarm/teams/team-planeteers
5+
classification: public
6+
---
7+
8+
## Overview
9+
10+
[`pluto`](https://github.com/FairwindsOps/pluto) is a tool developed by Fairwinds that helps identify deprecated Kubernetes APIs in your manifests and Helm charts. Keeping your Kubernetes resources up to date with the latest API versions is crucial to ensure smooth upgrades and compatibility with future Kubernetes releases.
11+
12+
## Prerequisites
13+
14+
- **Pluto Installation**: [Install `pluto`](https://pluto.docs.fairwinds.com/installation/) on your local machine.
15+
16+
### Installing Pluto
17+
18+
You can install `pluto` via Homebrew, downloading a binary, or using a container:
19+
20+
#### Homebrew (macOS)
21+
22+
```bash
23+
brew install FairwindsOps/tap/pluto
24+
```
25+
26+
#### Binary Download
27+
28+
Download the latest binary from the [releases page](https://github.com/FairwindsOps/pluto/releases) and place it in your PATH.
29+
30+
#### Docker
31+
32+
You can run `pluto` using a Docker container:
33+
34+
```bash
35+
docker run --rm -v $(pwd):/work fairwinds/pluto:latest detect-files /work
36+
```
37+
38+
## Usage
39+
40+
### Checking Kubernetes Manifests
41+
42+
To check Kubernetes manifests for deprecated APIs:
43+
44+
1. **Navigate to the directory** containing your Kubernetes YAML files.
45+
2. **Run Pluto**:
46+
47+
```bash
48+
pluto detect-files -d ./path/to/manifests
49+
```
50+
51+
This command will scan all the YAML files in the specified directory and report any deprecated API versions.
52+
53+
### Checking Helm Charts
54+
55+
To check Helm charts for deprecated APIs:
56+
57+
1. **Navigate to the directory** containing your Helm chart.
58+
2. **Run Pluto**:
59+
60+
```bash
61+
helm template test ./helm/<HELM_CHART_NAME> | pluto detect-files
62+
```
63+
64+
This command will render the Helm template and check the resulting manifests for deprecated APIs.
65+
66+
### Checking Live Kubernetes Cluster
67+
68+
To check the currently deployed resources in a Kubernetes cluster:
69+
70+
1. **Ensure kubectl is configured** to access the desired cluster.
71+
2. **Run Pluto**:
72+
73+
```bash
74+
pluto detect-helm -owide
75+
```
76+
77+
This will scan all Helm releases in the cluster for deprecated APIs.
78+
79+
### Checking Specific API Versions
80+
81+
You can specify which Kubernetes version to check against. For example, to check for deprecations against Kubernetes 1.25:
82+
83+
```bash
84+
pluto detect-files -d ./path/to/manifests --target-versions=k8s=1.25.0
85+
```
86+
87+
## Interpreting Results
88+
89+
`pluto` will output a list of resources with deprecated API versions, including the file path, line number, and suggested API version to migrate to. Here’s an example output:
90+
91+
```
92+
+----------------------+-----------------------+------------------+-------------------+
93+
| KIND | NAME | DEPRECATED API | REPLACEMENT API |
94+
+----------------------+-----------------------+------------------+-------------------+
95+
| Deployment | example-deployment | apps/v1beta1 | apps/v1 |
96+
| Ingress | example-ingress | extensions/v1beta1 | networking.k8s.io/v1 |
97+
+----------------------+-----------------------+------------------+-------------------+
98+
```

0 commit comments

Comments
 (0)