Skip to content

Commit

Permalink
book: document how to use Lima on macOS for development
Browse files Browse the repository at this point in the history
  • Loading branch information
chrischdi committed Aug 30, 2024
1 parent be86b82 commit 58ee4cc
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/book/src/clusterctl/developers.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,30 @@ To fix the kubeconfig run:
sed -i -e "s/server:.*/server: https:\/\/$(docker port capi-quickstart-lb 6443/tcp | sed "s/0.0.0.0/127.0.0.1/")/g" ./capi-quickstart.kubeconfig
```
### Using Lima on macOS
To use [Lima] for developing Cluster API especially with CAPD the rootless template of lima does not work.
The following command creates a working Lima machine for developing Cluster API with CAPD:
```bash
limactl start template://docker-rootful --name "docker" --tty=false \
--set '.provision += {"mode":"system","script":"#!/bin/bash\nset -eux -o pipefail\ncat << EOF > \"/etc/sysctl.d/99-capi.conf\"\nfs.inotify.max_user_watches = 1048576\nfs.inotify.max_user_instances = 8192\nEOF\nsysctl -p \"/etc/sysctl.d/99-capi.conf\""}' \
--memory 12 --cpus 10 --disk 64 \
--vm-type vz --rosetta=true
```
After creating the Lima machine we need to set `DOCKER_HOST` to the correct path:
```bash
export DOCKER_HOST=$(limactl list "docker" --format 'unix://{{.Dir}}/sock/docker.sock')
```
<!-- links -->
[kind]: https://kind.sigs.k8s.io/
[providers repositories]: configuration.md#provider-repositories
[overrides layer]: configuration.md#overrides-layer
[Install and/or configure a Kubernetes cluster]: ../user/quick-start.md#install-andor-configure-a-kubernetes-cluster
[kind-docker-hub]: https://hub.docker.com/r/kindest/node/tags
[issue 3795]: https://github.com/kubernetes-sigs/cluster-api/issues/3795
[Lima]: https://github.com/lima-vm/lima

0 comments on commit 58ee4cc

Please sign in to comment.