{"id":17725408,"url":"https://github.com/aguslr/vagrant-k8s","last_synced_at":"2026-05-11T07:12:19.326Z","repository":{"id":259274934,"uuid":"800401910","full_name":"aguslr/vagrant-k8s","owner":"aguslr","description":"Vagrant configuration to orchestrate a Kubernetes cluster","archived":false,"fork":false,"pushed_at":"2024-10-23T17:54:45.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-24T02:11:47.551Z","etag":null,"topics":["ansible","k8s","kubernetes","libvirt","vagrant","virtualbox"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"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/aguslr.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-05-14T09:08:01.000Z","updated_at":"2024-10-23T17:54:50.000Z","dependencies_parsed_at":"2024-10-24T02:46:54.942Z","dependency_job_id":"ba6b02c0-d64a-4980-93b4-6684b3145dcd","html_url":"https://github.com/aguslr/vagrant-k8s","commit_stats":null,"previous_names":["aguslr/vagrant-k8s"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aguslr/vagrant-k8s","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aguslr%2Fvagrant-k8s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aguslr%2Fvagrant-k8s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aguslr%2Fvagrant-k8s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aguslr%2Fvagrant-k8s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aguslr","download_url":"https://codeload.github.com/aguslr/vagrant-k8s/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aguslr%2Fvagrant-k8s/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271027687,"owners_count":24687082,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ansible","k8s","kubernetes","libvirt","vagrant","virtualbox"],"created_at":"2024-10-25T16:04:22.917Z","updated_at":"2026-05-11T07:12:19.318Z","avatar_url":"https://github.com/aguslr.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"[aguslr/vagrant-k8s][1]\n=======================\n\n\nThis repository contains the configuration files necessary to orchestrate a\n[Kubernetes][2] cluster using [Vagrant][3] and provision it with [Ansible][4].\nIt works both with [VirtualBox][6] and [Libvirt][5] boxes.\n\n\nInstallation\n------------\n\nBefore anything, [Vagrant][3] and either [libvirt][5] or [VirtualBox][6] should\nbe installed:\n\n- For APT based distributions:\n\n      sudo apt install vagrant vagrant-libvirt\n\n- For RPM based distributions:\n\n      sudo dnf install vagrant vagrant-libvirt\n\n- For Windows and macOS, refer to [Vagrant][7]'s and [VirtualBox][8]'s download\n  pages.\n\n\n### Set-up ###\n\nFirst of all, we have to clone the repository:\n\n    git clone https://github.com/aguslr/vagrant-k8s \u0026\u0026 cd vagrant-k8s\n\nAfterwards, to orchestrate a cluster, we follow these steps:\n\n1. Setup the VMs with this command:\n\n       vagrant up\n\n2. Once the VMs are up, connect to the control plane:\n\n       vagrant ssh master -- kubectl get nodes -o wide\n\nAlternatively, we can attach the VMs to a physical interface so they are\nreachable from any machine in the network:\n\n1. Assign the interface to a variable and setup the VMs:\n\n       BRIDGE_IFACE=br0 vagrant up\n\n2. Access the Dashboard UI by connecting to the URL that is displayed in a\n   post-up message along with the token.\n\n\n#### Managing Kubernetes ####\n\nTo use the [Kubernetes client][9] to interact with the cluster from our local\nmachine, we must prepare the environment:\n\n1. Copy the configuration locally:\n\n       vagrant ssh master -- cat .kube/config \u003e ${KUBECONFIG:-$HOME/.kube/config}\n\n2. Now we can run `kubectl` commands:\n\n       kubectl get nodes -o wide\n\n\nConfiguration\n-------------\n\nEverything can be configured using a YAML file named `settings.yml`:\n\n```yaml\nk8s:\n  master:\n    cpus:   4\n    memory: 2048\n  workers:\n    count:  2\n    cpus:   2\n    memory: 2048\n\nnetwork:\n  bridge:    ''\n  mac:       '525400000a00'\n  mgmt_cidr: '192.168.200.200/29'\n  vms_cidr:  '192.168.200.216/29'\n\nversions:\n  box:        'debian/bookworm64'\n  dashboard:  'v2.7.0'\n  kubernetes: 'v1.31'\n```\n\nAlternatively, environment variables can also be used:\n\n| Variable              | Function                              | Default              |\n| :-------------------- | :------------------------------------ | :------------------- |\n| `BRIDGE_IFACE`        | Network interface to attach VMs to    | empty                |\n| `K8S_MGMT_CIDR`       | Default network CIDR for management   | `192.168.200.200/29` |\n| `K8S_VMS_CIDR`        | Default network CIDR for VMs          | `192.168.200.216/29` |\n| `K8S_MAC_ADDRESS`     | MAC address for master node           | `525400000a00`       |\n| `K8S_MASTER_CPUS`     | Number of CPUs for master node        | `4`                  |\n| `K8S_MASTER_MEMORY`   | Amount of memory for master node      | `2048`               |\n| `K8S_NODES_COUNT`     | Number of worker nodes                | `2`                  |\n| `K8S_NODE_CPUS`       | Number of CPUs for each worker node   | `2`                  |\n| `K8S_NODE_MEMORY`     | Amount of memory for each worker node | `2048`               |\n| `LIBVIRT_DEFAULT_URI` | URI for libvirt daemon to connect to  | `qemu:///system`     |\n| `VAGRANT_BOX`         | Remote image to use as base for VMs   | `debian/bookworm64`  |\n\nFor example, to orchestrate a cluster with nodes running Debian 12 attached to\nthe network interface `eth0`, we do:\n\n    BRIDGE_IFACE=eth0 VAGRANT_BOX=generic/debian12 vagrant up\n\n\n### Supported boxes ###\n\nThe following official boxes have been tested:\n\n- [`almalinux/9`](https://app.vagrantup.com/almalinux/boxes/9) (libvirt,\n  virtualbox)\n- [`debian/bookworm64`](https://app.vagrantup.com/debian/boxes/bookworm64)\n  (libvirt, virtualbox)\n- [`rockylinux/9`](https://app.vagrantup.com/rockylinux/boxes/9) (libvirt,\n  virtualbox)\n\nAlternative, these non-official boxes have been tested:\n\n- [`generic/alma9`](https://app.vagrantup.com/generic/boxes/alma9) (libvirt,\n  virtualbox)\n- [`generic/debian12`](https://app.vagrantup.com/generic/boxes/debian12)\n  (libvirt, virtualbox)\n- [`generic/ubuntu2204`](https://app.vagrantup.com/generic/boxes/ubuntu2204)\n  (libvirt, virtualbox)\n\n\nReferences\n----------\n\n- \u003chttps://developer.hashicorp.com/vagrant/docs/provisioning/ansible\u003e\n- \u003chttps://developer.hashicorp.com/vagrant/docs/provisioning/ansible_common\u003e\n- \u003chttps://developer.hashicorp.com/vagrant/docs/provisioning/ansible_local\u003e\n- \u003chttps://docs.ansible.com/ansible/latest/collections/ansible/builtin/first_found_lookup.html\u003e\n- \u003chttps://docs.ansible.com/ansible/latest/collections/kubernetes/core/k8s_module.html#ansible-collections-kubernetes-core-k8s-module\u003e\n- \u003chttps://docs.ansible.com/ansible/latest/collections_guide/collections_installing.html#install-multiple-collections-with-a-requirements-file\u003e\n- \u003chttps://docs.ansible.com/ansible/latest/playbook_guide/playbooks_loops.html#with-sequence\u003e\n- \u003chttps://docs.ansible.com/ansible/latest/reference_appendices/special_variables.html\u003e\n- \u003chttps://github.com/cri-o/packaging/blob/main/README.md\u003e\n- \u003chttps://github.com/justmeandopensource/kubernetes\u003e\n- \u003chttps://github.com/kubernetes/dashboard/blob/v2.7.0/docs/user/access-control/creating-sample-user.md\u003e\n- \u003chttps://github.com/kubernetes/dashboard/blob/v2.7.0/docs/user/accessing-dashboard/README.md\u003e\n- \u003chttps://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-init/\u003e\n- \u003chttps://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-join/\u003e\n- \u003chttps://kubernetes.io/docs/setup/production-environment/container-runtimes/#cri-o\u003e\n- \u003chttps://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/\u003e\n- \u003chttps://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/\u003e\n- \u003chttps://libvirt.org/uri.html\u003e\n- \u003chttps://vagrant-libvirt.github.io/vagrant-libvirt/configuration.html\u003e\n\n\n[1]: https://github.com/aguslr/vagrant-k8s\n[2]: https://kubernetes.io/\n[3]: https://www.vagrantup.com/\n[4]: https://www.ansible.com/\n[5]: https://vagrant-libvirt.github.io/vagrant-libvirt/\n[6]: https://developer.hashicorp.com/vagrant/docs/providers/virtualbox\n[7]: https://developer.hashicorp.com/vagrant/install\n[8]: https://www.virtualbox.org/wiki/Downloads\n[9]: https://kubernetes.io/docs/reference/kubectl/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faguslr%2Fvagrant-k8s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faguslr%2Fvagrant-k8s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faguslr%2Fvagrant-k8s/lists"}