Deploying a pod or container to Kubernetes
With Podman Desktop, you can deploy a pod to your Kubernetes cluster with an active connection. Any container that is part of a pod is also deployable to your cluster.
Prerequisites
- Your are using the Podman container engine.
- Your pod, running or stopped, is available on the Pods page: <your_pod>.
- 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.
- Your container has a port that is exposed correctly to generate a service.
Procedure
-
Select your Kubernetes context.
noteYour pod or container is deployed to the
default
namespace of the Kubernetes cluster. To switch to a different namespace, use this command:kubectl config set-context --current --namespace=<name-of-the-namespace>
. -
Go to the Pods or Containers component page.
-
Click the overflow menu icon corresponding to the pod or container.
-
Select the Deploy to Kubernetes option from the dropdown list.
-
Select the checkbox to expose the service locally by using the default ingress controller.
-
Conditional: When you configure custom port mapping while running an image, you have the option to select an Ingress host port from the dropdown list. Otherwise, you do not see the option.
-
Click Deploy and then Done.
Verification
-
On the Deploy generated pod to Kubernetes screen, the created pod status is Phase: Running
-
Go to Pods: your Kubernetes pod is in the list.
-
Optional: Check the running service on the Kubernetes > Services page.