Wednesday, February 5, 2025

What is KubeArchInspect and what problem does it solve?

Programming LanguageWhat is KubeArchInspect and what problem does it solve?


Have you noticed how arm64 is making waves in the container world? It started with single-board computers like the Raspberry Pi and mobile devices, but now it’s powering Apple Silicon Macs and cloud offerings from AWS, Google Cloud, Azure, and Hetzner. And the best part? These Arm-based instances are often cheaper than their Intel/AMD counterparts. In fact, AWS and Google Cloud are even giving away free trials for their basic ARM VMs (though storage and bandwidth costs may apply).

Can You Move Your Kubernetes Workloads to ARM?

With all the cost savings and performance gains, it’s only natural to ask: Can I move my Kubernetes workloads to Arm? The answer depends on whether your container images support arm64. Before you start migrating, you need to check if your Kubernetes cluster is running images that have arm64 compatibility.

That’s where things can get tricky. Checking compatibility manually is a slow and tedious process. Imagine going through each image one by one, looking up its architecture support, and finding alternative versions if necessary. Sounds like a hassle, right?

Meet KubeArchInspect

KubeArchInspect is an open-source tool developed by the Arm Developer Ecosystem that automates Kubernetes image compatibility checks for Arm architecture.

How it works?

KubeArchInspect identifies images in a Kubernetes cluster which support the Arm architecture. It does this by checking each image against the source registry for the image and identifying which architectures are available. You can use the results to identify potential issues or opportunities for optimizing the cluster to run on Arm.

This open-source tool quickly scans your Kubernetes cluster and identifies whether your container images support arm64. Here’s how it helps:

  • Automatic Scanning: No more manual image checks! It inspects all running container images in your cluster.
  • Clear Reports: It flags images that don’t support arm64 and gives you an easy-to-understand report.
  • Upgrade Suggestions: If your current images lack Arm support, kubearchinspect checks for newer versions that are compatible, making it easier to upgrade.

By automating this process, kubearchinspect speeds up your migration to Arm-based infrastructure and helps you take advantage of the cost and performance benefits faster.

Kubearchinspect requires kubectl and Docker client

kubearchinspect must be executed on a client with kubectl installed and configured to connect to the target Kubernetes cluster. If multiple clusters are configured, it will query the cluster in the current default context. KubeArchInspect operates on a local client, interacting with the target Kubernetes cluster to analyze the metadata of your images for Arm architecture support. It also requires Docker client. The Docker credential store is used to authenticate to private registries, use docker login to add credentials.

In this blog post, we will explore the features, installation, running, and troubleshooting of KubeArchInspect, along with some examples and common errors. We will also discuss the project structure, getting help, contributing, and the release notes.

Getting Started

  • Install Docker Desktop
  • Enable Multi-Node Kubernetes cluster
  • Download the Kubearchinspect tool
  • Running the Kubearchinspect tool
  • Run sample Pods
  • Verify if it supports Arm architecture

Step 1. Install Docker Desktop

Click this link to download Docker Desktop and install it on your Mac system.

Step 2. Enable Multi-Node Kubernetes Cluster

Prior to Docker Desktop v4.38.0, Kubernetes support was limited to a single-node cluster ideal for basic testing. Starting 4.38.0, Docker Desktop now supports multi-node clusters using kind (Kubernetes IN Docker).

kubectl get nodes
NAME                    STATUS   ROLES           AGE     VERSION
desktop-control-plane   Ready    control-plane   9m34s   v1.31.1
desktop-worker          Ready    <none>          9m19s   v1.31.1
desktop-worker2         Ready    <none>          9m19s   v1.31.1

Enter fullscreen mode

Exit fullscreen mode

Step 3. Download the release

Download the pre-built binary for your operating system from the releases page.

$ wget https://github.com/ArmDeveloperEcosystem/kubearchinspect/releases/download/v0.4.0/kubearchinspect_Darwin_arm64.tar.gz

Enter fullscreen mode

Exit fullscreen mode

If you are using a different platform, such as Windows or macOS, you can get other release packages from the GitHub releases area.

$ gunzip kubearchinspect_Darwin_arm64.tar.gz

