Skip to main content

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

  1. Select your Kubernetes context.

    note

    Your 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>.

  2. Go to the Pods or Containers component page.

  3. Click the overflow menu icon corresponding to the pod or container. overflow menu icon

  4. Select the Deploy to Kubernetes option from the dropdown list.

  5. Select the checkbox to expose the service locally by using the default ingress controller. expose the service locally

  6. 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. ingress-host-port Otherwise, you do not see the option.

  7. Click Deploy and then Done.

Verification

  1. On the Deploy generated pod to Kubernetes screen, the created pod status is Phase: Running Deploying a pod

  2. Go to Pods: your Kubernetes pod is in the list. kube pod in the list

  3. Optional: Check the running service on the Kubernetes > Services page. running service