Feature image for Podman Desktop

Podman Desktop simplifies the transition from development to production by adopting production standards early on, ensuring workloads meet production criteria from the start. This approach brings predictability in deployments as it minimizes problems and saves time and resources. It also provides a structured environment for developers to work with Kubernetes in a comprehensive way to progressively grow their skills.

This article provides a quick overview of the Kubernetes capabilities offered in Podman Desktop. We'll cover the following areas:

  • Kubernetes support with Podman
  • Setting up a Kubernetes Local environment using Kind or minikube extensions
  • Interacting with your workload and inspecting your applications

Kubernetes support with Podman

Podman is a daemonless container engine for managing and running OCI containers on your Linux system. With Podman Desktop, developers benefit from a graphical user interface to easily manage and interact with containers from Windows, macOS, and Linux. 

From its inception, Podman was designed with a keen awareness of the Kubernetes ecosystem and its prevalent role in the container orchestration landscape. In fact, even the name "Podman" is derived from POD Manager, and in this context, POD refers to the concept of pods in Kubernetes (the smallest deployable unit in Kubernetes).

As a result, Podman's design philosophy was to handle pods just as it handles containers, in a way that is consistent with Kubernetes architectures. This dual approach not only positions Podman as a versatile tool for managing containers but also as a fairly practical platform for developing and testing Kubernetes applications, bridging the gap between local development environments and large-scale Kubernetes deployments.

While Podman is great for its effectiveness in a development environment, it’s also a perfect solution to run pods (and other Kubernetes constructs) in a production environment, where simplicity and security are the primary needs. Podman is well known for its tight integration with systemd, enabling reliable and rock-solid deployments of containerized workloads on different targets. I invite you to read the following articles if you are interested in using Podman for production workloads:

If you are targeting to deploy your containers on Kubernetes, Podman provides key features making the transition to Kubernetes easier: its rootless containers align with Kubernetes' security practices, while Podman’s daemonless architecture echoes Kubernetes' container management approach. Additionally, its networking and volume management mimic Kubernetes’ approach. More interestingly for developers, Podman provides Kubernetes YAML compatibility:

  • Run Kubernetes objects: Enables running objects defined in Kubernetes YAML files using the podman play kube command. This feature is useful for testing Kubernetes configurations locally without needing a full Kubernetes cluster.
  • Generate Kubernetes manifests: Enables generating Kubernetes-compatible YAML files from existing Podman containers or pods with the podman generate kube command. This allows for easy transition of local container setups to a Kubernetes environment.

In Podman Desktop, these capabilities are directly exposed to the end user and natively integrated in the UI. For instance, for any container or pod created with Podman, you can easily get its Kubernetes YAML. A Kube tab is available on the details page of a container (or pod), as shown in Figure 1. This feature leverages the generate kube command from Podman.

The Kube tab in the Podman Desktop Container Details page.
Figure 1: Viewing the Kubernetes YAML in Podman Desktop's Kube tab.


Similarly, you can display all your pods running with Podman and Play Kubernetes YAML from the list of pods (Figure 2).

The Play Kubernetes YAML option shown in the Podman Desktop UI.
Figure 2: Viewing the running pods.


Transitioning containers into pods

With Podman Desktop, you can easily transition your containers into pods, as illustrated in the following video. This feature is called Podify; it allows you to select multiple containers and group them together as a single unit of deployment for Kubernetes. 

Setting up a local Kubernetes environment from Podman Desktop

For developers who need to run Kubernetes locally and reproduce an environment close to production for development and experimentation purposes, Podman Desktop allows users to easily set up that environment on a local machine. There are two distincts extensions providing the capability to configure a Kubernetes cluster locally, you can either choose between Kind or minikube.

If you are not familiar with Kind, Kind is an open source project that allows to run Kubernetes clusters in a container engine (could be Docker or Podman or others). This is usually quite helpful for development and testing purposes, as you can run a Kubernetes locally in a lightweight fashion. Similarly, the minikube extension allows running Kubernetes in containers as well. Both solutions are completely viable. 

