{"id":23293721,"url":"https://github.com/jaypyles/k3s-kvm","last_synced_at":"2026-01-20T00:08:25.576Z","repository":{"id":268011745,"uuid":"860715012","full_name":"jaypyles/k3s-kvm","owner":"jaypyles","description":"Create a k3s cluster using KVM. ","archived":false,"fork":false,"pushed_at":"2024-12-13T18:46:53.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T18:51:17.582Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jinja","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/jaypyles.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":"2024-09-21T01:59:52.000Z","updated_at":"2024-12-13T18:46:58.000Z","dependencies_parsed_at":"2024-12-13T19:42:05.329Z","dependency_job_id":"105978a4-7d8c-4863-ab7d-ddfe65519084","html_url":"https://github.com/jaypyles/k3s-kvm","commit_stats":null,"previous_names":["jaypyles/k3s-kvm"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jaypyles/k3s-kvm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaypyles%2Fk3s-kvm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaypyles%2Fk3s-kvm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaypyles%2Fk3s-kvm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaypyles%2Fk3s-kvm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaypyles","download_url":"https://codeload.github.com/jaypyles/k3s-kvm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaypyles%2Fk3s-kvm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28590676,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T00:01:37.455Z","status":"ssl_error","status_checked_at":"2026-01-19T23:58:17.328Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-12-20T06:16:50.251Z","updated_at":"2026-01-20T00:08:25.552Z","avatar_url":"https://github.com/jaypyles.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Creating a k3s cluster using KVM\n\nInstall all pre-requisites for kvm to begin:\n`sudo apt install kvm`\n\nCreate a bridge network on the host:\n\n```bash\n# /etc/network/interfaces\n\n# The loopback network interface\nauto lo\niface lo inet loopback\n\n# The primary network interface\nauto eth0\niface eth0 inet manual\n\nauto br0\niface br0 inet static\naddress 192.168.1.111\nnetmask 255.255.255.0\nnetwork 192.168.1.0\nbroadcast 192.168.1.255\ngateway 192.168.1.254\ndns-nameservers 192.168.1.254 8.8.8.8\nbridge_ports eth0\n```\n\nAnd then: `sudo systemctl restart networking`\n\nCreate a virtual network using the bridge network: \n\n```bash\n# bridge-network.xml\n\n\u003cnetwork\u003e\n  \u003cname\u003enet\u003c/name\u003e\n  \u003cforward mode=\"bridge\"/\u003e\n  \u003cbridge name=\"br0\"/\u003e\n  \u003cdomain name=\"example\"/\u003e\n\u003c/network\u003e\n```\n\n```bash\nvirsh net-define bridge-network.xml\nvirsh net-start net\nvirsh net-autostart net\n```\n\nCreate two virtual machines using either virt-install or virt-manager. These virtual machines will be connected to the bridge network created above.\n\nThe machines will need ip addresses set using netplan if using ubuntu-server.\n\n```bash\n# /etc/netplan/01-netcfg.yaml\nnetwork:\n  version: 2\n  renderer: networkd\n  ethernets:\n    net:\n      addresses:\n        - 192.168.1.x/24\n      gateway4: 192.168.1.1\n      nameservers:\n        addresses: [8.8.8.8, 8.8.4.4]\n```\n\nAdd your virtual machines to an `inventory.ini` file:\n\n```bash\n[k3s_master]\nmaster ansible_host=192.168.x.x\n\n[k3s_workers]\nworker-1 ansible_host=192.168.x.x\n\n[all:vars]\nansible_user=user\nansible_pass=root\n```\n\nCreate a vars file for the kvm variables:\n\n```bash\ncp vars/kvm.template.yml vars/kvm.yml\n```\n\nRun the playbook to install k3s on the virtual machines:\n`ansible-playbook -i inventory.ini playbooks/create_k3s_cluster.yml`\n\n## Remote Control of k3s cluster\n\nCopy over the k3s.yaml to the host you want to control from:\n\n`scp user@master_node:k3s.yaml ~/.kube/config`\n\nThen, edit the config file to point to the host you want to control:\n\n`vim ~/.kube/config`\n\nAnd then: `server: https://master_node:6443`\n\n### Set KVM vm's to restart on reboot (optional)\n\n`virsh autostart \u003cvm_name\u003e`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaypyles%2Fk3s-kvm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaypyles%2Fk3s-kvm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaypyles%2Fk3s-kvm/lists"}