$ tar xvf kubearchinspect_Darwin_arm64.tar
x CHANGELOG.md
x LICENSE.txt
x README.md
x kubearchinspect

Enter fullscreen mode

Exit fullscreen mode

Verify KubeArchInspect is installed or not by running the following command:

./kubearchinspect
Check how ready your Kubernetes cluster is to run on Arm.

Usage:
  kubearchinspect [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  images      Check which images in your cluster support arm64.

Flags:
  -d, --debug        Enable debug mode
  -h, --help         help for kubearchinspect
  -l, --log string   Enable logging

Use "kubearchinspect [command] --help" for more information about a command.

Enter fullscreen mode

Exit fullscreen mode

KubeArchInspect connects to the Kubernetes cluster and generates a list of images in use. For each image found, it connects to the source registry for the image and checks which architectures are available, producing a report like the example below:

$ ./kubearchinspect images
Legend:
-------
✅ - arm64 supported
🆙 - arm64 supported (with update)
❌ - arm64 not supported
🚫 - error occurred
------------------------------------------------------------------------------------------------

✅ docker.io/kindest/kindnetd:v20241007-36f62932
✅ docker.io/kindest/local-path-provisioner:v20240813-c6f155d6
✅ registry.k8s.io/coredns/coredns:v1.11.3
✅ registry.k8s.io/etcd:3.5.15-0
✅ registry.k8s.io/kube-apiserver:v1.31.1
✅ registry.k8s.io/kube-controller-manager:v1.31.1
✅ registry.k8s.io/kube-proxy:v1.31.1
✅ registry.k8s.io/kube-scheduler:v1.31.1

Enter fullscreen mode

Exit fullscreen mode

After running KubeArchInspect, you can examine the output to determine if the cluster image architectures are suitable for your needs. Each image running in the cluster appears on a separate line, including name, tag (version), and test result:

  • A green tick (✅) indicates the image already supports arm64.
  • A red cross (❌) indicates that arm64 support is not available.
  • An upward arrow (⬆) shows that arm64 support is included in a newer version.
  • A red exclamation mark (❗) is shown when an error occurs checking the image. This may indicate an error connecting to the image registry.

Let’s try to use kubectl CLI and pull MySQL Server 5.7.41 image from the Docker Hub.

$ kubectl run mysql --image=mysql/mysql-server:5.7.41 --env="MYSQL_ROOT_PASSWORD=yourpassword" --port=3306
Enter fullscreen mode

Exit fullscreen mode

Let’s verify if the MySQL Server image is arm-compatible.

./kubearchinspect images
Legend:
-------
✅ - arm64 supported
🆙 - arm64 supported (with update)
❌ - arm64 not supported
🚫 - error occurred
------------------------------------------------------------------------------------------------

✅ docker.io/kindest/kindnetd:v20241007-36f62932
✅ docker.io/kindest/local-path-provisioner:v20240813-c6f155d6
🆙 mysql/mysql-server:5.7.41
✅ nginx
✅ registry.k8s.io/coredns/coredns:v1.11.3
✅ registry.k8s.io/etcd:3.5.15-0
✅ registry.k8s.io/kube-apiserver:v1.31.1
✅ registry.k8s.io/kube-controller-manager:v1.31.1
✅ registry.k8s.io/kube-proxy:v1.31.1
✅ registry.k8s.io/kube-scheduler:v1.31.1

Enter fullscreen mode

Exit fullscreen mode

Why it reported UP! And what does it mean?

MySQL Server 5.7.41 is an amd64 Docker image but when upgrdaed to the latest version, it support both amd64 as well as arm64 architecture.. In nutshell, an upward arrow (⬆) shows that arm64 support is included in a newer version.

If there is an error whilst checking an image, the tool will display the 🚫 symbol and give a short description of the error at the end of the line.

Ready to Get Started?

If you’re thinking about migrating to Arm, kubearchinspect is here to help. Try it out today and take the hassle out of compatibility checks!

🚀 Check out the repository and start inspecting your Kubernetes cluster now!

Check out our other content

Check out other tags:

Most Popular Articles