I recommend you watch the following video to learn about how you can set up a Kind environment from Podman Desktop.

Podman Desktop’s documentation provides guides for setup:

To interact with your clusters, there are actually two different ways to do it. You can either:

  • Use kubectl if you have it installed and configured on your local workstation,
  • Use the integrated terminal provided in Podman Desktop, accessible from the details of Kind or minikube cluster’s control plane (Figure 3).
The Terminal tab in the Podman Desktop UI.
Figure 3: Interacting with a cluster via the Terminal tab in the cluster's control plane.


Selecting a Kubernetes context from Podman Desktop

Once you have a Kubernetes cluster configured and running locally, your Kube context will list that particular cluster. From Podman Desktop, you can viewyour Kube contexts and select the one you want to be defined for your local environment.

To do that, you can click on the Kubernetes icon in the status bar; it will display a menu with the list of available Kubernetes contexts, as shown in Figure 4.

Viewing available Kubernetes contexts in Podman Desktop
Figure 4: Selecting a Kubernetes context via the Kubernetes icon in the status bar.


Alternatively, you can check it from Podman Desktop tray’s menu (Figure 5).

Viewing available Kubernetes contexts in Podman Desktop via the tray icon.
Figure 5: Selecting a Kubernetes context via the Podman Desktop tray menu.


Running an application in Kubernetes from Podman Desktop

Finally, Podman Desktop enables you to run an application in a Kubernetes environment. To do that, you can use the Play Kubernetes feature that allows you to select a YAML file describing your application. 

For instance, you can run the following NGNIX environment in a pod running in Kind:

apiVersion: v1
kind: Pod
 name: nginx
 - name: nginx
   image: nginx:1.14.2
   - containerPort: 80

You just have to go through the  Pods screen, click the Play Kubernetes YAML button, and select the file to be used (Figure 6). At this time, you can either choose to play the YAML file with Podman or use your Kubernetes environment.

The Play Kubernetes YAML feature shown in the Podman Desktop UI.
Figure 6: Running an application with Play Kubernetes YAML in Podman Desktop.


Once your file is executed, you’ll see the pod in the list of pods (Figure 7).

The Pods page shows the file has been executed.
Figure 7: Viewing the executed YAML file after running the Play Kubernetes YAML feature.


Pushing a local image from Podman to your Kubernetes environment

When building an application in your local environment, you’ll build new versions of your application’s images. If you want to test your application in a Kubernetes environment, you need to make this image available in that environment. 

If you are using the Kind or minikube extension, you can do that directly from the UI of Podman Desktop. Select your image, click on the kebab menu, and select Push image to Kind cluster for instance (Figure 8). This will start the process of making your image available to the Kind environment.

The Push image to Kind cluster option is shown for the example application image.
Figure 8: Pushing an application image via the Podman Desktop UI.


Note: We are working on a feature that will make an image built locally with Podman will automatically available in your minikube environments. That will boost your turnarounds and ability to quickly test your application. 

Working with remote Kubernetes clusters

Podman Desktop reads the Kubecontexts configured on your local environment. As soon as you have a remote Kubernetes cluster configured, you’ll be able to interact with the resources running there from Podman Desktop.

In this context, it’s completely possible to deploy a container or a pod to your remote environments, as shown in the following video.

What’s next?

In this article, you explored the seamless integration of Kubernetes with Podman Desktop. The tool is crafted to enhance the developer’s experience with containers and Kubernetes. With developer workflows aligning production standards early on, Podman Desktop streamlines the journey of your applications from development to deployment. With each new release, Podman Desktop commits to further refine these capabilities and introduce new features on that mission. Upcoming updates will expand the UI to encompass more Kubernetes objects, offering a more granular and interactive control over your application's objects. 

Stay tuned as Podman Desktop continues to evolve, but even better—become a part of that evolution. Engage with us, contribute your ideas, and help shape the future features to unlock the full potential of Kubernetes with Podman Desktop.

Last updated: January 29, 2024