Super-fast Kubernetes YAML Deployment on Fedora with Podman Kube Play

Fedora tutorial - IT technology blog
Fedora tutorial - IT technology blog

Installing an Entire Cluster Just to Test a YAML File? It’s Time for a Change!

Starting up Minikube or Kind just to check a 20-line manifest file often feels like a massive chore. These tools consume at least 2GB of RAM the moment they are turned on. For office laptops, the cooling fans whirring like a hairdryer is almost inevitable.

On Fedora, I found a much more lightweight alternative: podman kube play. Instead of setting up a complex ecosystem, this feature allows you to execute standard Kubernetes YAML files directly on the Podman engine. Startup speed is measured in seconds.

How Does Podman Kube Play Work?

Simply put, Podman understands the “Pod” structure – the smallest unit of Kubernetes. When you load a YAML file, Podman automatically parses the container, volume, and environment variable definitions. Then, it maps them into local pods running directly on the Linux kernel.

You won’t see any sign of the API Server, Etcd, or Kubelet here. Everything is streamlined to the max. You only need to install the podman package to get started.

Why Is This Method Optimal for Developers?

  • Instant Startup: Containers spin up immediately, without wasting 2-3 minutes waiting for a cluster to be “Ready”.
  • Ultra-lightweight: Overhead is nearly zero. You only use RAM for your actual applications.
  • High Compatibility: These YAML files can be moved to Production (GKE, EKS) without modifying the core structure.

Hands-on Guide: Run an App in 3 Steps

First, check if your Fedora machine has Podman installed. If not, open your terminal and type: sudo dnf install -y podman.

1. Create a Sample YAML File

Let’s experiment with a simple Nginx application. I’ll create a web-app.yaml file with the following content:

apiVersion: v1
kind: Pod
metadata:
  name: fedora-web-demo
spec:
  containers:
  - name: nginx-server
    image: docker.io/library/nginx:latest
    ports:
    - containerPort: 80
      hostPort: 8080
    volumeMounts:
    - name: data-vol
      mountPath: /usr/share/nginx/html
  volumes:
  - name: data-vol
    hostPath:
      path: /tmp/html-data
      type: DirectoryOrCreate

Here, I’m mapping container port 80 to host port 8080 and mounting a volume to /tmp/html-data.

2. Execute the Kube Play Command

This is where the difference appears. Instead of using kubectl apply, run:

podman kube play web-app.yaml

Podman will automatically pull the image, set up the network, and mount the volume. The output returns the Pod ID and corresponding Container IDs in just a few moments.

3. Check the Status

To see if the Pod is running smoothly, use the command:

podman pod ps

Now, open your browser and go to localhost:8080. Everything runs as smoothly as it would on a real cluster.

Pro Tips

Turn Running Containers into YAML

If you happened to run a container using a long podman run command and want to save it as a YAML file? Don’t write it by hand. Let Podman do it for you:

podman kube generate <container_name> > deployment.yaml

Clean Up Resources in a Snap

To wipe out everything created from the YAML file, simply use the down command:

podman kube down web-app.yaml

Your system will be free of junk containers immediately.

Handling Permission Errors on Fedora (SELinux)

Fedora is very secure with SELinux. If you encounter a 403 Forbidden error when mounting volumes, grant permissions to the host directory with this command:

chcon -Rt svirt_sandbox_file_t /tmp/html-data

Conclusion

podman kube play is the “secret weapon” that helps Fedora devs save hours of waiting for clusters. It bridges the gap between pure Docker and complex Kubernetes. If you are in the process of migrating projects to K8s, try this method immediately to optimize your local workflow.

Share: