{"id":16952043,"url":"https://github.com/superseb/multipass-k3s","last_synced_at":"2025-03-22T13:31:30.171Z","repository":{"id":39782377,"uuid":"172967126","full_name":"superseb/multipass-k3s","owner":"superseb","description":"Use multipass instances to create your k3s cluster","archived":true,"fork":false,"pushed_at":"2023-10-23T16:10:49.000Z","size":28,"stargazers_count":63,"open_issues_count":0,"forks_count":30,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-13T15:12:45.042Z","etag":null,"topics":["k3s","kubernetes","rancher"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/superseb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-27T18:22:46.000Z","updated_at":"2025-01-20T18:35:11.000Z","dependencies_parsed_at":"2022-07-31T23:38:40.189Z","dependency_job_id":"53516fab-ce3f-4da6-b6b7-16fd417ba757","html_url":"https://github.com/superseb/multipass-k3s","commit_stats":{"total_commits":20,"total_committers":2,"mean_commits":10.0,"dds":"0.19999999999999996","last_synced_commit":"b82203398733f9b8841cc478d976e688a48d929f"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superseb%2Fmultipass-k3s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superseb%2Fmultipass-k3s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superseb%2Fmultipass-k3s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/superseb%2Fmultipass-k3s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/superseb","download_url":"https://codeload.github.com/superseb/multipass-k3s/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244962839,"owners_count":20539229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["k3s","kubernetes","rancher"],"created_at":"2024-10-13T22:01:18.940Z","updated_at":"2025-03-22T13:31:29.891Z","avatar_url":"https://github.com/superseb.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# k3s cluster on multipass instances\n\nThis script will create a configurable amount of instances using [multipass](https://github.com/CanonicalLtd/multipass/), install [k3s](https://github.com/rancher/k3s) server(s) (HA using embedded etcd), and add the agent instances to the cluster.\n\n## Requirements\n\n* multipass (See [multipass: Install Multipass](https://github.com/canonical/multipass#install-multipass))\n\nThis is tested on MacOS and Ubuntu Linux 22.04.\n\n## Running it\n\nClone this repo, and run the script:\n\n```\nbash multipass-k3s.sh\n```\n\nThis will (defaults):\n\n* Generate random name for your cluster (configurable using `NAME`)\n* Create init-cloud-init file for server to install the first k3s server with embedded etcd (contains --cluster-init to activate embedded etcd)\n* Create one instance for the first server with 2 CPU (`SERVER_CPU_MACHINE`), 10G disk (`SERVER_DISK_MACHINE`) and 1G of memory (`SERVER_MEMORY_MACHINE`) using Ubuntu focal (`IMAGE`)\n* Create cloud-init file for server to install additional k3s servers with embedded etcd.\n* Create one instance for additional server (configurable using `SERVER_COUNT_MACHINE`)\n* Create cloud-init file for agent to join the cluster.\n* Create one machine (configurable using `AGENT_COUNT_MACHINE`) with 1 CPU (`AGENT_CPU_MACHINE`), 3G disk (`AGENT_DISK_MACHINE`) and 512M of memory (`AGENT_MEMORY_MACHINE`) using Ubuntu focal (`IMAGE`)\n* Wait for the nodes to be joined to the cluster\n* Optionally merge the generated kubeconfig with the existing $KUBECONFIG (`MERGE_KUBECONFIG`)\n\n## Quickstart Ubuntu 22.04 droplet\n\n```\nsudo snap install multipass\nwget https://raw.githubusercontent.com/superseb/multipass-k3s/master/multipass-k3s.sh\nbash multipass-k3s.sh\ncurl -Lo /usr/local/bin/kubectl \"https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl\"\nchmod +x /usr/local/bin/kubectl\nkubectl --kubeconfig *-kubeconfig.yaml get nodes\n```\n\n## Clean up\n\nThe files that are created are:\n\n* `$NAME-agent-cloud-init.yaml`\n* `$NAME-cloud-init.yaml`\n* `$NAME-kubeconfig.yaml`\n* `$NAME-kubeconfig-orig.yaml`\n* `$NAME-kubeconfig-backup.yaml` (if `MERGE_KUBECONFIG` is set)\n* `$NAME-kubeconfig-merged.yaml` (if `MERGE_KUBECONFIG` is set)\n\nYou can clean up the instances by running `multipass delete k3s-server-$NAME-1 --purge` and `multipass delete k3s-agent-$NAME-{1,2,3}` or (**WARNING** this deletes and purges all instances): `multipass delete --all --purge`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperseb%2Fmultipass-k3s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsuperseb%2Fmultipass-k3s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsuperseb%2Fmultipass-k3s/lists"}