Skip to main content

Creating a Lima instance for Kubernetes workloads with Podman Desktop

To use the Lima provider you need a Lima instance running a Linux virtual machine.

In the future, Podman Desktop might be able to create Lima instances.

Consider creating a custom Lima instance to:

  • Control the assigned resources: CPUs, memory, and disk size.
  • Control which Kubernetes distribution (template) to install.

Prerequisites

  • The limactl executable is installed. See Installing Lima.

    $ brew install lima

Procedure

  1. In a terminal, create the Lima instance.

    • To create a single-node Kubernetes cluster running k3s:

      $ limactl start template://k3s
    • To create a single-node Kubernetes cluster running k8s:

      $ limactl start template://k8s
    • To select the number of CPUs, the memory, and the disk size, add the options to the limactl start command:

      --cpus=4 --memory=4 --disk=100
  2. Wait for the instance to start, and restart the Lima extension.

    • Go to Settings > Preferences > Extension: Lima, to change the instance name and type.

      • k3s

        • Type: kubernetes
        • Name: k3s Lima preferences k3s
      • k8s

        • Type: kubernetes
        • Name: k8s Lima preferences k8s
    • Go to Settings > Extensions > Lima, to disable and enable the extension after changes.

Verification

  1. When the installation is done, the location of the KUBECONFIG file is printed. See Configuring access to a Kubernetes cluster.

    • Go to Settings > Preferences > Path to the kubeconfig file, to set the path of the file.
  2. Use the kubectl.lima wrapper script to connect to the cluster:

    $ kubectl.lima version