uptime 99
Published in

uptime 99

Kubernetes Solved: Easily Find Deprecated API Versions with Pluto

Written By: Luke Reed

Pluto open source from Fairwinds.

Pluto is an open source utility to help users easily find deprecated Kubernetes API versions in their Infrastructure-as-Code repositories and Helm releases.

The Kubernetes API versioning scheme is great for developers. It allows the Kubernetes team to easily release new features to alpha and beta API paths and graduate them to stable paths once they’ve been battle-tested. When this happens, the older versions get deprecated and will eventually be deleted. This has led to many conversations around the Kubernetes 1.16 upgrade where multiple deprecated versions of the Deployment resource are removed (among others, read more here). It's painful to find deprecated versions and you'll be blocked from upgrading to 1.16 until they've all been updated. We decided to write an open source utility, Pluto (named after the deprecated planet), to solve this problem.

Background

The kube-apiserver is flexible and provides the same info about a given resource type regardless of the API version specified in the request. For example, while running Kubernetes 1.15.X you can run the following commands to see Deployments from various API versions:

$ kubectl get deployments.v1beta1.apps rbac-manager -o yaml
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: rbac-manager
...
$ kubectl get deployments.v1beta2.apps rbac-manager -o yaml apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: rbac-manager
...
$ kubectl get deployments.v1.apps rbac-manager -o yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: rbac-manager
...

$ kubectl get deployments.v1beta1.extensions rbac-manager-o yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: rbac-manager
...

You’ll notice that all of these commands returned the same object, but with the apiVersion set to whatever you asked for in the request. This makes it impossible to tell which version you actually deployed to the server, causing problems when you upgrade. When you have a lot of applications deploying to your Kubernetes cluster (like many of our clients), a cluster upgrade to version 1.16 could break deployment processes, potentially across hundreds of repositories. We wanted a way to provide this info ahead of time so that deployment processes could be addressed before the upgrade happens.

Pluto Identifies Deprecated Kubernetes Files

Enter Pluto. You can use Pluto to scan a variety of sources for deprecated API versions, including flat manifest files, stdout from a helm template command, or even interacting directly with your cluster if you used Helm to deploy. For example, here is a scan of a cluster that deploys applications using Helm 3 (Pluto also supports Helm 2):

Pluto tells you that your audit-dashboard-prod-rabbitmq-ha StatefulSet was deployed with a deprecated API via Helm. This is now easier to locate and fix in your chart repository before deploying on 1.16.

Before upgrading to 1.16, you can validate your Helm charts, YAML manifests, and Helm deployments running in cluster with Pluto and update any deprecated APIs. Once Pluto is passing, you’re ready to migrate to 1.16.

Pluto is now open source and will be updated to include future releases of Kubernetes and any deprecations to resource APIs. We’re working hard to add features, so please open issues, join our Slack channel, and contribute!

Resources

👏 If you enjoyed this story, clap it up! 👏

uptime 99 is a Fairwinds publication about everything cloud, Kubernetes, DevOps, and more. If you’d like to write for uptime 99, email us!

--

--

--

We collect, curate, and publish articles on everything cloud, kubernetes, open source, and security.

Recommended from Medium

Programming Best Practices

RAYA Bot 🤖

Using Custom Classes within Databases in Unity3D

Design Patterns 04 — Builder Pattern

Different code for different OS in Go and jenkins

Central IT in the role of Cloud broker — contracts and cost management

GIS Analyst Salary Breakdown

Most important lessons from my first year at N26

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Fairwinds

Fairwinds

Fairwinds — The Kubernetes Enablement Company | Editor of uptime 99

More from Medium

Helm 3.8.0 — OCI Registry Support

Codefresh Software Delivery Platform and the Argo Project

Use Nocalhost and KubeVela for cloud debugging and multi-cluster hybrid cloud deployment

Kubernetes Liveness, Readiness Probe Explained