https://github.com/jaredallard/k3s-docker-for-mac
Run k3s on Docker for Mac using the in-VM docker
https://github.com/jaredallard/k3s-docker-for-mac
docker-for-mac k3s
Last synced: 8 months ago
JSON representation
Run k3s on Docker for Mac using the in-VM docker
- Host: GitHub
- URL: https://github.com/jaredallard/k3s-docker-for-mac
- Owner: jaredallard
- License: apache-2.0
- Archived: true
- Created: 2020-04-30T21:41:26.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-16T15:19:00.000Z (over 5 years ago)
- Last Synced: 2025-01-30T20:40:41.790Z (over 1 year ago)
- Topics: docker-for-mac, k3s
- Language: Shell
- Size: 13.7 KB
- Stars: 2
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# k3s Docker for Mac
Run k3s on Docker for Mac using host docker.
See: https://twitter.com/jaredallard/status/1249173858302689281
## Why?
* sharing docker image cache with k3s, important for developer environments
* naturally accessible ports on the host, thanks to it using host docker
* more insight into kubernetes containers being run
## Usage
```bash
# To create a cluster
./up.sh
# To destroy a cluster
./destroy.sh
```
## Limitations
Persistence, i.e across Docker for Mac restarts hasn't really been tested.
## How it Works
We create a container (well, multiple) to allow for us to exec a command in the mount, ipc, uts, and pid namespace of the `dockerd` process. From here, we basically act like a virus and install the k3s binary into `/var/lib/k3s-dfm` directory and a few scripts to help start and cleanup itself.
k3s retains it's own network namespace, which we then use to expose ports using a TCP proxy that uses VPNKit under the hood (w/ the native Docker for Mac port-forwards) to bring k3s, and traefik, to the host (6443 k3s, 443 https-traefik, 80 http-traefik).
## Special Thanks
* @malept - helped me work on making this much less hacky than it original was.
* @ibuildthecloud - for making k3s :tada:
## License
MIT