{"id":14986158,"url":"https://github.com/galexrt/k8s-vagrant-multi-node","last_synced_at":"2025-04-09T23:22:14.452Z","repository":{"id":33321547,"uuid":"136528845","full_name":"galexrt/k8s-vagrant-multi-node","owner":"galexrt","description":"A Kubernetes Vagrant Multi node environment using kubeadm.","archived":false,"fork":false,"pushed_at":"2022-01-17T09:37:23.000Z","size":2723,"stargazers_count":166,"open_issues_count":8,"forks_count":80,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-02T21:12:29.723Z","etag":null,"topics":["cluster","kubernetes","multi-node","vagrant"],"latest_commit_sha":null,"homepage":"https://k8s-vagrant-multi-node.galexrt.moe/","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/galexrt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-07T20:41:12.000Z","updated_at":"2024-07-20T13:44:35.000Z","dependencies_parsed_at":"2022-08-07T20:30:34.943Z","dependency_job_id":null,"html_url":"https://github.com/galexrt/k8s-vagrant-multi-node","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galexrt%2Fk8s-vagrant-multi-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galexrt%2Fk8s-vagrant-multi-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galexrt%2Fk8s-vagrant-multi-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/galexrt%2Fk8s-vagrant-multi-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/galexrt","download_url":"https://codeload.github.com/galexrt/k8s-vagrant-multi-node/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248126532,"owners_count":21051953,"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":["cluster","kubernetes","multi-node","vagrant"],"created_at":"2024-09-24T14:12:27.236Z","updated_at":"2025-04-09T23:22:14.424Z","avatar_url":"https://github.com/galexrt.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# k8s-vagrant-multi-node\n\n[![Build Status](https://travis-ci.org/galexrt/k8s-vagrant-multi-node.svg?branch=master)](https://travis-ci.org/galexrt/k8s-vagrant-multi-node)\n\nThis project was based on work from [coolsvap/kubeadm-vagrant](https://github.com/coolsvap/kubeadm-vagrant) by [@coolsvap](https://twitter.com/coolsvap), now it is mostly independent.\n\nA demo of the start and destroy of a cluster can be found here: [README.md Demo section](#demo).\n\n\u003c!-- TOC depthFrom:2 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 --\u003e\n- [k8s-vagrant-multi-node](#k8s-vagrant-multi-node)\n  - [Prerequisites](#prerequisites)\n  - [Hardware Requirements](#hardware-requirements)\n  - [Quickstart](#quickstart)\n  - [VM OS Selection](#vm-os-selection)\n  - [Usage](#usage)\n    - [Starting the environment](#starting-the-environment)\n    - [Faster (parallel) environment start](#faster-parallel-environment-start)\n    - [Show status of VMs](#show-status-of-vms)\n    - [Shutting down the environment](#shutting-down-the-environment)\n    - [Copy local Docker image into VMs](#copy-local-docker-image-into-vms)\n    - [Data inside VM](#data-inside-vm)\n    - [`make` Targets](#make-targets)\n  - [Configuration / Variables](#configuration--variables)\n  - [Troubleshooting](#troubleshooting)\n  - [Demo](#demo)\n  - [Creating an Issue](#creating-an-issue)\n\n\u003c!-- /TOC --\u003e\n\n## Prerequisites\n\n* `make`\n* `kubectl` - Optional when `KUBECTL_AUTO_CONF` is set to `false` (default: `true`).\n* `grep`\n* `cut`\n* `rsync`\n* Source for randomness (only used to generate a kubeadm token, when no custom `KUBETOKEN` is given):\n  * `/dev/urandom`\n  * `openssl` command - Fallback for when `/dev/urandom` is not available.\n* Vagrant (\u003e= `2.2.0`)\n  * Tested with `2.2.2` (if you should experience issues, please upgrade to at least this Vagrant version or higher)\n  * Plugins\n    * `vagrant-reload` **REQUIRED** For `BOX_OS=fedora` (set by default) and when using the `vagrant-reload*` targets, the `vagrant-reload` plugin is needed. An automatic attempt to install the plugin is made. To install manually run one of the following commands:\n      * `make vagrant-plugins` or\n      * `vagrant plugin install vagrant-reload`\n* Vagrant Provider (one of the following two is needed)\n  * libvirt (`vagrant plugin install vagrant-libvirt`)\n    * Tested with `libvirtd` version `5.10.0`.\n    * Libvirt support is still a bit experimental and can be unstable (e.g., VMs not getting IPs).\n      * Troubleshooting: If your VM creation is hanging at `Waiting for domain to get an IP address...`, using `virsh` run `virsh force reset VM_NAME` (`VM_NAME` can be obtained using `virsh list` command) or in virt-manager `Force Reset` on the VM.\n  * Virtualbox (**WARNING** VirtualBox seems to hang the Makefile randomly for some people, `libvirt` is recommended)\n    * Tested with `6.0.0` (if you should experience issues, please upgrade to at least this version or higher)\n    * `VBoxManage` binary in `PATH`.\n\n\u003e **NOTE** `kubectl` is only needed when the `kubectl` auto configuration is enabled (default is enabled), to disable it set the variable `KUBECTL_AUTO_CONF` to `false`.\n\u003e For more information, see the [Configuration / Variables doc page](docs/configuration.md).\n\n## Hardware Requirements\n\n* Master\n  * CPU: 2 Cores (`MASTER_CPUS`)\n  * Memory: 2GB (`MASTER_MEMORY_SIZE_GB`)\n* 1x Node:\n  * CPU: 1 Core (it is recommended to use at least 2 Cores; `NODE_CPUS`)\n  * Memory: 2GB (it is recommended to use more than 2GB; `NODE_MEMORY_SIZE_GB`)\n\nThese resources can be changed by setting the according variables for the `make up` command, see [Configuration / Variables doc page](docs/configuration.md).\n\n## Quickstart\n\nTo start with the defaults, 1x master and 2x workers, run the following:\n\n```shell\n$ make up -j 3\n```\n\nThe `-j3` will cause three VMs to be started in parallel to speed up the cluster creation.\n\n\u003e **NOTE** Your `kubectl` is automatically configured to use a context for the\n\u003e created cluster, after the master VM is started.\n\u003e The context is named after the directory the `Makefile` is in.\n\n```shell\n$ kubectl config current-context\nk8s-vagrant-multi-node\n$ kubectl get componentstatus\nNAME                 STATUS    MESSAGE              ERROR\nscheduler            Healthy   ok\ncontroller-manager   Healthy   ok\netcd-0               Healthy   {\"health\": \"true\"}\n$ kubectl get nodes\nNAME      STATUS    ROLES     AGE       VERSION\nmaster    Ready     master    4m        v1.17.3\nnode1     Ready     \u003cnone\u003e    4m        v1.17.3\nnode2     Ready     \u003cnone\u003e    4m        v1.17.3\n```\n\n## VM OS Selection\n\nThere are multiple sets of Vagrantfiles available (see [`vagrantfiles/`](/vagrantfiles/)) which can be used to use a different OS for the Kubernetes environment.\n\nSee [VM OS Selection doc page](docs/vm-os-selection.md).\n\n## Usage\n\nAlso see [Usage doc page](docs/usage.md).\n\n### Starting the environment\n\nTo start up the Vagrant Kubernetes multi node environment with the default of two worker nodes + a master (not parallel) run:\n\n```shell\n$ make up\n```\n\n\u003e **NOTE** Your `kubectl` is automatically configured to use a context for the\n\u003e created cluster, after the master VM is started.\n\u003e The context is named after the directory the `Makefile` is in.\n\n### Faster (parallel) environment start\n\nTo start up 4 VMs in parallel run (`-j` flag does not control how many (worker) VMs are started, the `NODE_COUNT` variable is used for that):\n\n```shell\n$ NODE_COUNT=3 make up -j4\n```\n\nThe flag `-j CORES/THREADS` allows yout to set how many VMs (Makefile targets) will be run at the same time.\nYou can also use `-j $(nproc)` to start as many VMs as cores/threads you have in your machine.\nSo to start up all VMs (master and three nodes) in parallel, you would add one to the chosen `NODE_COUNT`.\n\n### Show status of VMs\n\n```shell\n$ make status\nmaster                    not created (virtualbox)\nnode1                     not created (virtualbox)\nnode2                     not created (virtualbox)\n```\n\n### Shutting down the environment\n\nTo destroy the Vagrant environment run:\n\n```shell\n$ make clean\n$ make clean-data\n```\n\n### Copy local Docker image into VMs\n\nThe `make load-image` target can be used to copy a docker image from your local docker daemon to all the VMs in your cluster.\nThe `IMG` variable can be expressed in a few ways, for example:\n\n```shell\n$ make load-image IMG=your_name/your_image_name:your_tag\n$ make load-image IMG=your_name/your_image_name\n$ make load-image IMG=my-private-registry.com/your_name/your_image_name:your_tag\n```\n\nYou can also specify a new image name and tag to use after the image has been copied to the VM's by setting the `TAG` variable.\nThis will not change the image/tag in your local docker daemon, it will only affect the image in the VM's.\n\n```shell\n$ make load-image IMG=repo/image:tag TAG=new_repo/new_image:new_tag\n```\n\n### Data inside VM\n\nSee the `data/VM_NAME/` directories, where `VM_NAME` is for example `master`.\n\n### `make` Targets\n\nSee [`make` Targets doc page](docs/make-targets.md).\n\n## Configuration / Variables\n\nSee [Configuration / Variables doc page](docs/configuration.md).\n\n## Troubleshooting\n\nSee [Troubleshooting doc page](docs/troubleshooting.md).\n\n## Demo\n\nSee [Demo doc page](docs/demo.md).\n\n***\n\n## Creating an Issue\n\nPlease attach the output of the `make versions` command to the issue as is shown in the issue template. This makes debugging easier.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalexrt%2Fk8s-vagrant-multi-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgalexrt%2Fk8s-vagrant-multi-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgalexrt%2Fk8s-vagrant-multi-node/lists"}