Hello Readers!! We are again back with another exciting topic i.e. Pluto. As we all know kubernetes is a powerful container orchestration platform that continues to evolve rapidly. With each new release, Kubernetes introduces changes, deprecates certain features, and updates its API. Keeping track of these changes is essential for maintaining a healthy and secure Kubernetes cluster. One effective tool for identifying Kubernetes API deprecations is Pluto. In this blog, we will explore what Pluto is and how it can help you stay on top of API deprecations in Kubernetes.
Kubernetes APIs:
In Kubernetes, the API version refers to the specific version of the Kubernetes API that is being used to define or interact with resources in the cluster. Each resource type within Kubernetes, such as Pods, Services, Deployments, ConfigMaps, and more, has an associated API version.
API versions are used to ensure backward compatibility and to manage changes and updates to the Kubernetes API. As Kubernetes evolves, new features are introduced, and existing ones may be modified or deprecated. By specifying an API version when defining resources or making API requests, you indicate which version of the API you want to use, which helps in maintaining compatibility with different Kubernetes releases.
We can check all supported API groups with its version using the following command:
$ kubectl api-versions
Pluto: A tool by Fairwinds
Pluto is an open-source tool developed by the Fairwinds to help users and administrators detect and manage deprecated APIs within a Kubernetes cluster. It works by analyzing our cluster’s resources and providing detailed information about any deprecated or removed APIs version in kubernetes cluster that our applications or configurations might be using.
How to install Pluto?
To get started with pluto, firstly we need to install it. For installing its various release refer this page:
https://github.com/FairwindsOps/pluto/releases
As I am installing it on my linux system, I have to run following commands:
$ wget https://github.com/FairwindsOps/pluto/releases/download/v5.18.4/pluto_5.18.4_linux_amd64.tar.gz
$ tar -zxvf pluto_5.18.4_linux_amd64.tar.gz
$ chmod +x pluto
$ sudo mv pluto /usr/local/bin
Here you can see I have successfully installed:
Now as it is installed, let’s get started.
How to detect Kubernetes API deprecations using Pluto?
Run to find the list of commands that we can use with pluto:
Let’s take an example. I have this yaml file for the deployment of nginx.
To detect here a single file using pluto to check if its using deprecated api versions or not:
$ pluto detect <file-name>
Here we can see its telling no resources found with known deprecated apiVersions.
Let’s take an example of deprecated api version resources here. I have a cronjob.yaml file in which I have used batch/v1beta1 version which is now deprecated.
If I will detect this file I will find such response from pluto.
Its showing its deprecated api version that we are using for deployment. And it can be replaced with batch/v1.
I can utilize the “pluto list-versions” command to precisely determine the Kubernetes version in which the API has been deprecated and subsequently removed:
$ pluto list-versions
The command below instructs Pluto to perform a directory scan, thereby identifying our deprecated API versions of all the files in the directory. In our scenario, this is straightforward because we have just two simple manifests, both of which reside in the current directory. Run the following command:
Pluto scanned both the files in my current directory and it found one yaml file using deprecated api version.
If you want to scan a particular directory containing multiple yaml files run the following command:
$ pluto detect-file -d <directory_name>
It can also detect deprecated helm charts using following command:
$ pluto detect-helm
That’s all for this time!!! We have explored here the various commands to use pluto for detections. Its really helpful. You should give it a try.
Conclusion
Thanks for being with me till the end. In this blog we have seen steps by using which one can identify Kubernetes API deprecations using Pluto. So if you have find this blog useful somewhere do share it with your friends. If you have any queries reach out to my on Naincy.kumari@Nashtechglobal.com.
Happy Learning!!!