Skip to content

Conversation

tico88612
Copy link
Member

What type of PR is this?

/kind feature

What this PR does / why we need it:

This is a PoC about Lima, which can replace Vagrant for local development.

Which issue(s) this PR fixes:

Fixes #12237

Special notes for your reviewer:

make or make all will create VMs and install Kubespray, make stop will delete VMs.

Does this PR introduce a user-facing change?:

Support Lima for local development

Basic roles lima skeleton

Signed-off-by: ChengHao Yang <[email protected]>
Signed-off-by: ChengHao Yang <[email protected]>
Signed-off-by: ChengHao Yang <[email protected]>
`make` or `make all` can create VMs and install Kubespray, `make stop`
can stop and remove VMs.

Signed-off-by: ChengHao Yang <[email protected]>
@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jul 22, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tico88612

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested a review from VannTen July 22, 2025 13:39
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 22, 2025
@k8s-ci-robot k8s-ci-robot requested a review from yankay July 22, 2025 13:39
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 22, 2025
@tico88612
Copy link
Member Author

/label tide/merge-method-merge

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-merge Denotes a PR that should use a standard merge by tide when it merges. label Jul 22, 2025
@tico88612 tico88612 changed the title [WIP] Feat: lima support for local development Feat: lima support for local development Jul 22, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 22, 2025
@tico88612
Copy link
Member Author

/hold

To prevent accidental merging.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 22, 2025
@VannTen
Copy link
Contributor

VannTen commented Jul 25, 2025

Currently I'm getting

msg="field arch must be one of [x86_64 aarch64 armv7l ppc64le riscv64 s390x]; got \"None\"\nfield vmType must be \"qemu\", \"vz\", \"wsl2\"; got \"None\"\nfield networks[0].lima is only supported on macOS right now""]

When I fix the temp file to remove the offending None and the network, it appears to launch, but can't complete the vm start, but I think that might be my setup, I just installed lima and maybe I need to configure some stuff to make it work with libvirt in session mode

@tico88612
Copy link
Member Author

Hmmm... weird..., I remember arch or vmType has a default, I thought it would be automatically determined.

https://github.com/lima-vm/lima/blob/7a6078c455f33e535833b64fbd062b08a6b74916/templates/default.yaml#L8-L16

networks[0].lima Let me think about how to change it (I'll try it out later in a different environment; maybe different OSs require different methods).

@VannTen
Copy link
Contributor

VannTen commented Jul 25, 2025

Hmmm... weird..., I remember arch or vmType has a default, I thought it would be automatically determined.

Yeah, if I remove the lines from the generated file it works (well, it goes to the next error more like 😆 ) , but apparently if it's explicitely set to None it does not work.

@VannTen
Copy link
Contributor

VannTen commented Jul 25, 2025

Generated file look like this :

vmType: None

arch: None

images:
- arch: x86_64
  digest: sha256:f1652d29d497fb7c623433705c9fca6525d1311b11294a0f495eed55c7639d1f
  location: https://cloud-images.ubuntu.com/releases/noble/release-20250704/ubuntu-24.04-server-cloudimg-amd64.img
- arch: aarch64
  digest: sha256:bbecbb88100ee65497927ed0da247ba15af576a8855004182cf3c87265e25d35
  location: https://cloud-images.ubuntu.com/releases/noble/release-20250704/ubuntu-24.04-server-cloudimg-arm64.img


cpus: 2
memory: 2GiB
disk: 20GiB

containerd:
  user: false

user:
  name: kubespray

networks:
  - lima: shared

@tico88612
Copy link
Member Author

field `networks[0].lima` is only supported on macOS right now

I already tested on Ubuntu 24.04, Lima's support for Linux is pretty poor.
This workaround is only on macOS (M-chip).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-merge Denotes a PR that should use a standard merge by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alternative to vagrant
3 participants