Deploying a container to Kubernetes
With Podman Desktop, you can deploy a container to your Kubernetes cluster.
Prerequisites
- Your are using the Podman container engine.
- Your container, running or stopped, is available on the Containers page: <your_container>.
- You registered the Kubernetes cluster in your kubeconfig file: <your_kubernetes_cluster>. For example, Creating a kind cluster.
- The Kubernetes namespace to deploy to already exists.
Procedure
- Click Podman Desktop tray > Kubernetes > Context > <your_kubernetes_cluster> to set your Kubernetes context.
- Open Podman Desktop dashboard > Containers > <your_container> to see the Container Details page.
- Click to generate a Kubernetes pod.
- On the Deploy generated pod to Kubernetes screen, choose your options:
- Pod Name: edit the proposed name.
- Use Kubernetes Services: enable or disable Replace
hostPort
exposure on containers by Services. It is the recommended way to expose ports, as a cluster policy might prevent to usehostPort
. - Kubernetes namespace: select in the list the namespace to deploy the pod to.
- Click the Deploy button.
Verification
On the Deploy generated pod to Kubernetes screen, the created pod status is Phase: Running
Go to Containers: your pod is in the list.